test_class.file: util/src/test/java/com/google/cloud/hadoop/util/PropertyUtilTest.java
test_class.identifier: PropertyUtilTest
test_case.body: @Test
    public void defaultValueIsReturnedWhenKeyNotFound() {
      assertThat(
              PropertyUtil.getPropertyOrDefault(
                  getClass(), "test.properties", "testKey2", "NotFound"))
          .isEqualTo("NotFound");
    }
test_case.class_method_signature: PropertyUtilTest.defaultValueIsReturnedWhenKeyNotFound()
test_case.full_signature: @Test public void defaultValueIsReturnedWhenKeyNotFound()
test_case.identifier: defaultValueIsReturnedWhenKeyNotFound
test_case.invocations: isEqualTo assertThat getPropertyOrDefault getClass
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void defaultValueIsReturnedWhenKeyNotFound()
focal_class.declarator: logger = GoogleLogger.forEnclosingClass()
focal_class.modifier: private static final
focal_class.original_string: private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();
focal_class.type: GoogleLogger
focal_class.var_name: logger
focal_class.file: util/src/main/java/com/google/cloud/hadoop/util/PropertyUtil.java
focal_class.identifier: PropertyUtil
focal_class.class_method_signature: PropertyUtil.getPropertyOrDefault(
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)
focal_class.full_signature: public static String getPropertyOrDefault(
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)
focal_class.identifier: getPropertyOrDefault
focal_class.modifiers: public static
focal_class.parameters: (
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)
focal_class.return: String
focal_class.signature: String getPropertyOrDefault(
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)
focal_method.body: public static String getPropertyOrDefault(
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue) {
      try (InputStream stream = referenceClass.getResourceAsStream(propertyFile)) {
        if (stream == null) {
          logger.atSevere().log("Could not load properties file '%s'", propertyFile);
          return defaultValue;
        }
        Properties properties = new Properties();
        properties.load(stream);
        String value = properties.getProperty(key);
        if (value == null) {
          logger.atSevere().log("Key %s not found in properties file %s.", key, propertyFile);
          return defaultValue;
        }
        return value;
      } catch (IOException e) {
        logger.atSevere().withCause(e).log(
            "Error while trying to get property value for key %s", key);
        return defaultValue;
      }
    }
focal_method.class_method_signature: PropertyUtil.getPropertyOrDefault(
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)
focal_method.full_signature: public static String getPropertyOrDefault(
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)
focal_method.identifier: getPropertyOrDefault
focal_method.invocations: getResourceAsStream log atSevere load getProperty log atSevere log withCause atSevere
focal_method.modifiers: public static
focal_method.parameters: (
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)
focal_method.return: String
focal_method.signature: String getPropertyOrDefault(
        Class<?> referenceClass,
        String propertyFile,
        String key,
        String defaultValue)