nus-yam/ex-repair huggingface dataset:
Program: 33252
Project: 33252
Buggy source:
public List<MeaningSpan> getAnnotations(String textWithMentions) throws GerbilException {
  String agdistisUrl="String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str";
  String parameters=null;
  try {
    parameters="String_Node_Str" + URLEncoder.encode(textWithMentions,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
  }
  HttpEntity entity=new StringEntity(parameters,ContentType.APPLICATION_FORM_URLENCODED);
  HttpPost request=createPostRequest(agdistisUrl);
  request.addHeader("String_Node_Str","String_Node_Str");
  request.addHeader("String_Node_Str","String_Node_Str");
  request.setEntity(entity);
  entity=null;
  CloseableHttpResponse response=null;
  List<MeaningSpan> annotations=null;
  try {
    response=sendRequest(request);
    entity=response.getEntity();
    try {
      annotations=parseJsonStream(entity.getContent());
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
  }
  finally {
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    if (response != null) {
      try {
        response.close();
      }
 catch (      IOException e) {
      }
    }
    closeRequest(request);
  }
  return annotations;
}

Fixed version (ground truth):
public List<MeaningSpan> getAnnotations(String textWithMentions) throws GerbilException {
  String agdistisUrl="String_Node_Str" + host + "String_Node_Str"+ port+ "String_Node_Str";
  String parameters=null;
  try {
    parameters="String_Node_Str" + URLEncoder.encode(textWithMentions,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
  }
  HttpEntity entity=new StringEntity(parameters,ContentType.APPLICATION_FORM_URLENCODED);
  HttpPost request=createPostRequest(agdistisUrl);
  request.addHeader(HttpHeaders.CONTENT_TYPE,"String_Node_Str");
  request.addHeader(HttpHeaders.ACCEPT_CHARSET,"String_Node_Str");
  request.setEntity(entity);
  entity=null;
  CloseableHttpResponse response=null;
  List<MeaningSpan> annotations=null;
  try {
    response=sendRequest(request);
    entity=response.getEntity();
    try {
      annotations=parseJsonStream(entity.getContent());
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
  }
  finally {
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    if (response != null) {
      try {
        response.close();
      }
 catch (      IOException e) {
      }
    }
    closeRequest(request);
  }
  return annotations;
}
Program: 33257
Project: 33257
Buggy source:
protected Document requestAnnotations(Document document) throws GerbilException {
  Document resultDoc=new DocumentImpl(document.getText(),document.getDocumentURI());
  HttpPost request=createPostRequest(serviceUrl);
  String parameters=null;
  try {
    parameters=PARAMETERS + URLEncoder.encode(document.getText(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
  }
  HttpEntity entity=new StringEntity(parameters,ContentType.APPLICATION_FORM_URLENCODED);
  request.addHeader("String_Node_Str","String_Node_Str");
  request.addHeader("String_Node_Str","String_Node_Str");
  request.addHeader("String_Node_Str","String_Node_Str");
  request.setEntity(entity);
  entity=null;
  CloseableHttpResponse response=null;
  try {
    response=sendRequest(request);
    entity=response.getEntity();
    try {
      parseJson(IOUtils.toString(entity.getContent(),"String_Node_Str"),resultDoc);
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
  }
  finally {
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    if (response != null) {
      try {
        response.close();
      }
 catch (      IOException e) {
      }
    }
    closeRequest(request);
  }
  return resultDoc;
}

Fixed version (ground truth):
protected Document requestAnnotations(Document document) throws GerbilException {
  Document resultDoc=new DocumentImpl(document.getText(),document.getDocumentURI());
  HttpPost request=createPostRequest(serviceUrl);
  String parameters=null;
  try {
    parameters=PARAMETERS + URLEncoder.encode(document.getText(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
  }
  HttpEntity entity=new StringEntity(parameters,ContentType.APPLICATION_FORM_URLENCODED);
  request.addHeader(HttpHeaders.CONTENT_TYPE,"String_Node_Str");
  request.addHeader(HttpHeaders.ACCEPT,"String_Node_Str");
  request.addHeader(HttpHeaders.ACCEPT_CHARSET,"String_Node_Str");
  request.setEntity(entity);
  entity=null;
  CloseableHttpResponse response=null;
  try {
    response=sendRequest(request);
    entity=response.getEntity();
    try {
      parseJson(IOUtils.toString(entity.getContent(),"String_Node_Str"),resultDoc);
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
      throw new GerbilException("String_Node_Str",e,ErrorTypes.UNEXPECTED_EXCEPTION);
    }
  }
  finally {
    if (entity != null) {
      try {
        EntityUtils.consume(entity);
      }
 catch (      IOException e1) {
      }
    }
    if (response != null) {
      try {
        response.close();
      }
 catch (      IOException e) {
      }
    }
    closeRequest(request);
  }
  return resultDoc;
}
Program: 33258
Project: 33258
Buggy source:
public AbstractHttpBasedAnnotator(String name,CloseableHttpClient client){
  super(name);
  this.client=client;
}

Fixed version (ground truth):
public AbstractHttpBasedAnnotator(String name,CloseableHttpClient client){
  super(name,client);
}
Program: 33259
Project: 33259
Buggy source:
protected static List<TypedNamedEntity> performOKETask2(ErrorCountingAnnotatorDecorator errorCounter,Document document) throws AnnotationException, GerbilException {
  List<TypedNamedEntity> result=null;
  try {
    result=((OKETask2Annotator)errorCounter.getDecoratedAnnotator()).performTask2(document);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new ArrayList<TypedNamedEntity>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Span s : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(s.toString());
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}

Fixed version (ground truth):
protected static List<TypedNamedEntity> performOKETask2(ErrorCountingAnnotatorDecorator errorCounter,Document document) throws GerbilException {
  List<TypedNamedEntity> result=null;
  try {
    result=((OKETask2Annotator)errorCounter.getDecoratedAnnotator()).performTask2(document);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new ArrayList<TypedNamedEntity>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Span s : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(s.toString());
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}
Program: 33260
Project: 33260
Buggy source:
protected static List<TypedNamedEntity> performOKETask1(ErrorCountingAnnotatorDecorator errorCounter,Document document) throws AnnotationException, GerbilException {
  List<TypedNamedEntity> result=null;
  try {
    result=((OKETask1Annotator)errorCounter.getDecoratedAnnotator()).performTask1(document);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new ArrayList<TypedNamedEntity>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Span s : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(s.toString());
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}

Fixed version (ground truth):
protected static List<TypedNamedEntity> performOKETask1(ErrorCountingAnnotatorDecorator errorCounter,Document document) throws GerbilException {
  List<TypedNamedEntity> result=null;
  try {
    result=((OKETask1Annotator)errorCounter.getDecoratedAnnotator()).performTask1(document);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new ArrayList<TypedNamedEntity>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Span s : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(s.toString());
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}
Program: 33261
Project: 33261
Buggy source:
protected static List<Span> performRecognition(ErrorCountingAnnotatorDecorator errorCounter,Document document) throws AnnotationException, GerbilException {
  List<Span> result=null;
  try {
    result=((EntityRecognizer)errorCounter.getDecoratedAnnotator()).performRecognition(document);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new ArrayList<Span>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Span s : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(s.toString());
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}

Fixed version (ground truth):
protected static List<Span> performRecognition(ErrorCountingAnnotatorDecorator errorCounter,Document document) throws GerbilException {
  List<Span> result=null;
  try {
    result=((EntityRecognizer)errorCounter.getDecoratedAnnotator()).performRecognition(document);
  }
 catch (  Exception e) {
    if (errorCounter.getErrorCount() == 0) {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str",e);
    }
 else {
      LOGGER.error("String_Node_Str" + errorCounter.getName() + "String_Node_Str"+ e.getLocalizedMessage());
    }
    errorCounter.increaseErrorCount();
    return new ArrayList<Span>(0);
  }
  if (LOGGER.isDebugEnabled()) {
    StringBuilder builder=new StringBuilder();
    builder.append('[');
    builder.append(errorCounter.getName());
    builder.append("String_Node_Str");
    boolean first=true;
    for (    Span s : result) {
      if (first) {
        first=false;
      }
 else {
        builder.append(',');
      }
      builder.append("String_Node_Str");
      builder.append(s.toString());
    }
    builder.append(']');
    LOGGER.debug(builder.toString());
  }
  return result;
}
Program: 33262
Project: 33262
Buggy source:
public synchronized void init() throws GerbilException {
  if (hasBeenInitialized) {
    return;
  }
  Model nifModel=ModelFactory.createDefaultModel();
  InputStream inputStream=getDataAsInputStream();
  if (inputStream == null) {
    throw new GerbilException("String_Node_Str",ErrorTypes.DATASET_LOADING_ERROR);
  }
  try {
    LocalNIFParser parser=new LocalNIFParser(this);
    documents=parser.parseNIF(inputStream,nifModel);
  }
 catch (  Exception e) {
    throw new GerbilException("String_Node_Str",e,ErrorTypes.DATASET_LOADING_ERROR);
  }
 finally {
    closeInputStream(inputStream);
  }
  rdfModel=nifModel;
  hasBeenInitialized=true;
  LOGGER.info("String_Node_Str",name);
}

Fixed version (ground truth):
@Override public synchronized void init() throws GerbilException {
  if (hasBeenInitialized) {
    return;
  }
  Model nifModel=ModelFactory.createDefaultModel();
  InputStream inputStream=getDataAsInputStream();
  if (inputStream == null) {
    throw new GerbilException("String_Node_Str",ErrorTypes.DATASET_LOADING_ERROR);
  }
  try {
    LocalNIFParser parser=new LocalNIFParser(this);
    documents=parser.parseNIF(inputStream,nifModel);
  }
 catch (  Exception e) {
    throw new GerbilException("String_Node_Str",e,ErrorTypes.DATASET_LOADING_ERROR);
  }
 finally {
    closeInputStream(inputStream);
  }
  rdfModel=nifModel;
  hasBeenInitialized=true;
  LOGGER.info("String_Node_Str",name);
}
Program: 33263
Project: 33263
Buggy source:
protected Dataset loadDataset() throws Exception {
  Dataset instance=constructor.newInstance(constructorArgs);
  instance.setName(this.getName());
  return instance;
}

Fixed version (ground truth):
protected Dataset loadDataset() throws Exception {
  Dataset instance=constructor.newInstance(constructorArgs);
  instance.setName(this.getName());
  if (instance instanceof InitializableDataset) {
    ((InitializableDataset)instance).init();
  }
  return instance;
}
Program: 33264
Project: 33264
Buggy source:
@SuppressWarnings("String_Node_Str") protected void setConfigurations(List<T> configurations){
  this.configurations=configurations;
  nameToAdapterMapping=new HashMap<String,List<T>>();
  List<T> adapters;
  for (  T config : configurations) {
    if (nameToAdapterMapping.containsKey(config.getName())) {
      adapters=new ArrayList<T>(2);
      nameToAdapterMapping.put(config.getName(),adapters);
    }
 else {
      adapters=nameToAdapterMapping.get(config.getName());
    }
    adapters.add(config);
    Collections.sort(adapters);
  }
  ExperimentType types[]=ExperimentType.values();
  experimentTypesToAdapterMapping=new List[types.length];
  int id;
  for (int i=0; i < types.length; ++i) {
    experimentTypesToAdapterMapping[i]=new ArrayList<T>();
    for (    String name : nameToAdapterMapping.keySet()) {
      adapters=nameToAdapterMapping.get(name);
      id=0;
      while ((id < adapters.size()) && (!adapters.get(id).isApplicableForExperiment(types[i]))) {
        ++id;
      }
      if (id < adapters.size()) {
        experimentTypesToAdapterMapping[i].add(adapters.get(id));
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected void setConfigurations(List<T> configurations){
  this.configurations=configurations;
  nameToAdapterMapping=new HashMap<String,List<T>>();
  List<T> adapters;
  for (  T config : configurations) {
    if (nameToAdapterMapping.containsKey(config.getName())) {
      adapters=nameToAdapterMapping.get(config.getName());
    }
 else {
      adapters=new ArrayList<T>(2);
      nameToAdapterMapping.put(config.getName(),adapters);
    }
    adapters.add(config);
    Collections.sort(adapters);
  }
  ExperimentType types[]=ExperimentType.values();
  experimentTypesToAdapterMapping=new List[types.length];
  int id;
  for (int i=0; i < types.length; ++i) {
    experimentTypesToAdapterMapping[i]=new ArrayList<T>();
    for (    String name : nameToAdapterMapping.keySet()) {
      adapters=nameToAdapterMapping.get(name);
      id=0;
      while ((id < adapters.size()) && (!adapters.get(id).isApplicableForExperiment(types[i]))) {
        ++id;
      }
      if (id < adapters.size()) {
        experimentTypesToAdapterMapping[i].add(adapters.get(id));
      }
    }
  }
}
Program: 33265
Project: 33265
Buggy source:
public static ErrorCountingAnnotatorDecorator createDecorator(Annotator annotator,int numberOfExpectedCalls){
  int maxErrors=(int)Math.ceil(AMOUNT_OF_TOLERATED_ERRORS * numberOfExpectedCalls);
  if (annotator instanceof OKETask2Annotator) {
    return new ErrorCountingOKETask2Annotator((OKETask2Annotator)annotator,maxErrors);
  }
  if (annotator instanceof OKETask1Annotator) {
    return new ErrorCountingOKETask1Annotator((OKETask1Annotator)annotator,maxErrors);
  }
  if (annotator instanceof EntityExtractor) {
    return new ErrorCountingEntityExtractor((EntityExtractor)annotator,maxErrors);
  }
  if (annotator instanceof EntityRecognizer) {
    return new ErrorCountingEntityRecognizer((EntityRecognizer)annotator,maxErrors);
  }
  if (annotator instanceof EntityLinker) {
    return new ErrorCountingEntityLinker((EntityLinker)annotator,maxErrors);
  }
  if (annotator instanceof EntityTyper) {
    return new ErrorCountingEntityTyper((EntityTyper)annotator,maxErrors);
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static ErrorCountingAnnotatorDecorator createDecorator(ExperimentType type,Annotator annotator,int numberOfExpectedCalls){
  int maxErrors=(int)Math.ceil(AMOUNT_OF_TOLERATED_ERRORS * numberOfExpectedCalls);
switch (type) {
case A2KB:
    break;
case C2KB:
  break;
case D2KB:
break;
case EExt:
return new ErrorCountingEntityExtractor((EntityExtractor)annotator,maxErrors);
case ELink:
return new ErrorCountingEntityLinker((EntityLinker)annotator,maxErrors);
case ERec:
return new ErrorCountingEntityRecognizer((EntityRecognizer)annotator,maxErrors);
case ETyping:
return new ErrorCountingEntityTyper((EntityTyper)annotator,maxErrors);
case OKE_Task1:
return new ErrorCountingOKETask1Annotator((OKETask1Annotator)annotator,maxErrors);
case OKE_Task2:
return new ErrorCountingOKETask2Annotator((OKETask2Annotator)annotator,maxErrors);
case Rc2KB:
break;
case Sa2KB:
break;
case Sc2KB:
break;
default :
break;
}
return null;
}
Program: 33266
Project: 33266
Buggy source:
public static Resource getExperimentTypeResource(ExperimentType type){
switch (type) {
case A2KB:
    return A2KB;
case C2KB:
  return C2KB;
case D2KB:
return D2KB;
case Rc2KB:
return Rc2KB;
case Sa2KB:
return Sa2KB;
case Sc2KB:
return Sc2KB;
default :
;
}
LOGGER.error("String_Node_Str" + type.name());
return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static Resource getExperimentTypeResource(ExperimentType type){
switch (type) {
case A2KB:
    return A2KB;
case C2KB:
  return C2KB;
case D2KB:
return D2KB;
case Rc2KB:
return Rc2KB;
case Sa2KB:
return Sa2KB;
case Sc2KB:
return Sc2KB;
case OKE_Task1:
return OKE2015_Task1;
case OKE_Task2:
return OKE2015_Task2;
default :
;
}
LOGGER.error("String_Node_Str" + type.name());
return null;
}
Program: 33267
Project: 33267
Buggy source:
public DatahubNIFConfig(String datasetName,String datasetUrl,boolean couldBeCached){
  super(datasetName,couldBeCached,ExperimentType.Sa2KB);
  this.datasetUrl=datasetUrl;
  rt=new RestTemplate();
}

Fixed version (ground truth):
public DatahubNIFConfig(String datasetName,String datasetUrl,boolean couldBeCached){
  super(datasetName,couldBeCached,ExperimentType.EExt);
  this.datasetUrl=datasetUrl;
  rt=new RestTemplate();
}
Program: 33268
Project: 33268
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @RequestMapping("String_Node_Str") public @ResponseBody String testWebService(@RequestParam(value="String_Node_Str") String experimentType,@RequestParam(value="String_Node_Str") String url){
  LOGGER.info("String_Node_Str",url,experimentType);
  NIFBasedAnnotatorWebservice annotator=new NIFBasedAnnotatorWebservice(url,"String_Node_Str");
  JSONObject result=new JSONObject();
  Document document=new DocumentImpl();
  document.setText(NIF_WS_TEST_TEXT);
  try {
switch (ExperimentType.valueOf(experimentType)) {
case Rc2KB:
case Sc2KB:
case C2KB:
{
        break;
      }
case ELink:
case D2KB:
{
      annotator.performLinking(document);
      break;
    }
case EExt:
case Sa2KB:
case A2KB:
{
    annotator.performExtraction(document);
    break;
  }
case ERec:
{
  annotator.performRecognition(document);
  break;
}
default :
{
throw new IllegalArgumentException("String_Node_Str" + experimentType + "String_Node_Str");
}
}
result.put(RETURN_STATUS_NAME,true);
}
 catch (Exception e) {
LOGGER.error("String_Node_Str",url,e);
result.put(RETURN_STATUS_NAME,false);
result.put(RETURN_ERROR_MSG_NAME,e.getMessage());
}
return JSONValue.toJSONString(result);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @RequestMapping("String_Node_Str") public @ResponseBody String testWebService(@RequestParam(value="String_Node_Str") String experimentType,@RequestParam(value="String_Node_Str") String url){
  LOGGER.info("String_Node_Str",url,experimentType);
  NIFBasedAnnotatorWebservice annotator=new NIFBasedAnnotatorWebservice(url,"String_Node_Str");
  JSONObject result=new JSONObject();
  Document document=new DocumentImpl();
  document.setText(NIF_WS_TEST_TEXT);
  try {
switch (ExperimentType.valueOf(experimentType)) {
case Rc2KB:
case Sc2KB:
case C2KB:
{
        break;
      }
case ELink:
case D2KB:
{
      annotator.performLinking(document);
      break;
    }
case EExt:
case Sa2KB:
case A2KB:
{
    annotator.performExtraction(document);
    break;
  }
case ERec:
{
  annotator.performRecognition(document);
  break;
}
case OKE_Task1:
{
annotator.performTask1(document);
break;
}
default :
{
throw new IllegalArgumentException("String_Node_Str" + experimentType + "String_Node_Str");
}
}
result.put(RETURN_STATUS_NAME,true);
}
 catch (Exception e) {
LOGGER.error("String_Node_Str",url,e);
result.put(RETURN_STATUS_NAME,false);
result.put(RETURN_ERROR_MSG_NAME,e.getMessage());
}
return JSONValue.toJSONString(result);
}
Program: 33269
Project: 33269
Buggy source:
public Experimenter(Overseer overseer,ExperimentDAO experimentDAO,ExperimentTaskConfiguration configs[],String experimentId){
  this.configs=configs;
  this.experimentId=experimentId;
  this.experimentDAO=experimentDAO;
  this.overseer=overseer;
}

Fixed version (ground truth):
public Experimenter(Overseer overseer,ExperimentDAO experimentDAO,ExperimentTaskConfiguration configs[],String experimentId){
  this.configs=configs;
  this.experimentId=experimentId;
  this.experimentDAO=experimentDAO;
  this.overseer=overseer;
  this.evFactory=new EvaluatorFactory();
}
Program: 33270
Project: 33270
Buggy source:
@Override public void run(){
  try {
    int taskId;
    for (int i=0; i < configs.length; ++i) {
      if (couldHaveCachedResult(configs[i])) {
        taskId=experimentDAO.connectCachedResultOrCreateTask(configs[i].annotatorConfig.getName(),configs[i].datasetConfig.getName(),configs[i].type.name(),configs[i].matching.name(),experimentId);
      }
 else {
        taskId=experimentDAO.createTask(configs[i].annotatorConfig.getName(),configs[i].datasetConfig.getName(),configs[i].type.name(),configs[i].matching.name(),experimentId);
      }
      if (taskId != ExperimentDAO.CACHED_EXPERIMENT_TASK_CAN_BE_USED) {
        ExperimentTask task=new ExperimentTask(taskId,experimentDAO,configs[i]);
        overseer.startTask(task);
      }
    }
    LOGGER.info("String_Node_Str" + experimentId + "String_Node_Str");
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    int taskId;
    for (int i=0; i < configs.length; ++i) {
      if (couldHaveCachedResult(configs[i])) {
        taskId=experimentDAO.connectCachedResultOrCreateTask(configs[i].annotatorConfig.getName(),configs[i].datasetConfig.getName(),configs[i].type.name(),configs[i].matching.name(),experimentId);
      }
 else {
        taskId=experimentDAO.createTask(configs[i].annotatorConfig.getName(),configs[i].datasetConfig.getName(),configs[i].type.name(),configs[i].matching.name(),experimentId);
      }
      if (taskId != ExperimentDAO.CACHED_EXPERIMENT_TASK_CAN_BE_USED) {
        ExperimentTask task=new ExperimentTask(taskId,experimentDAO,evFactory,configs[i]);
        overseer.startTask(task);
      }
    }
    LOGGER.info("String_Node_Str" + experimentId + "String_Node_Str");
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 33271
Project: 33271
Buggy source:
public synchronized void init() throws GerbilException {
  if (hasBeenInitialized) {
    return;
  }
  Model nifModel=ModelFactory.createDefaultModel();
  InputStream inputStream=getDataAsInputStream();
  if (inputStream == null) {
    throw new GerbilException("String_Node_Str",ErrorTypes.DATASET_LOADING_ERROR);
  }
  try {
    RDFDataMgr.read(nifModel,inputStream,getDataLanguage());
  }
 catch (  Exception e) {
    throw new GerbilException("String_Node_Str",e,ErrorTypes.DATASET_LOADING_ERROR);
  }
 finally {
    closeInputStream(inputStream);
  }
  DocumentListParser parser=new DocumentListParser(true);
  documents=parser.parseDocuments(nifModel);
  hasBeenInitialized=true;
  LOGGER.info("String_Node_Str",name);
}

Fixed version (ground truth):
public synchronized void init() throws GerbilException {
  if (hasBeenInitialized) {
    return;
  }
  Model nifModel=ModelFactory.createDefaultModel();
  InputStream inputStream=getDataAsInputStream();
  if (inputStream == null) {
    throw new GerbilException("String_Node_Str",ErrorTypes.DATASET_LOADING_ERROR);
  }
  try {
    RDFDataMgr.read(nifModel,inputStream,getDataLanguage());
  }
 catch (  Exception e) {
    throw new GerbilException("String_Node_Str",e,ErrorTypes.DATASET_LOADING_ERROR);
  }
 finally {
    closeInputStream(inputStream);
  }
  DocumentListParser parser=new DocumentListParser(true);
  documents=parser.parseDocuments(nifModel);
  if (nifModel.size() > 0) {
    rdfModel=nifModel;
  }
  hasBeenInitialized=true;
  LOGGER.info("String_Node_Str",name);
}
Program: 33272
Project: 33272
Buggy source:
public ExperimentTask(int experimentTaskId,ExperimentDAO experimentDAO,ExperimentTaskConfiguration configuration){
  this.experimentDAO=experimentDAO;
  this.configuration=configuration;
  this.experimentTaskId=experimentTaskId;
}

Fixed version (ground truth):
public ExperimentTask(int experimentTaskId,ExperimentDAO experimentDAO,org.aksw.gerbil.evaluate.EvaluatorFactory evFactory,ExperimentTaskConfiguration configuration){
  this.experimentDAO=experimentDAO;
  this.configuration=configuration;
  this.experimentTaskId=experimentTaskId;
  this.evFactory=evFactory;
}
Program: 33275
Project: 33275
Buggy source:
@RequestMapping("String_Node_Str") public @ResponseBody String running(){
  StringBuilder resultBuilder=new StringBuilder();
  TaskState states[];
  StackTraceElement stackTrace[];
  for (  Overseer overseer : overseers) {
    states=overseer.getTaskStates();
    for (    TaskState state : states) {
      resultBuilder.append("String_Node_Str");
      resultBuilder.append(state.task.getId());
      resultBuilder.append("String_Node_Str");
      resultBuilder.append("String_Node_Str");
      resultBuilder.append(state.state);
      resultBuilder.append("String_Node_Str");
      resultBuilder.append("String_Node_Str");
      resultBuilder.append(state.task.getProgress());
      resultBuilder.append("String_Node_Str");
      stackTrace=state.stackTrace;
      for (int i=0; i < stackTrace.length; ++i) {
        resultBuilder.append("String_Node_Str");
        resultBuilder.append(stackTrace[i].toString());
        resultBuilder.append("String_Node_Str");
      }
      resultBuilder.append("String_Node_Str");
    }
  }
  return resultBuilder.toString();
}

Fixed version (ground truth):
@RequestMapping("String_Node_Str") public @ResponseBody String running(){
  StringBuilder resultBuilder=new StringBuilder();
  TaskState states[];
  StackTraceElement stackTrace[];
  for (  Overseer overseer : overseers) {
    states=overseer.getTaskStates();
    for (    TaskState state : states) {
      resultBuilder.append("String_Node_Str");
      resultBuilder.append(state.task.getId());
      resultBuilder.append("String_Node_Str");
      resultBuilder.append("String_Node_Str");
      resultBuilder.append(state.state);
      resultBuilder.append("String_Node_Str");
      resultBuilder.append("String_Node_Str");
      resultBuilder.append(state.task.getProgress());
      stackTrace=state.stackTrace;
      if (state.stackTrace != null) {
        resultBuilder.append("String_Node_Str");
        for (int i=0; i < stackTrace.length; ++i) {
          resultBuilder.append("String_Node_Str");
          resultBuilder.append(stackTrace[i].toString());
          resultBuilder.append("String_Node_Str");
        }
      }
      resultBuilder.append("String_Node_Str");
    }
  }
  return resultBuilder.toString();
}
Program: 33276
Project: 33276
Buggy source:
public Microposts2014Annotation(int position,String title){
  this.position=position;
  this.title=title;
}

Fixed version (ground truth):
public Microposts2014Annotation(String mention,int position,int length,String title){
  this.mention=mention;
  this.position=position;
  this.title=title;
  this.length=length;
}
Program: 33279
Project: 33279
Buggy source:
@Override public List<ExperimentTaskResult> getLatestResultsOfExperiments(String experimentType,String matching){
  List<String[]> experimentTasks=getAnnotatorDatasetCombinations(experimentType,matching);
  List<ExperimentTaskResult> results=new ArrayList<ExperimentTaskResult>(experimentTasks.size());
  ExperimentTaskResult result;
  for (  String combination[] : experimentTasks) {
    result=getLatestExperimentTaskResult(experimentType,matching,combination[0],combination[1]);
    if (result != null) {
      results.add(result);
    }
  }
  return results;
}

Fixed version (ground truth):
@Deprecated @Override public List<ExperimentTaskResult> getLatestResultsOfExperiments(String experimentType,String matching){
  List<String[]> experimentTasks=getAnnotatorDatasetCombinations(experimentType,matching);
  List<ExperimentTaskResult> results=new ArrayList<ExperimentTaskResult>(experimentTasks.size());
  ExperimentTaskResult result;
  for (  String combination[] : experimentTasks) {
    result=getLatestExperimentTaskResult(experimentType,matching,combination[0],combination[1]);
    if (result != null) {
      results.add(result);
    }
  }
  return results;
}
Program: 33280
Project: 33280
Buggy source:
/** 
 * Returns the result of the most recent finished experiment task with the given experiment type, matchin, annotator and dataset.
 * @param annotatorName the name with which the annotator can be identified
 * @param datasetName the name of the dataset
 * @param experimentType the name of the experiment type
 * @param matching the name of the matching used
 * @return the result of the most recent experiment task or null if no such task exists
 */
protected abstract ExperimentTaskResult getLatestExperimentTaskResult(String experimentType,String matching,String annotatorName,String datasetName);

Fixed version (ground truth):
/** 
 * Returns the result of the most recent finished experiment task with the given experiment type, matchin, annotator and dataset.
 * @param annotatorName the name with which the annotator can be identified
 * @param datasetName the name of the dataset
 * @param experimentType the name of the experiment type
 * @param matching the name of the matching used
 * @return the result of the most recent experiment task or null if no such task exists
 */
@Deprecated protected abstract ExperimentTaskResult getLatestExperimentTaskResult(String experimentType,String matching,String annotatorName,String datasetName);
Program: 33281
Project: 33281
Buggy source:
/** 
 * This method returns a list of annotator dataset combinations for the given experimentType and matching that exist inside the database. The first element of every array contains the name of an annotator and the second element is the name of a dataset.
 * @param experimentType the name of the experiment type
 * @param matching the name of the matching used
 * @return a list of annotator dataset combinations
 */
protected abstract List<String[]> getAnnotatorDatasetCombinations(String experimentType,String matching);

Fixed version (ground truth):
/** 
 * This method returns a list of annotator dataset combinations for the given experimentType and matching that exist inside the database. The first element of every array contains the name of an annotator and the second element is the name of a dataset.
 * @param experimentType the name of the experiment type
 * @param matching the name of the matching used
 * @return a list of annotator dataset combinations
 */
@Deprecated protected abstract List<String[]> getAnnotatorDatasetCombinations(String experimentType,String matching);
Program: 33282
Project: 33282
Buggy source:
@Override protected ExperimentTaskResult getLatestExperimentTaskResult(String experimentType,String matching,String annotatorName,String datasetName){
  MapSqlParameterSource params=createTaskParameters(annotatorName,datasetName,experimentType,matching);
  params.addValue("String_Node_Str",TASK_STARTED_BUT_NOT_FINISHED_YET);
  List<ExperimentTaskResult> result=this.template.query(GET_LATEST_EXPERIMENT_TASK_RESULT,params,new ExperimentTaskResultRowMapper());
  if (result.size() > 0) {
    return result.get(0);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Deprecated @Override protected ExperimentTaskResult getLatestExperimentTaskResult(String experimentType,String matching,String annotatorName,String datasetName){
  MapSqlParameterSource params=createTaskParameters(annotatorName,datasetName,experimentType,matching);
  params.addValue("String_Node_Str",TASK_STARTED_BUT_NOT_FINISHED_YET);
  List<ExperimentTaskResult> result=this.template.query(GET_LATEST_EXPERIMENT_TASK_RESULT,params,new ExperimentTaskResultRowMapper());
  if (result.size() > 0) {
    return result.get(0);
  }
 else {
    return null;
  }
}
Program: 33283
Project: 33283
Buggy source:
@Override protected List<String[]> getAnnotatorDatasetCombinations(String experimentType,String matching){
  MapSqlParameterSource params=new MapSqlParameterSource();
  params.addValue("String_Node_Str",experimentType);
  params.addValue("String_Node_Str",matching);
  return this.template.query(GET_LATEST_EXPERIMENT_TASKS,params,new StringArrayRowMapper(new int[]{1,2}));
}

Fixed version (ground truth):
@Deprecated @Override protected List<String[]> getAnnotatorDatasetCombinations(String experimentType,String matching){
  MapSqlParameterSource params=new MapSqlParameterSource();
  params.addValue("String_Node_Str",experimentType);
  params.addValue("String_Node_Str",matching);
  return this.template.query(GET_LATEST_EXPERIMENT_TASKS,params,new StringArrayRowMapper(new int[]{1,2}));
}
Program: 33284
Project: 33284
Buggy source:
public String createDataIDModel(List<ExperimentTaskResult> results,String eID){
  Model model=ModelFactory.createDefaultModel();
  model.setNsPrefix("String_Node_Str",GERBIL.getURI());
  model.setNsPrefix("String_Node_Str",RDF.getURI());
  model.setNsPrefix("String_Node_Str",RDFS.getURI());
  model.setNsPrefix("String_Node_Str",XSD.getURI());
  model.setNsPrefix("String_Node_Str",CUBE.getURI());
  if (results.size() == 0) {
    return "String_Node_Str";
  }
  Resource experiment=createExperimentResource(model,eID);
  int experimentNumber=0;
  Iterator<ExperimentTaskResult> resultIterator=results.iterator();
  ExperimentTaskResult result;
  while (resultIterator.hasNext()) {
    result=resultIterator.next();
    if (experimentNumber == 0) {
      experiment.addProperty(GERBIL.experimentType,GERBIL.getExperimentTypeResource(result.type));
      experiment.addProperty(GERBIL.matching,GERBIL.getMatchingResource(result.matching));
    }
    addExperimentTask(model,result,experiment,experimentNumber);
    ++experimentNumber;
  }
  RDFDataMgr.write(System.out,model,RDFFormat.TURTLE);
  OutputStream o=new ByteArrayOutputStream();
  RDFDataMgr.write(o,model,RDFFormat.JSONLD);
  return o.toString();
}

Fixed version (ground truth):
public String createDataIDModel(List<ExperimentTaskResult> results,String eID){
  Model model=ModelFactory.createDefaultModel();
  model.setNsPrefix("String_Node_Str",GERBIL.getURI());
  model.setNsPrefix("String_Node_Str",RDF.getURI());
  model.setNsPrefix("String_Node_Str",RDFS.getURI());
  model.setNsPrefix("String_Node_Str",XSD.getURI());
  model.setNsPrefix("String_Node_Str",CUBE.getURI());
  if (results.size() == 0) {
    return "String_Node_Str";
  }
  Resource experiment=createExperimentResource(model,eID);
  int experimentNumber=0;
  Iterator<ExperimentTaskResult> resultIterator=results.iterator();
  ExperimentTaskResult result;
  while (resultIterator.hasNext()) {
    result=resultIterator.next();
    if (experimentNumber == 0) {
      experiment.addProperty(GERBIL.experimentType,GERBIL.getExperimentTypeResource(result.type));
      experiment.addProperty(GERBIL.matching,GERBIL.getMatchingResource(result.matching));
    }
    addExperimentTask(model,result,experiment,experimentNumber);
    ++experimentNumber;
  }
  OutputStream o=new ByteArrayOutputStream();
  RDFDataMgr.write(o,model,RDFFormat.JSONLD);
  return o.toString();
}
Program: 33285
Project: 33285
Buggy source:
public NIFFileDatasetConfig(WikipediaApiInterface wikiApi,String name,String file,boolean couldBeCached,ExperimentType... applicableForExperiment){
  super(name,couldBeCached,applicableForExperiment);
  this.wikiApi=wikiApi;
}

Fixed version (ground truth):
public NIFFileDatasetConfig(WikipediaApiInterface wikiApi,String name,String file,boolean couldBeCached,ExperimentType... applicableForExperiment){
  super(name,couldBeCached,applicableForExperiment);
  this.wikiApi=wikiApi;
  this.file=file;
}
Program: 33286
Project: 33286
Buggy source:
public static DatasetConfiguration getDatasetConfig(String name){
  DatasetMapping datasets=getInstance();
  if (datasets.mapping.containsKey(name)) {
    return datasets.mapping.get(name);
  }
 else {
    if (name.startsWith("String_Node_Str")) {
      int pos=name.indexOf('(');
      if (pos < 0) {
        LOGGER.error("String_Node_Str" + name + "String_Node_Str");
        return null;
      }
      String uri=name.substring(pos + 1,name.length() - 1);
      name=name.substring(6,pos);
      return new NIFFileDatasetConfig(SingletonWikipediaApi.getInstance(),name,uri,false,ExperimentType.Sa2W);
    }
    LOGGER.error("String_Node_Str" + name + "String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
public static DatasetConfiguration getDatasetConfig(String name){
  DatasetMapping datasets=getInstance();
  if (datasets.mapping.containsKey(name)) {
    return datasets.mapping.get(name);
  }
 else {
    if (name.startsWith("String_Node_Str")) {
      String uploadedFilesPath=GerbilConfiguration.getInstance().getString(UPLOADED_FILES_PATH_PROPERTY_KEY);
      if (uploadedFilesPath == null) {
        LOGGER.error("String_Node_Str",UPLOADED_FILES_PATH_PROPERTY_KEY);
      }
      int pos=name.indexOf('(');
      if (pos < 0) {
        LOGGER.error("String_Node_Str" + name + "String_Node_Str");
        return null;
      }
      String uri=uploadedFilesPath + name.substring(pos + 1,name.length() - 1);
      name=name.substring(6,pos);
      LOGGER.error("String_Node_Str",name,uri);
      return new NIFFileDatasetConfig(SingletonWikipediaApi.getInstance(),name,uri,false,ExperimentType.Sa2W);
    }
    LOGGER.error("String_Node_Str" + name + "String_Node_Str");
    return null;
  }
}
Program: 33287
Project: 33287
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody ResponseEntity<UploadFileContainer> upload(MultipartHttpServletRequest request,HttpServletResponse response){
  if (path == null) {
    logger.error("String_Node_Str");
    return new ResponseEntity<UploadFileContainer>(HttpStatus.INTERNAL_SERVER_ERROR);
  }
  LinkedList<FileMeta> files=new LinkedList<FileMeta>();
  MultipartFile mpf=null;
  for (Iterator<String> it=request.getFileNames(); it.hasNext(); ) {
    mpf=request.getFile(it.next());
    logger.debug("String_Node_Str",mpf.getOriginalFilename());
    FileMeta fileContainer=new FileMeta();
    fileContainer.setName(mpf.getOriginalFilename());
    fileContainer.setSize(mpf.getSize() / 1024 + "String_Node_Str");
    fileContainer.setFileType(mpf.getContentType());
    try {
      fileContainer.setBytes(mpf.getBytes());
      FileCopyUtils.copy(mpf.getBytes(),new FileOutputStream(path + mpf.getOriginalFilename()));
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
      fileContainer.setError(e.getMessage());
    }
    files.add(fileContainer);
  }
  UploadFileContainer uploadFileContainer=new UploadFileContainer(files);
  return new ResponseEntity<UploadFileContainer>(uploadFileContainer,HttpStatus.OK);
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public @ResponseBody ResponseEntity<UploadFileContainer> upload(MultipartHttpServletRequest request,HttpServletResponse response){
  if (path == null) {
    logger.error("String_Node_Str");
    return new ResponseEntity<UploadFileContainer>(HttpStatus.INTERNAL_SERVER_ERROR);
  }
  LinkedList<FileMeta> files=new LinkedList<FileMeta>();
  MultipartFile mpf=null;
  for (Iterator<String> it=request.getFileNames(); it.hasNext(); ) {
    mpf=request.getFile(it.next());
    logger.debug("String_Node_Str",mpf.getOriginalFilename());
    FileMeta fileContainer=new FileMeta();
    fileContainer.setName(mpf.getOriginalFilename());
    fileContainer.setSize(mpf.getSize() / 1024 + "String_Node_Str");
    fileContainer.setFileType(mpf.getContentType());
    try {
      fileContainer.setBytes(mpf.getBytes());
      createFolderIfNotExists();
      FileCopyUtils.copy(mpf.getBytes(),new FileOutputStream(path + mpf.getOriginalFilename()));
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
      fileContainer.setError(e.getMessage());
    }
    files.add(fileContainer);
  }
  UploadFileContainer uploadFileContainer=new UploadFileContainer(files);
  return new ResponseEntity<UploadFileContainer>(uploadFileContainer,HttpStatus.OK);
}
Program: 33289
Project: 33289
Buggy source:
/** 
 * We have to synchronize this method. Otherwise every experiment thread would check the file and try to download the data or try to use the file even the download hasn't been completed.
 */
@Override protected synchronized TopicDataset loadDataset() throws Exception {
  String nifFile=GerbilConfiguration.getInstance().getString(DATAHUB_DATASET_FILE_PROPERTY_NAME) + getName();
  logger.debug("String_Node_Str",nifFile);
  File f=new File(nifFile);
  if (!f.exists()) {
    logger.debug("String_Node_Str",nifFile);
    String data=rt.getForObject(datasetUrl,String.class);
    Path path=Paths.get(nifFile);
    Files.createDirectories(path.getParent());
    Path file=Files.createFile(path);
    Files.write(file,data.getBytes(),StandardOpenOption.WRITE);
  }
  FileBasedNIFDataset dataset=new FileBasedNIFDataset(wikiApi,nifFile,getName(),Lang.TTL);
  dataset.init();
  return dataset;
}

Fixed version (ground truth):
/** 
 * We have to synchronize this method. Otherwise every experiment thread would check the file and try to download the data or try to use the file even the download hasn't been completed.
 */
@Override protected synchronized TopicDataset loadDataset() throws Exception {
  String nifFile=GerbilConfiguration.getInstance().getString(DATAHUB_DATASET_FILE_PROPERTY_NAME) + getName();
  logger.debug("String_Node_Str",nifFile);
  File f=new File(nifFile);
  if (!f.exists()) {
    logger.debug("String_Node_Str",nifFile);
    String data=rt.getForObject(datasetUrl,String.class);
    Path path=Paths.get(nifFile);
    Files.createDirectories(path.getParent());
    Path file=Files.createFile(path);
    Files.write(file,data.getBytes(),StandardOpenOption.WRITE);
  }
  return new FileBasedNIFDataset(wikiApi,nifFile,getName(),Lang.TTL);
}
Program: 33290
Project: 33290
Buggy source:
@Override protected TopicSystem loadAnnotator(ExperimentType type) throws Exception {
  String propertyKey;
  if (ExperimentType.D2W.equalsOrContainsType(type)) {
    propertyKey=DISAMBIGATION_URL_PROPERTY_KEY;
  }
 else {
    propertyKey=ANNOTATION_URL_PROPERTY_KEY;
  }
  String annotatorURL=GerbilConfiguration.getInstance().getString(ANNOTATION_URL_PROPERTY_KEY);
  if (annotatorURL == null) {
    throw new GerbilException("String_Node_Str" + propertyKey + "String_Node_Str"+ type,ErrorTypes.ANNOTATOR_LOADING_ERROR);
  }
  annotatorURL=annotatorURL.replace("String_Node_Str","String_Node_Str");
  StringBuilder url=new StringBuilder();
  url.append("String_Node_Str");
  String user=GerbilConfiguration.getInstance().getString(USER_NAME_PROPERTY_KEY);
  String password=GerbilConfiguration.getInstance().getString(PASSWORD_PROPERTY_KEY);
  if ((user != null) && (password != null)) {
    url.append(user);
    url.append(':');
    url.append(password);
    url.append('@');
  }
 else {
    LOGGER.error("String_Node_Str" + USER_NAME_PROPERTY_KEY + "String_Node_Str"+ PASSWORD_PROPERTY_KEY+ "String_Node_Str");
  }
  url.append(annotatorURL);
  return new NIFBasedAnnotatorWebservice(url.toString(),this.getName(),wikiApi,dbpediaApi);
}

Fixed version (ground truth):
@Override protected TopicSystem loadAnnotator(ExperimentType type) throws Exception {
  String propertyKey;
  if (ExperimentType.D2W.equalsOrContainsType(type)) {
    propertyKey=DISAMBIGATION_URL_PROPERTY_KEY;
  }
 else {
    propertyKey=ANNOTATION_URL_PROPERTY_KEY;
  }
  String annotatorURL=GerbilConfiguration.getInstance().getString(propertyKey);
  if (annotatorURL == null) {
    throw new GerbilException("String_Node_Str" + propertyKey + "String_Node_Str"+ type,ErrorTypes.ANNOTATOR_LOADING_ERROR);
  }
  annotatorURL=annotatorURL.replace("String_Node_Str","String_Node_Str");
  StringBuilder url=new StringBuilder();
  url.append("String_Node_Str");
  String user=GerbilConfiguration.getInstance().getString(USER_NAME_PROPERTY_KEY);
  String password=GerbilConfiguration.getInstance().getString(PASSWORD_PROPERTY_KEY);
  if ((user != null) && (password != null)) {
    url.append(user);
    url.append(':');
    url.append(password);
    url.append('@');
  }
 else {
    LOGGER.error("String_Node_Str" + USER_NAME_PROPERTY_KEY + "String_Node_Str"+ PASSWORD_PROPERTY_KEY+ "String_Node_Str");
  }
  url.append(annotatorURL);
  return new NIFBasedAnnotatorWebservice(url.toString(),this.getName(),wikiApi,dbpediaApi);
}