Program: 33193
Project: 33193
Buggy source:
private static DatasetConfiguration getConfiguration(String datasetKey,EntityCheckerManager entityCheckerManager,SameAsRetriever globalRetriever) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
  org.apache.commons.configuration.Configuration config=GerbilConfiguration.getInstance();
  StringBuilder keyBuilder=new StringBuilder();
  String key;
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_NAME_SUFFIX);
  if (!config.containsKey(key)) {
    LOGGER.error("String_Node_Str" + datasetKey + "String_Node_Str");
    return null;
  }
  String name=config.getString(key);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CLASS_SUFFIX);
  if (!config.containsKey(key)) {
    LOGGER.error("String_Node_Str" + datasetKey + "String_Node_Str");
    return null;
  }
  String classString=config.getString(key);
  @SuppressWarnings("String_Node_Str") Class<? extends Dataset> datasetClass=(Class<? extends Dataset>)DatasetsConfig.class.getClassLoader().loadClass(classString);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_EXPERIMENT_TYPE_SUFFIX);
  if (!config.containsKey(key)) {
    LOGGER.error("String_Node_Str" + datasetKey + "String_Node_Str");
    return null;
  }
  String typeString=config.getString(key);
  ExperimentType type=ExperimentType.valueOf(typeString);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CACHE_FLAG_SUFFIX);
  boolean cacheable=true;
  if (config.containsKey(key)) {
    cacheable=config.getBoolean(key);
  }
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CONSTRUCTOR_ARGS_SUFFIX);
  String constructorArgStrings[];
  if (config.containsKey(key)) {
    constructorArgStrings=config.getStringArray(key);
  }
 else {
    constructorArgStrings=new String[0];
  }
  Object constructorArgs[]=new Object[constructorArgStrings.length];
  Class<?> constructorArgClasses[]=new Class[constructorArgStrings.length];
  for (int i=0; i < constructorArgs.length; ++i) {
    constructorArgs[i]=constructorArgStrings[i];
    constructorArgClasses[i]=String.class;
  }
  Constructor<? extends Dataset> constructor=datasetClass.getConstructor(constructorArgClasses);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CHECK_CLASS_SUFFIX);
  if (config.containsKey(key)) {
    String checkerClassName=config.getString(key);
    key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CHECK_CLASS_SUFFIX);
    String checkerArgStrings[];
    if (config.containsKey(key)) {
      checkerArgStrings=config.getStringArray(key);
    }
 else {
      checkerArgStrings=new String[0];
    }
    Object checkerArgs[]=new Object[checkerArgStrings.length];
    for (int i=0; i < checkerArgs.length; ++i) {
      checkerArgs[i]=checkerArgStrings[i];
    }
    try {
      @SuppressWarnings("String_Node_Str") Class<? extends Checker> checkerClass=(Class<? extends Checker>)DatasetsConfig.class.getClassLoader().loadClass(checkerClassName);
      Checker checker=checkerClass.newInstance();
      if (!checker.check(checkerArgs)) {
        LOGGER.info("String_Node_Str",name);
        return null;
      }
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str" + name + "String_Node_Str",e);
    }
  }
  return new SingletonDatasetConfigImpl(name,cacheable,constructor,constructorArgs,type,entityCheckerManager,globalRetriever);
}

Fixed version (ground truth):
private static DatasetConfiguration getConfiguration(String datasetKey,EntityCheckerManager entityCheckerManager,SameAsRetriever globalRetriever) throws ClassNotFoundException, NoSuchMethodException, SecurityException {
  org.apache.commons.configuration.Configuration config=GerbilConfiguration.getInstance();
  StringBuilder keyBuilder=new StringBuilder();
  String key;
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_NAME_SUFFIX);
  if (!config.containsKey(key)) {
    LOGGER.error("String_Node_Str" + datasetKey + "String_Node_Str");
    return null;
  }
  String name=config.getString(key);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CLASS_SUFFIX);
  if (!config.containsKey(key)) {
    LOGGER.error("String_Node_Str" + datasetKey + "String_Node_Str");
    return null;
  }
  String classString=config.getString(key);
  @SuppressWarnings("String_Node_Str") Class<? extends Dataset> datasetClass=(Class<? extends Dataset>)DatasetsConfig.class.getClassLoader().loadClass(classString);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_EXPERIMENT_TYPE_SUFFIX);
  if (!config.containsKey(key)) {
    LOGGER.error("String_Node_Str" + datasetKey + "String_Node_Str");
    return null;
  }
  String typeString=config.getString(key);
  ExperimentType type=ExperimentType.valueOf(typeString);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CACHE_FLAG_SUFFIX);
  boolean cacheable=true;
  if (config.containsKey(key)) {
    cacheable=config.getBoolean(key);
  }
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CONSTRUCTOR_ARGS_SUFFIX);
  String constructorArgStrings[];
  if (config.containsKey(key)) {
    constructorArgStrings=config.getStringArray(key);
  }
 else {
    constructorArgStrings=new String[0];
  }
  Object constructorArgs[]=new Object[constructorArgStrings.length];
  Class<?> constructorArgClasses[]=new Class[constructorArgStrings.length];
  for (int i=0; i < constructorArgs.length; ++i) {
    constructorArgs[i]=constructorArgStrings[i];
    constructorArgClasses[i]=String.class;
  }
  Constructor<? extends Dataset> constructor=datasetClass.getConstructor(constructorArgClasses);
  key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CHECK_CLASS_SUFFIX);
  if (config.containsKey(key)) {
    String checkerClassName=config.getString(key);
    key=buildKey(keyBuilder,datasetKey,ANNOTATOR_CHECK_ARGS_SUFFIX);
    String checkerArgStrings[];
    if (config.containsKey(key)) {
      checkerArgStrings=config.getStringArray(key);
    }
 else {
      checkerArgStrings=new String[0];
    }
    Object checkerArgs[]=new Object[checkerArgStrings.length];
    for (int i=0; i < checkerArgs.length; ++i) {
      checkerArgs[i]=checkerArgStrings[i];
    }
    try {
      @SuppressWarnings("String_Node_Str") Class<? extends Checker> checkerClass=(Class<? extends Checker>)DatasetsConfig.class.getClassLoader().loadClass(checkerClassName);
      Checker checker=checkerClass.newInstance();
      if (!checker.check(checkerArgs)) {
        LOGGER.info("String_Node_Str",name);
        return null;
      }
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str" + name + "String_Node_Str",e);
    }
  }
  return new SingletonDatasetConfigImpl(name,cacheable,constructor,constructorArgs,type,entityCheckerManager,globalRetriever);
}