Program: 70236
Project: 70236
Buggy source:
private static void setPropertiesFromRuntime(RuntimeConfigManager manager){
  try {
    if (manager != null) {
      if (manager.getDeploymentId() != null && System.getProperty(ITConstants.IT_DEPLOYMENT_ID) == null) {
        System.setProperty(ITConstants.IT_DEPLOYMENT_ID,manager.getDeploymentId());
      }
      if (manager.getMasterName() != null && System.getProperty(ITConstants.IT_MASTER_NAME) == null) {
        System.setProperty(ITConstants.IT_MASTER_NAME,manager.getMasterName());
      }
      if (manager.getMasterPort() != null && System.getProperty(ITConstants.IT_MASTER_PORT) == null) {
        System.setProperty(ITConstants.IT_MASTER_PORT,manager.getMasterPort());
      }
      if (manager.getAppName() != null && System.getProperty(ITConstants.IT_APP_NAME) == null) {
        System.setProperty(ITConstants.IT_APP_NAME,manager.getAppName());
      }
      if (manager.getCOMPSsBaseLogDir() != null && System.getProperty(ITConstants.IT_BASE_LOG_DIR) == null) {
        System.setProperty(ITConstants.IT_BASE_LOG_DIR,manager.getCOMPSsBaseLogDir());
      }
      if (manager.getSpecificLogDir() != null && System.getProperty(ITConstants.IT_SPECIFIC_LOG_DIR) == null) {
        System.setProperty(ITConstants.IT_SPECIFIC_LOG_DIR,manager.getSpecificLogDir());
      }
      if (manager.getLog4jConfiguration() != null && System.getProperty(ITConstants.LOG4J) == null) {
        System.setProperty(ITConstants.LOG4J,manager.getLog4jConfiguration());
      }
      if (manager.getResourcesFile() != null && System.getProperty(ITConstants.IT_RES_FILE) == null) {
        System.setProperty(ITConstants.IT_RES_FILE,manager.getResourcesFile());
      }
      if (manager.getResourcesSchema() != null && System.getProperty(ITConstants.IT_RES_SCHEMA) == null) {
        System.setProperty(ITConstants.IT_RES_SCHEMA,manager.getResourcesSchema());
      }
      if (manager.getProjectFile() != null && System.getProperty(ITConstants.IT_PROJ_FILE) == null) {
        System.setProperty(ITConstants.IT_PROJ_FILE,manager.getProjectFile());
      }
      if (manager.getProjectSchema() != null && System.getProperty(ITConstants.IT_PROJ_SCHEMA) == null) {
        System.setProperty(ITConstants.IT_PROJ_SCHEMA,manager.getProjectSchema());
      }
      if (manager.getScheduler() != null && System.getProperty(ITConstants.IT_SCHEDULER) == null) {
        System.setProperty(ITConstants.IT_SCHEDULER,manager.getScheduler());
      }
      if (manager.getMonitorInterval() > 0 && System.getProperty(ITConstants.IT_MONITOR) == null) {
        System.setProperty(ITConstants.IT_MONITOR,Long.toString(manager.getMonitorInterval()));
      }
      if (manager.getGATAdaptor() != null && System.getProperty(ITConstants.GAT_ADAPTOR_PATH) == null) {
        System.setProperty(ITConstants.GAT_ADAPTOR_PATH,manager.getGATAdaptor());
      }
      if (manager.getGATBrokerAdaptor() != null && System.getProperty(ITConstants.GAT_BROKER_ADAPTOR) == null) {
        System.setProperty(ITConstants.GAT_BROKER_ADAPTOR,manager.getGATBrokerAdaptor());
      }
      if (manager.getGATFileAdaptor() != null && System.getProperty(ITConstants.GAT_FILE_ADAPTOR) == null) {
        System.setProperty(ITConstants.GAT_FILE_ADAPTOR,manager.getGATFileAdaptor());
      }
      if (manager.getWorkerCP() != null && System.getProperty(ITConstants.IT_WORKER_CP) == null) {
        System.setProperty(ITConstants.IT_WORKER_CP,manager.getWorkerCP());
      }
      if (manager.getServiceName() != null && System.getProperty(ITConstants.IT_SERVICE_NAME) == null) {
        System.setProperty(ITConstants.IT_SERVICE_NAME,manager.getServiceName());
      }
      if (System.getProperty(ITConstants.COMM_ADAPTOR) == null) {
        if (manager.getCommAdaptor() != null) {
          System.setProperty(ITConstants.COMM_ADAPTOR,manager.getCommAdaptor());
        }
 else {
          System.setProperty(ITConstants.COMM_ADAPTOR,ITConstants.DEFAULT_ADAPTOR);
        }
      }
      if (System.getProperty(ITConstants.GAT_DEBUG) == null) {
        System.setProperty(ITConstants.GAT_DEBUG,Boolean.toString(manager.isGATDebug()));
      }
      if (System.getProperty(ITConstants.IT_LANG) == null) {
        System.setProperty(ITConstants.IT_LANG,manager.getLang());
      }
      if (System.getProperty(ITConstants.IT_GRAPH) == null) {
        System.setProperty(ITConstants.IT_GRAPH,Boolean.toString(manager.isGraph()));
      }
      if (System.getProperty(ITConstants.IT_TRACING) == null) {
        System.setProperty(ITConstants.IT_TRACING,String.valueOf(manager.getTracing()));
      }
      if (System.getProperty(ITConstants.IT_EXTRAE_CONFIG_FILE) == null) {
        System.setProperty(ITConstants.IT_EXTRAE_CONFIG_FILE,manager.getCustomExtraeFile());
      }
      if (System.getProperty(ITConstants.IT_PRESCHED) == null) {
        System.setProperty(ITConstants.IT_PRESCHED,Boolean.toString(manager.isPresched()));
      }
      if (System.getProperty(ITConstants.IT_TASK_EXECUTION) == null || System.getProperty(ITConstants.IT_TASK_EXECUTION).equals("String_Node_Str")) {
        System.setProperty(ITConstants.IT_TASK_EXECUTION,ITConstants.EXECUTION_INTERNAL);
      }
      if (manager.getContext() != null) {
        System.setProperty(ITConstants.IT_CONTEXT,manager.getContext());
      }
      System.setProperty(ITConstants.IT_TO_FILE,Boolean.toString(manager.isToFile()));
    }
 else {
      setDefaultProperties();
    }
  }
 catch (  Exception e) {
    System.err.println(WARN_IT_FILE_NOT_READ);
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private static void setPropertiesFromRuntime(RuntimeConfigManager manager){
  try {
    if (manager != null) {
      if (manager.getDeploymentId() != null && System.getProperty(ITConstants.IT_DEPLOYMENT_ID) == null) {
        System.setProperty(ITConstants.IT_DEPLOYMENT_ID,manager.getDeploymentId());
      }
      if (manager.getMasterName() != null && System.getProperty(ITConstants.IT_MASTER_NAME) == null) {
        System.setProperty(ITConstants.IT_MASTER_NAME,manager.getMasterName());
      }
      if (manager.getMasterPort() != null && System.getProperty(ITConstants.IT_MASTER_PORT) == null) {
        System.setProperty(ITConstants.IT_MASTER_PORT,manager.getMasterPort());
      }
      if (manager.getAppName() != null && System.getProperty(ITConstants.IT_APP_NAME) == null) {
        System.setProperty(ITConstants.IT_APP_NAME,manager.getAppName());
      }
      if (manager.getTaskSummary() != null && System.getProperty(ITConstants.IT_TASK_SUMMARY) == null) {
        System.setProperty(ITConstants.IT_TASK_SUMMARY,manager.getTaskSummary());
      }
      if (manager.getCOMPSsBaseLogDir() != null && System.getProperty(ITConstants.IT_BASE_LOG_DIR) == null) {
        System.setProperty(ITConstants.IT_BASE_LOG_DIR,manager.getCOMPSsBaseLogDir());
      }
      if (manager.getSpecificLogDir() != null && System.getProperty(ITConstants.IT_SPECIFIC_LOG_DIR) == null) {
        System.setProperty(ITConstants.IT_SPECIFIC_LOG_DIR,manager.getSpecificLogDir());
      }
      if (manager.getLog4jConfiguration() != null && System.getProperty(ITConstants.LOG4J) == null) {
        System.setProperty(ITConstants.LOG4J,manager.getLog4jConfiguration());
      }
      if (manager.getResourcesFile() != null && System.getProperty(ITConstants.IT_RES_FILE) == null) {
        System.setProperty(ITConstants.IT_RES_FILE,manager.getResourcesFile());
      }
      if (manager.getResourcesSchema() != null && System.getProperty(ITConstants.IT_RES_SCHEMA) == null) {
        System.setProperty(ITConstants.IT_RES_SCHEMA,manager.getResourcesSchema());
      }
      if (manager.getProjectFile() != null && System.getProperty(ITConstants.IT_PROJ_FILE) == null) {
        System.setProperty(ITConstants.IT_PROJ_FILE,manager.getProjectFile());
      }
      if (manager.getProjectSchema() != null && System.getProperty(ITConstants.IT_PROJ_SCHEMA) == null) {
        System.setProperty(ITConstants.IT_PROJ_SCHEMA,manager.getProjectSchema());
      }
      if (manager.getScheduler() != null && System.getProperty(ITConstants.IT_SCHEDULER) == null) {
        System.setProperty(ITConstants.IT_SCHEDULER,manager.getScheduler());
      }
      if (manager.getMonitorInterval() > 0 && System.getProperty(ITConstants.IT_MONITOR) == null) {
        System.setProperty(ITConstants.IT_MONITOR,Long.toString(manager.getMonitorInterval()));
      }
      if (manager.getGATAdaptor() != null && System.getProperty(ITConstants.GAT_ADAPTOR_PATH) == null) {
        System.setProperty(ITConstants.GAT_ADAPTOR_PATH,manager.getGATAdaptor());
      }
      if (manager.getGATBrokerAdaptor() != null && System.getProperty(ITConstants.GAT_BROKER_ADAPTOR) == null) {
        System.setProperty(ITConstants.GAT_BROKER_ADAPTOR,manager.getGATBrokerAdaptor());
      }
      if (manager.getGATFileAdaptor() != null && System.getProperty(ITConstants.GAT_FILE_ADAPTOR) == null) {
        System.setProperty(ITConstants.GAT_FILE_ADAPTOR,manager.getGATFileAdaptor());
      }
      if (manager.getWorkerCP() != null && System.getProperty(ITConstants.IT_WORKER_CP) == null) {
        System.setProperty(ITConstants.IT_WORKER_CP,manager.getWorkerCP());
      }
      if (manager.getServiceName() != null && System.getProperty(ITConstants.IT_SERVICE_NAME) == null) {
        System.setProperty(ITConstants.IT_SERVICE_NAME,manager.getServiceName());
      }
      if (System.getProperty(ITConstants.COMM_ADAPTOR) == null) {
        if (manager.getCommAdaptor() != null) {
          System.setProperty(ITConstants.COMM_ADAPTOR,manager.getCommAdaptor());
        }
 else {
          System.setProperty(ITConstants.COMM_ADAPTOR,ITConstants.DEFAULT_ADAPTOR);
        }
      }
      if (System.getProperty(ITConstants.GAT_DEBUG) == null) {
        System.setProperty(ITConstants.GAT_DEBUG,Boolean.toString(manager.isGATDebug()));
      }
      if (System.getProperty(ITConstants.IT_LANG) == null) {
        System.setProperty(ITConstants.IT_LANG,manager.getLang());
      }
      if (System.getProperty(ITConstants.IT_GRAPH) == null) {
        System.setProperty(ITConstants.IT_GRAPH,Boolean.toString(manager.isGraph()));
      }
      if (System.getProperty(ITConstants.IT_TRACING) == null) {
        System.setProperty(ITConstants.IT_TRACING,String.valueOf(manager.getTracing()));
      }
      if (System.getProperty(ITConstants.IT_EXTRAE_CONFIG_FILE) == null) {
        System.setProperty(ITConstants.IT_EXTRAE_CONFIG_FILE,manager.getCustomExtraeFile());
      }
      if (System.getProperty(ITConstants.IT_PRESCHED) == null) {
        System.setProperty(ITConstants.IT_PRESCHED,Boolean.toString(manager.isPresched()));
      }
      if (System.getProperty(ITConstants.IT_TASK_EXECUTION) == null || System.getProperty(ITConstants.IT_TASK_EXECUTION).equals("String_Node_Str")) {
        System.setProperty(ITConstants.IT_TASK_EXECUTION,ITConstants.EXECUTION_INTERNAL);
      }
      if (manager.getContext() != null) {
        System.setProperty(ITConstants.IT_CONTEXT,manager.getContext());
      }
      System.setProperty(ITConstants.IT_TO_FILE,Boolean.toString(manager.isToFile()));
    }
 else {
      setDefaultProperties();
    }
  }
 catch (  Exception e) {
    System.err.println(WARN_IT_FILE_NOT_READ);
    e.printStackTrace();
  }
}