Program: 66570
Project: 66570
Buggy source:
/** 
 * Get common properties (including database properties) from System, for unavailable ones, read from test.properties file. The location of properties file can be given by system property <tt>test.properties</tt>. The default location is "test.properties" file in current directory. 
 */
@SuppressWarnings("String_Node_Str") public static Map<String,String> getDatabaseProperties(){
  if (propertiesMap == null) {
    String dbDriver=System.getProperty(DB_DRIVER_KEY);
    String dbUrl=System.getProperty(DB_URL_KEY);
    String dbUser=System.getProperty(DB_USER_KEY);
    String dbPwd=System.getProperty(DB_PWD_KEY);
    String platform=System.getProperty(DB_PLATFORM_KEY);
    String logLevel=System.getProperty(LOGGING_LEVEL_KEY);
    if ((dbDriver == null) || (dbUrl == null) || (dbUser == null)|| (dbPwd == null)|| (platform == null)|| (logLevel == null)) {
      Properties properties=new Properties();
      File testPropertiesFile=new File(System.getProperty(TEST_PROPERTIES_FILE_KEY,TEST_PROPERTIES_FILE_DEFAULT));
      URL url=null;
      if (testPropertiesFile.exists()) {
        try {
          url=testPropertiesFile.toURL();
        }
 catch (        MalformedURLException exception) {
          throw new RuntimeException("String_Node_Str" + testPropertiesFile.getName() + "String_Node_Str",exception);
        }
      }
 else {
        url=JUnitTestCaseHelper.class.getResource("String_Node_Str" + System.getProperty(TEST_PROPERTIES_FILE_KEY,TEST_PROPERTIES_FILE_DEFAULT));
      }
      if (url != null) {
        try {
          properties.load(url.openStream());
        }
 catch (        java.io.IOException exception) {
          throw new RuntimeException("String_Node_Str" + testPropertiesFile.getName() + "String_Node_Str",exception);
        }
      }
      if (dbDriver == null) {
        dbDriver=(String)properties.get("String_Node_Str");
      }
      if (dbUrl == null) {
        dbUrl=(String)properties.get("String_Node_Str");
      }
      if (dbUser == null) {
        dbUser=(String)properties.get("String_Node_Str");
      }
      if (dbPwd == null) {
        dbPwd=(String)properties.get("String_Node_Str");
      }
      if (platform == null) {
        platform=(String)properties.get("String_Node_Str");
      }
      if (logLevel == null) {
        logLevel=(String)properties.get(PersistenceUnitProperties.LOGGING_LEVEL);
      }
    }
    propertiesMap=new HashMap();
    if (dbDriver != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_DRIVER,dbDriver);
    }
    if (dbUrl != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_URL,dbUrl);
    }
    if (dbUser != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_USER,dbUser);
    }
    if (dbPwd != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_PASSWORD,dbPwd);
    }
    if (logLevel != null) {
      propertiesMap.put(PersistenceUnitProperties.LOGGING_LEVEL,logLevel);
    }
    if (platform != null) {
      propertiesMap.put(PersistenceUnitProperties.TARGET_DATABASE,platform);
    }
    propertiesMap.putAll(persistencePropertiesTestMap);
  }
  return propertiesMap;
}

Fixed version (ground truth):
/** 
 * Get common properties (including database properties) from System, for unavailable ones, read from test.properties file. The location of properties file can be given by system property <tt>test.properties</tt>. The default location is "test.properties" file in current directory. 
 */
@SuppressWarnings("String_Node_Str") public static Map<String,String> getDatabaseProperties(){
  if (propertiesMap == null) {
    String dbDriver=System.getProperty(DB_DRIVER_KEY);
    String dbUrl=System.getProperty(DB_URL_KEY);
    String dbUser=System.getProperty(DB_USER_KEY);
    String dbPwd=System.getProperty(DB_PWD_KEY);
    String platform=System.getProperty(DB_PLATFORM_KEY);
    String logLevel=System.getProperty(LOGGING_LEVEL_KEY);
    if ((dbDriver == null) || (dbUrl == null) || (dbUser == null)|| (dbPwd == null)|| (platform == null)|| (logLevel == null)) {
      Properties properties=new Properties();
      File testPropertiesFile=new File(System.getProperty(TEST_PROPERTIES_FILE_KEY,TEST_PROPERTIES_FILE_DEFAULT));
      URL url=null;
      if (testPropertiesFile.exists()) {
        try {
          url=testPropertiesFile.toURL();
        }
 catch (        MalformedURLException exception) {
          throw new RuntimeException("String_Node_Str" + testPropertiesFile.getName() + "String_Node_Str",exception);
        }
      }
 else {
        url=JUnitTestCaseHelper.class.getResource("String_Node_Str" + System.getProperty(TEST_PROPERTIES_FILE_KEY,TEST_PROPERTIES_FILE_DEFAULT));
      }
      if (url != null) {
        try {
          properties.load(url.openStream());
        }
 catch (        java.io.IOException exception) {
          throw new RuntimeException("String_Node_Str" + testPropertiesFile.getName() + "String_Node_Str",exception);
        }
      }
      if (dbDriver == null) {
        dbDriver=(String)properties.get(DB_DRIVER_KEY);
      }
      if (dbUrl == null) {
        dbUrl=(String)properties.get(DB_URL_KEY);
      }
      if (dbUser == null) {
        dbUser=(String)properties.get(DB_USER_KEY);
      }
      if (dbPwd == null) {
        dbPwd=(String)properties.get(DB_PWD_KEY);
      }
      if (platform == null) {
        platform=(String)properties.get(DB_PLATFORM_KEY);
      }
      if (logLevel == null) {
        logLevel=(String)properties.get(PersistenceUnitProperties.LOGGING_LEVEL);
      }
    }
    propertiesMap=new HashMap();
    if (dbDriver != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_DRIVER,dbDriver);
    }
    if (dbUrl != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_URL,dbUrl);
    }
    if (dbUser != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_USER,dbUser);
    }
    if (dbPwd != null) {
      propertiesMap.put(PersistenceUnitProperties.JDBC_PASSWORD,dbPwd);
    }
    if (logLevel != null) {
      propertiesMap.put(PersistenceUnitProperties.LOGGING_LEVEL,logLevel);
    }
    if (platform != null) {
      propertiesMap.put(PersistenceUnitProperties.TARGET_DATABASE,platform);
    }
    propertiesMap.putAll(persistencePropertiesTestMap);
  }
  return propertiesMap;
}