nus-yam/ex-repair huggingface dataset:
Program: 18260
Project: 18260
Buggy source:
@Override public ExchangeRecord simulate(ExchangeRecord inputRecord,TemplateFieldSuggestions inputSuggestions,SimulationStore store,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception {
  Iterator<ExchangeRecord> recordKeyIterator=store.getRecordList().keySet().iterator();
  while (recordKeyIterator.hasNext()) {
    ExchangeRecord record=recordKeyIterator.next();
    TemplateFieldSuggestions recordedSuggestions=store.getRecordList().get(record);
    if (matchAll(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues);
      inputRecord.setOutMessage(outMessage);
      break;
    }
 else     if (matchSome(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues);
      inputRecord.setOutMessage(outMessage);
    }
 else {
      logger.debug("String_Node_Str");
    }
  }
  return inputRecord;
}

Fixed version (ground truth):
@Override public ExchangeRecord simulate(ExchangeRecord inputRecord,TemplateFieldSuggestions inputSuggestions,SimulationStore store,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception {
  Iterator<ExchangeRecord> recordKeyIterator=store.getRecordList().keySet().iterator();
  while (recordKeyIterator.hasNext()) {
    ExchangeRecord record=recordKeyIterator.next();
    TemplateFieldSuggestions recordedSuggestions=store.getRecordList().get(record);
    if (matchAll(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues,true);
      inputRecord.setOutMessage(outMessage);
      break;
    }
 else     if (matchSome(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues,true);
      inputRecord.setOutMessage(outMessage);
    }
 else {
      logger.debug("String_Node_Str");
    }
  }
  return inputRecord;
}
Program: 18262
Project: 18262
Buggy source:
/** 
 * Call the template renderer and replay the templatized record
 * @param storeName
 * @param recordID
 * @param fieldValues
 * @return the replayed response
 */
public abstract OutMessage renderTemplateAndReplay(String storeName,ExchangeRecord record,Map<String,List<String>> fieldValues) throws Exception ;

Fixed version (ground truth):
/** 
 * Call the template renderer and replay the templatized record
 * @param storeName The store name
 * @param recordID The record id
 * @param fieldValues The custom user field values
 * @param simulation true if we are in simulation mode, false otherwise
 * @return the replayed response
 */
public abstract OutMessage renderTemplateAndReplay(String storeName,ExchangeRecord record,Map<String,List<String>> fieldValues,boolean simulation) throws Exception ;
Program: 18263
Project: 18263
Buggy source:
@Override public OutMessage renderTemplateAndReplay(String storeName,ExchangeRecord record,Map<String,List<String>> fieldValues) throws Exception {
  String templatePath="String_Node_Str" + record.getExchange().getExchangeID() + "String_Node_Str";
  return templateRenderer.renderReq(templatePath,record,storeName,fieldValues);
}

Fixed version (ground truth):
@Override public OutMessage renderTemplateAndReplay(String storeName,ExchangeRecord record,Map<String,List<String>> fieldValues,boolean simulation) throws Exception {
  String templatePath;
  if (simulation) {
    templatePath="String_Node_Str" + record.getExchange().getExchangeID() + "String_Node_Str";
    return templateRenderer.renderRes(templatePath,record,storeName,fieldValues);
  }
 else {
    templatePath="String_Node_Str" + record.getExchange().getExchangeID() + "String_Node_Str";
    return templateRenderer.renderReq(templatePath,record,storeName,fieldValues);
  }
}
Program: 18264
Project: 18264
Buggy source:
/** 
 * Execute a rendered template and returns the response as an <code>OutMessage</code>
 * @param renderedTemplate The rendered template to execute
 * @return The response as an <code>OutMessage</code>
 * @throws Exception If a problem occurs
 */
public OutMessage execute(String renderedTemplate) throws Exception {
  JSONObject jsonInMessage=(JSONObject)JSONSerializer.toJSON(renderedTemplate);
  System.out.println("String_Node_Str" + jsonInMessage);
  HashMap<String,Class> classMap=new HashMap<String,Class>();
  classMap.put("String_Node_Str",Header.class);
  classMap.put("String_Node_Str",Header.class);
  classMap.put("String_Node_Str",CustomFields.class);
  classMap.put("String_Node_Str",CustomField.class);
  classMap.put("String_Node_Str",QueryString.class);
  classMap.put("String_Node_Str",QueryParam.class);
  InMessage inMessage=(InMessage)JSONObject.toBean(jsonInMessage,InMessage.class,classMap);
  RequestForwarder forwarder=new RequestForwarder();
  OutMessage outMessage=forwarder.send(inMessage);
  return outMessage;
}

Fixed version (ground truth):
/** 
 * Execute a rendered template and returns the response as an <code>OutMessage</code>
 * @param renderedTemplate The rendered template to execute
 * @return The response as an <code>OutMessage</code>
 * @throws Exception If a problem occurs
 */
public OutMessage execute(String renderedTemplate) throws Exception ;
Program: 18265
Project: 18265
Buggy source:
/** 
 * Render the response template by replacing template expression by provided values 
 * @param templatePath The response template
 * @param record The associated record
 * @param fieldValues Provided field values
 * @return The rendred template
 * @throws Exception If a problem occurs
 */
public String renderRes(String templatePath,ExchangeRecord record,String runName,Map<String,List<String>> fieldValues) throws Exception ;

Fixed version (ground truth):
/** 
 * Render the response template by replacing template expression by provided values 
 * @param templatePath The response template
 * @param record The associated record
 * @param fieldValues Provided field values
 * @return The rendred template
 * @throws Exception If a problem occurs
 */
public OutMessage renderRes(String templatePath,ExchangeRecord record,String runName,Map<String,List<String>> fieldValues) throws Exception ;
Program: 18266
Project: 18266
Buggy source:
@Override public String renderRes(String templatePath,ExchangeRecord record,String runName,Map<String,List<String>> fieldValues) throws Exception {
  logger.warn("String_Node_Str");
  String renderedTemplate=template.renderRes(templatePath,runName,fieldValues);
  logger.debug("String_Node_Str" + renderedTemplate);
  return renderedTemplate;
}

Fixed version (ground truth):
@Override public OutMessage renderRes(String templatePath,ExchangeRecord record,String runName,Map<String,List<String>> fieldValues) throws Exception {
  logger.warn("String_Node_Str");
  String renderedTemplate=template.renderRes(templatePath,runName,fieldValues);
  logger.debug("String_Node_Str" + renderedTemplate);
  TemplateExecutor executor=new ResponseTemplateExecutor();
  return executor.execute(renderedTemplate);
}
Program: 18267
Project: 18267
Buggy source:
@Override public OutMessage renderReq(String templatePath,ExchangeRecord record,String runName,Map<String,List<String>> fieldValues) throws Exception {
  String renderedTemplate=template.renderReq(templatePath,runName,fieldValues);
  logger.debug("String_Node_Str" + renderedTemplate);
  TemplateExecutor executor=new TemplateExecutor();
  return executor.execute(renderedTemplate);
}

Fixed version (ground truth):
@Override public OutMessage renderReq(String templatePath,ExchangeRecord record,String runName,Map<String,List<String>> fieldValues) throws Exception {
  String renderedTemplate=template.renderReq(templatePath,runName,fieldValues);
  logger.debug("String_Node_Str" + renderedTemplate);
  TemplateExecutor executor=new RequestTemplateExecutor();
  return executor.execute(renderedTemplate);
}
Program: 18268
Project: 18268
Buggy source:
/** 
 * Tests runtime discovery of services when FraSCAti starts an application. IMPORTANT since it should work in a "remoted" FraSCAti. PROBLEM : injected FraSCAti is the wrapper and not an actual "remoted" FraSCAti.
 * @throws FrascatiException
 * @throws Exception
 */
@Test public void testFraSCAtiRuntimeDiscovery() throws Exception {
  String scaZipFilePath="String_Node_Str" + "String_Node_Str";
  File scaZipFile=new File(scaZipFilePath);
  ApiRuntimeFraSCAtiScaImporter runtimeScaImporter=(ApiRuntimeFraSCAtiScaImporter)EasySOAApiFraSCAti.getInstance().newRuntimeScaImporter();
  frascati.setScaImporterRecipient(runtimeScaImporter);
  frascati.processComposite("String_Node_Str",FraSCAtiServiceItf.check,scaZipFile.toURI().toURL());
  checkExchanges("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tests runtime discovery of services when FraSCAti starts an application. IMPORTANT since it should work in a "remoted" FraSCAti. PROBLEM : injected FraSCAti is the wrapper and not an actual "remoted" FraSCAti.
 * @throws FrascatiException
 * @throws Exception
 */
@Test public void testFraSCAtiRuntimeDiscovery() throws Exception {
  String scaZipFilePath="String_Node_Str" + "String_Node_Str";
  File scaZipFile=new File(scaZipFilePath);
  ApiRuntimeFraSCAtiScaImporter importer=(ApiRuntimeFraSCAtiScaImporter)EasySOAApiFraSCAti.getInstance().newRuntimeScaImporter();
  importer.setAppliImplURL("String_Node_Str");
  importer.setServiceStackType("String_Node_Str");
  importer.setServiceStackUrl("String_Node_Str");
  importer.compositeFile=new File("String_Node_Str"){
    public String getName(){
      return "String_Node_Str";
    }
  }
;
  frascati.setScaImporterRecipient(importer);
  frascati.processComposite("String_Node_Str",FraSCAtiServiceItf.check,scaZipFile.toURI().toURL());
  checkExchanges("String_Node_Str");
}
Program: 18269
Project: 18269
Buggy source:
@After public void tearDown() throws Exception {
  logger.info("String_Node_Str");
  logger.info("String_Node_Str");
  HttpAutomationClient client=new HttpAutomationClient(AUTOMATION_URL);
  Session session=client.getSession("String_Node_Str","String_Node_Str");
  OperationRequest request=session.newRequest("String_Node_Str");
  request.setHeader("String_Node_Str","String_Node_Str");
  request.set("String_Node_Str","String_Node_Str");
  logger.info(request.execute());
  session.close();
  client.shutdown();
  stopFraSCAti();
  JettyHTTPServerEngineFactory jettyFactory=BusFactory.getDefaultBus().getExtension(JettyHTTPServerEngineFactory.class);
  JettyHTTPServerEngine jettyServer=jettyFactory.retrieveJettyHTTPServerEngine(8080);
  Collection<Object> beans=jettyServer.getServer().getBeans();
  if (beans != null) {
    for (    Object bean : beans) {
      logger.info("String_Node_Str" + bean + "String_Node_Str");
      jettyServer.getServer().removeBean(bean);
    }
  }
  jettyFactory.destroyForPort(8080);
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
@After public void tearDown() throws Exception {
  stopFraSCAti();
  JettyHTTPServerEngineFactory jettyFactory=BusFactory.getDefaultBus().getExtension(JettyHTTPServerEngineFactory.class);
  JettyHTTPServerEngine jettyServer=jettyFactory.retrieveJettyHTTPServerEngine(8080);
  Collection<Object> beans=jettyServer.getServer().getBeans();
  if (beans != null) {
    for (    Object bean : beans) {
      jettyServer.getServer().removeBean(bean);
    }
  }
  jettyFactory.destroyForPort(8080);
}
Program: 18270
Project: 18270
Buggy source:
/** 
 * Take the content params (eg : HTML form POST params) from <code>InMessage</code> and fill an HashMap with them. 
 * @param inMessage <code>InMessage</code> containing query params
 * @return An <code>HashMap</code> filled with query parameters
 */
public HashMap<String,CandidateField> getInputContentParam(InMessage inMessage){
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  CandidateField candidateField;
  StringTokenizer tokenizer=new StringTokenizer(inMessage.getMessageContent().getRawContent(),"String_Node_Str");
  String token;
  while (tokenizer.hasMoreTokens()) {
    token=tokenizer.nextToken();
    candidateField=new CandidateField(token.substring(0,token.indexOf("String_Node_Str")),token.substring(token.indexOf("String_Node_Str")));
    candidateField.setKind("String_Node_Str");
    fieldMap.put(candidateField.getPath(),candidateField);
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}

Fixed version (ground truth):
/** 
 * Take the content params (eg : HTML form POST params) from <code>InMessage</code> and fill an HashMap with them. 
 * @param inMessage <code>InMessage</code> containing query params
 * @return An <code>HashMap</code> filled with query parameters
 */
public HashMap<String,CandidateField> getInputContentParam(InMessage inMessage){
  logger.debug("String_Node_Str");
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  CandidateField candidateField;
  StringTokenizer tokenizer=new StringTokenizer(inMessage.getMessageContent().getRawContent(),"String_Node_Str");
  String token;
  while (tokenizer.hasMoreTokens()) {
    token=tokenizer.nextToken();
    candidateField=new CandidateField(token.substring(0,token.indexOf("String_Node_Str")),token.substring(token.indexOf("String_Node_Str")));
    candidateField.setKind("String_Node_Str");
    fieldMap.put(candidateField.getPath(),candidateField);
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}
Program: 18271
Project: 18271
Buggy source:
/** 
 * Take the query params from <code>InMessage</code> and fill an HashMap with them. 
 * @param inMessage <code>InMessage</code> containing query params
 * @return An <code>HashMap</code> filled with query parameters 
 */
public HashMap<String,CandidateField> getInputQueryParams(InMessage inMessage){
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  CandidateField candidateField;
  for (  QueryParam queryParam : inMessage.getQueryString().getQueryParams()) {
    candidateField=new CandidateField(queryParam.getName(),queryParam.getValue());
    candidateField.setKind("String_Node_Str");
    fieldMap.put(candidateField.getPath(),candidateField);
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}

Fixed version (ground truth):
/** 
 * Take the query params from <code>InMessage</code> and fill an HashMap with them. 
 * @param inMessage <code>InMessage</code> containing query params
 * @return An <code>HashMap</code> filled with query parameters 
 */
public HashMap<String,CandidateField> getInputQueryParams(InMessage inMessage){
  logger.debug("String_Node_Str");
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  CandidateField candidateField;
  for (  QueryParam queryParam : inMessage.getQueryString().getQueryParams()) {
    candidateField=new CandidateField(queryParam.getName(),queryParam.getValue());
    candidateField.setKind("String_Node_Str");
    fieldMap.put(candidateField.getPath(),candidateField);
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}
Program: 18272
Project: 18272
Buggy source:
/** 
 * Extract params from the url path
 * @param inMessage
 * @return An <code>HashMap</code> filled with query parameters
 */
public HashMap<String,CandidateField> getInputPathParams(InMessage inMessage){
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  CandidateField field;
  StringTokenizer tokenizer=new StringTokenizer(inMessage.getPath(),"String_Node_Str");
  int pathPos=0;
  while (tokenizer.hasMoreTokens()) {
    String token=tokenizer.nextToken();
    field=new CandidateField("String_Node_Str" + pathPos,token);
    field.setKind("String_Node_Str");
    fieldMap.put("String_Node_Str" + pathPos,field);
    pathPos++;
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}

Fixed version (ground truth):
/** 
 * Extract params from the url path
 * @param inMessage
 * @return An <code>HashMap</code> filled with query parameters
 */
public HashMap<String,CandidateField> getInputPathParams(InMessage inMessage){
  logger.debug("String_Node_Str");
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  CandidateField field;
  StringTokenizer tokenizer=new StringTokenizer(inMessage.getPath(),"String_Node_Str");
  int pathPos=0;
  while (tokenizer.hasMoreTokens()) {
    String token=tokenizer.nextToken();
    field=new CandidateField("String_Node_Str" + pathPos,token);
    field.setKind("String_Node_Str");
    fieldMap.put("String_Node_Str" + pathPos,field);
    pathPos++;
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}
Program: 18273
Project: 18273
Buggy source:
/** 
 * @param outMessage
 * @return
 */
public HashMap<String,CandidateField> getOutputFields(OutMessage outMessage){
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  logger.debug("String_Node_Str" + outMessage.getMessageContent().getRawContent());
  List<TemplateParser> templateParserList=new ArrayList<TemplateParser>();
  templateParserList.add(new JSONParser());
  templateParserList.add(new XMLParser());
  try {
    for (    TemplateParser parser : templateParserList) {
      if (parser.canParse(outMessage)) {
        parser.parse(outMessage,fieldMap);
        break;
      }
    }
  }
 catch (  Exception ex) {
    logger.warn("String_Node_Str",ex);
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}

Fixed version (ground truth):
/** 
 * @param outMessage
 * @return
 */
public HashMap<String,CandidateField> getOutputFields(OutMessage outMessage){
  logger.debug("String_Node_Str");
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  List<TemplateParser> templateParserList=new ArrayList<TemplateParser>();
  templateParserList.add(new JSONParser());
  templateParserList.add(new XMLParser());
  try {
    for (    TemplateParser parser : templateParserList) {
      if (parser.canParse(outMessage)) {
        parser.parse(outMessage,fieldMap);
        break;
      }
    }
  }
 catch (  Exception ex) {
    logger.warn("String_Node_Str",ex);
  }
  logger.debug("String_Node_Str" + fieldMap);
  return fieldMap;
}
Program: 18274
Project: 18274
Buggy source:
/** 
 * Process a simulation
 * @param inputRecord The input exchange record
 * @param simulationStore The simulation store to use for data matching
 * @param method The simulation method to use
 * @param templateEngine the template engine to use
 * @return A exchange record containing the simulated response
 * @throws Exception If a problem occurs
 */
public ExchangeRecord simulate(ExchangeRecord inputRecord,SimulationStore simulationStore,SimulationMethod method,TemplateEngine templateEngine) throws Exception ;

Fixed version (ground truth):
/** 
 * Process a simulation
 * @param inputRecord The input exchange record
 * @param simulationStore The simulation store to use for data matching
 * @param method The simulation method to use
 * @param templateEngine the template engine to use
 * @return A exchange record containing the simulated response
 * @throws Exception If a problem occurs
 */
public ExchangeRecord simulate(ExchangeRecord inputRecord,SimulationStore simulationStore,SimulationMethod method,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception ;
Program: 18275
Project: 18275
Buggy source:
@Override public ExchangeRecord simulate(ExchangeRecord inputRecord,SimulationStore simulationStore,SimulationMethod method,TemplateEngine templateEngine) throws Exception {
  FieldExtractor extractor=new FieldExtractor();
  TemplateFieldSuggestions inputSuggestions=correlationEngine.correlateWithSubpath(inputRecord,extractor.getInputPathParams(inputRecord.getInMessage()),extractor.getInputQueryParams(inputRecord.getInMessage()),extractor.getInputContentParam(inputRecord.getInMessage()),extractor.getOutputFields(inputRecord.getOutMessage()));
  return method.simulate(inputRecord,inputSuggestions,simulationStore,templateEngine);
}

Fixed version (ground truth):
@Override public ExchangeRecord simulate(ExchangeRecord inputRecord,SimulationStore simulationStore,SimulationMethod method,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception {
  FieldExtractor extractor=new FieldExtractor();
  TemplateFieldSuggestions inputSuggestions=correlationEngine.correlateWithSubpath(inputRecord,extractor.getInputPathParams(inputRecord.getInMessage()),extractor.getInputQueryParams(inputRecord.getInMessage()),extractor.getInputContentParam(inputRecord.getInMessage()),extractor.getOutputFields(inputRecord.getOutMessage()));
  return method.simulate(inputRecord,inputSuggestions,simulationStore,templateEngine,fieldValues);
}
Program: 18276
Project: 18276
Buggy source:
/** 
 * Simulate the exchange
 * @param inputSuggestions 
 * @param templateEngine 
 * @throws Exception 
 */
public ExchangeRecord simulate(ExchangeRecord inputRecord,TemplateFieldSuggestions inputSuggestions,SimulationStore store,TemplateEngine templateEngine) throws Exception ;

Fixed version (ground truth):
/** 
 * Simulate the exchange
 * @param inputSuggestions 
 * @param templateEngine 
 * @throws Exception 
 */
public ExchangeRecord simulate(ExchangeRecord inputRecord,TemplateFieldSuggestions inputSuggestions,SimulationStore store,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception ;
Program: 18277
Project: 18277
Buggy source:
/** 
 * Match some field suggestions
 * @return
 */
private boolean matchSome(TemplateFieldSuggestions inputSuggestions,TemplateFieldSuggestions recordedSuggestions){
  return false;
}

Fixed version (ground truth):
/** 
 * Match some field suggestions
 * @return True if at least one match is found, false otherwise
 */
private boolean matchSome(TemplateFieldSuggestions inputSuggestions,TemplateFieldSuggestions recordedSuggestions){
  boolean matchSome=false;
  for (  AbstractTemplateField inputField : inputSuggestions.getTemplateFields()) {
    for (    AbstractTemplateField recordedField : recordedSuggestions.getTemplateFields()) {
      if (match(inputField,recordedField)) {
        matchSome=true;
      }
    }
  }
  logger.debug("String_Node_Str" + matchSome);
  return matchSome;
}
Program: 18278
Project: 18278
Buggy source:
@Override public ExchangeRecord simulate(ExchangeRecord inputRecord,TemplateFieldSuggestions inputSuggestions,SimulationStore store,TemplateEngine templateEngine) throws Exception {
  ExchangeRecord outputRecord=new ExchangeRecord();
  Iterator<ExchangeRecord> recordKeyIterator=store.getRecordList().keySet().iterator();
  while (recordKeyIterator.hasNext()) {
    ExchangeRecord record=recordKeyIterator.next();
    TemplateFieldSuggestions recordedSuggestions=store.getRecordList().get(record);
    if (matchAll(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      Map<String,List<String>> fieldValues=new HashMap<String,List<String>>();
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues);
      inputRecord.setOutMessage(outMessage);
      break;
    }
 else     if (matchSome(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      Map<String,List<String>> fieldValues=new HashMap<String,List<String>>();
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues);
      inputRecord.setOutMessage(outMessage);
    }
 else {
      logger.debug("String_Node_Str");
    }
  }
  return inputRecord;
}

Fixed version (ground truth):
@Override public ExchangeRecord simulate(ExchangeRecord inputRecord,TemplateFieldSuggestions inputSuggestions,SimulationStore store,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception {
  Iterator<ExchangeRecord> recordKeyIterator=store.getRecordList().keySet().iterator();
  while (recordKeyIterator.hasNext()) {
    ExchangeRecord record=recordKeyIterator.next();
    TemplateFieldSuggestions recordedSuggestions=store.getRecordList().get(record);
    if (matchAll(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues);
      inputRecord.setOutMessage(outMessage);
      break;
    }
 else     if (matchSome(inputSuggestions,recordedSuggestions)) {
      logger.debug("String_Node_Str");
      OutMessage outMessage=templateEngine.renderTemplateAndReplay(store.getStoreName(),inputRecord,fieldValues);
      inputRecord.setOutMessage(outMessage);
    }
 else {
      logger.debug("String_Node_Str");
    }
  }
  return inputRecord;
}
Program: 18279
Project: 18279
Buggy source:
/** 
 * Match all fields suggestions
 * @return
 */
private boolean matchAll(TemplateFieldSuggestions inputSuggestions,TemplateFieldSuggestions recordedSuggestions){
  boolean matchAll=true;
  for (  AbstractTemplateField inputField : inputSuggestions.getTemplateFields()) {
    for (    AbstractTemplateField recordedField : recordedSuggestions.getTemplateFields()) {
      if (match(inputField,recordedField)) {
        matchAll=matchAll & true;
      }
 else {
        matchAll=matchAll & false;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Match all fields suggestions
 * @return True if all fields match, false otherwise
 */
private boolean matchAll(TemplateFieldSuggestions inputSuggestions,TemplateFieldSuggestions recordedSuggestions){
  boolean matchAll=true;
  for (  AbstractTemplateField inputField : inputSuggestions.getTemplateFields()) {
    for (    AbstractTemplateField recordedField : recordedSuggestions.getTemplateFields()) {
      if (match(inputField,recordedField)) {
        matchAll=matchAll & true;
      }
 else {
        matchAll=matchAll & false;
      }
    }
  }
  logger.debug("String_Node_Str" + matchAll);
  return matchAll;
}
Program: 18281
Project: 18281
Buggy source:
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public Object doGetServiceJSONP(@Context HttpContext httpContext,@Context HttpServletRequest request,@QueryParam("String_Node_Str") String callback) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,List<String>> multiValuedParams=httpContext.getRequest().getQueryParameters();
  Map<String,String> params=new HashMap<String,String>();
  for (  Entry<String,List<String>> entry : multiValuedParams.entrySet()) {
    List<String> value=entry.getValue();
    if (value != null) {
      params.put(entry.getKey(),value.get(value.size() - 1));
    }
  }
  try {
    EasySOADocument doc=api.notifyService(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult(callback);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces("String_Node_Str") public Object doGetServiceJSONP(@Context HttpContext httpContext,@Context HttpServletRequest request,@QueryParam("String_Node_Str") String callback) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFirstValues2(httpContext.getRequest().getQueryParameters());
  try {
    EasySOADocument doc=api.notifyService(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult(callback);
}
Program: 18282
Project: 18282
Buggy source:
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostApi(@Context HttpContext httpContext,@Context HttpServletRequest request,String body) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFormValues(body);
  try {
    EasySOADocument doc=api.notifyServiceApi(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostApi(@Context HttpContext httpContext,@Context HttpServletRequest request) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFirstValues(request.getParameterMap());
  try {
    EasySOADocument doc=api.notifyServiceApi(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}
Program: 18283
Project: 18283
Buggy source:
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostService(@Context HttpContext httpContext,@Context HttpServletRequest request,String body) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  if (body != null && body.length() > 2) {
    body=body.substring(1,body.length() - 1);
  }
  Map<String,String> params=getFormValues(body);
  try {
    EasySOADocument doc=api.notifyService(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostService(@Context HttpContext httpContext,@Context HttpServletRequest request) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFirstValues(request.getParameterMap());
  try {
    EasySOADocument doc=api.notifyService(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}
Program: 18284
Project: 18284
Buggy source:
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostAppliImpl(@Context HttpContext httpContext,@Context HttpServletRequest request,String body) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFormValues(body);
  try {
    EasySOADocument doc=api.notifyAppliImpl(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostAppliImpl(@Context HttpContext httpContext,@Context HttpServletRequest request) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFirstValues(request.getParameterMap());
  try {
    EasySOADocument doc=api.notifyAppliImpl(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}
Program: 18285
Project: 18285
Buggy source:
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostServiceReference(@Context HttpContext httpContext,@Context HttpServletRequest request,String body) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFormValues(body);
  try {
    EasySOADocument doc=api.notifyServiceReference(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.APPLICATION_JSON) public Object doPostServiceReference(@Context HttpContext httpContext,@Context HttpServletRequest request,String body) throws Exception {
  EasySOAApiSession api=EasySOALocalApiFactory.createLocalApi(SessionFactory.getSession(request));
  Map<String,String> params=getFirstValues(request.getParameterMap());
  try {
    EasySOADocument doc=api.notifyServiceReference(params);
    result.put("String_Node_Str",doc.getId());
  }
 catch (  Exception e) {
    appendError(e.getMessage());
  }
  return getFormattedResult();
}
Program: 18286
Project: 18286
Buggy source:
@POST @Path("String_Node_Str") public Object doPost(@Context HttpContext httpContext,String body) throws Exception {
  Map<String,String> formValues=DiscoveryRest.getFormValues(body);
  BrowsingContext browsingContext=new BrowsingContext(new URL(formValues.get("String_Node_Str")),formValues.get("String_Node_Str"));
  return findWSDls(browsingContext);
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public Object doPost(@Context HttpContext httpContext,@Context HttpServletRequest request) throws Exception {
  Map<String,String> formValues=DiscoveryRest.getFirstValues(request.getParameterMap());
  BrowsingContext browsingContext=new BrowsingContext(new URL(formValues.get("String_Node_Str")),formValues.get("String_Node_Str"));
  return findWSDls(browsingContext);
}
Program: 18287
Project: 18287
Buggy source:
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws FrascatiException {
  logger.info("String_Node_Str");
  stopFraSCAti();
}

Fixed version (ground truth):
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws Exception {
  logger.info("String_Node_Str");
  stopFraSCAti();
}
Program: 18288
Project: 18288
Buggy source:
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws FrascatiException {
  logger.info("String_Node_Str");
  stopFraSCAti();
}

Fixed version (ground truth):
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws Exception {
  logger.info("String_Node_Str");
  stopFraSCAti();
}
Program: 18289
Project: 18289
Buggy source:
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws FrascatiException {
  logger.info("String_Node_Str");
  stopFraSCAti();
}

Fixed version (ground truth):
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws Exception {
  logger.info("String_Node_Str");
  stopFraSCAti();
}
Program: 18290
Project: 18290
Buggy source:
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws FrascatiException {
  logger.info("String_Node_Str");
  stopFraSCAti();
}

Fixed version (ground truth):
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws Exception {
  logger.info("String_Node_Str");
  stopFraSCAti();
}
Program: 18291
Project: 18291
Buggy source:
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws FrascatiException {
  logger.info("String_Node_Str");
  stopFraSCAti();
}

Fixed version (ground truth):
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws Exception {
  logger.info("String_Node_Str");
  stopFraSCAti();
}
Program: 18292
Project: 18292
Buggy source:
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws FrascatiException {
  logger.info("String_Node_Str");
  stopFraSCAti();
}

Fixed version (ground truth):
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws Exception {
  logger.info("String_Node_Str");
  stopFraSCAti();
}
Program: 18293
Project: 18293
Buggy source:
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws FrascatiException {
  logger.info("String_Node_Str");
  stopFraSCAti();
}

Fixed version (ground truth):
/** 
 * Stop FraSCAti components
 * @throws FrascatiException
 */
@AfterClass public static void cleanUp() throws Exception {
  logger.info("String_Node_Str");
  stopFraSCAti();
}
Program: 18294
Project: 18294
Buggy source:
/** 
 * @throws FrascatiException
 */
protected static void stopFraSCAti() throws FrascatiException {
  logger.info("String_Node_Str");
  if (componentList != null) {
    for (    String component : componentList) {
      logger.debug("String_Node_Str" + component);
      frascati.stop(component);
    }
  }
  frascati=null;
}

Fixed version (ground truth):
/** 
 * @throws FrascatiException
 */
protected static void stopFraSCAti() throws Exception {
  logger.info("String_Node_Str");
  if (componentList != null) {
    for (    String component : componentList) {
      logger.debug("String_Node_Str" + component);
      frascati.stop(component);
    }
  }
  frascati=null;
}
Program: 18295
Project: 18295
Buggy source:
/** 
 * Start HTTP Proxy
 * @throws FrascatiException
 * @throws FraSCAtiServiceException 
 */
protected static void startHttpDiscoveryProxy(String composite,URL... urls) throws FrascatiException, FraSCAtiServiceException {
  logger.info("String_Node_Str");
  String component=frascati.processComposite(composite,FraSCAtiServiceItf.all,urls);
  componentList.add(component);
}

Fixed version (ground truth):
/** 
 * Start HTTP Proxy
 * @throws FrascatiException
 * @throws FraSCAtiServiceException 
 */
protected static void startHttpDiscoveryProxy(String composite,URL... urls) throws Exception {
  logger.info("String_Node_Str");
  String component=frascati.processComposite(composite,FraSCAtiServiceItf.all,urls);
  componentList.add(component);
}
Program: 18296
Project: 18296
Buggy source:
/** 
 * Start the services mock for tests (Meteo mock, twitter mock ...)
 * @param withNuxeoMock If true, the Nuxeo mock is started
 * @throws FrascatiException if a problem occurs during the start of composites
 * @throws FraSCAtiServiceException 
 */
protected static void startMockServices(boolean withNuxeoMock) throws FrascatiException, FraSCAtiServiceException {
  logger.info("String_Node_Str");
  componentList.add(frascati.processComposite("String_Node_Str"));
  if (withNuxeoMock) {
    componentList.add(frascati.processComposite("String_Node_Str"));
  }
  componentList.add(frascati.processComposite("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Start the services mock for tests (Meteo mock, twitter mock ...)
 * @param withNuxeoMock If true, the Nuxeo mock is started
 * @throws FrascatiException if a problem occurs during the start of composites
 * @throws FraSCAtiServiceException 
 */
protected static void startMockServices(boolean withNuxeoMock) throws Exception {
  logger.info("String_Node_Str");
  componentList.add(frascati.processComposite("String_Node_Str"));
  if (withNuxeoMock) {
    componentList.add(frascati.processComposite("String_Node_Str"));
  }
  componentList.add(frascati.processComposite("String_Node_Str"));
}
Program: 18297
Project: 18297
Buggy source:
public void handleEvent(Event event){
  EventContext context=event.getContext();
  CoreSession session=context.getCoreSession();
  DocumentModel doc=((DocumentEventContext)context).getSourceDocument();
  try {
    DocumentService docService=Framework.getService(DocumentService.class);
    DocumentModel workspace=docService.getWorkspace(session,doc);
    ServiceValidationService validationService=Framework.getService(ServiceValidationService.class);
    Boolean wasValidated=(Boolean)workspace.getProperty(Workspace.SCHEMA,Workspace.PROP_ISVALIDATED);
    boolean isValidated;
    if (wasValidated != null && wasValidated) {
      isValidated=validationService.validateServices(session,doc).isEveryValidationPassed();
    }
 else {
      isValidated=validationService.validateServices(session,workspace).isEveryValidationPassed();
    }
    if (wasValidated == null || wasValidated != isValidated) {
      workspace.setProperty(Workspace.SCHEMA,Workspace.PROP_ISVALIDATED,isValidated);
      session.saveDocument(workspace);
    }
    session.save();
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + doc.getType(),e);
  }
}

Fixed version (ground truth):
public void handleEvent(Event event){
  EventContext context=event.getContext();
  CoreSession session=context.getCoreSession();
  DocumentModel doc=((DocumentEventContext)context).getSourceDocument();
  try {
    DocumentService docService=Framework.getService(DocumentService.class);
    DocumentModel workspace=docService.getWorkspace(session,doc);
    ServiceValidationService validationService=Framework.getService(ServiceValidationService.class);
    boolean hasReferenceEnvironment=workspace.getProperty(Workspace.SCHEMA,Workspace.PROP_REFERENCEDENVIRONMENT) != null;
    if (hasReferenceEnvironment) {
      Boolean wasValidated=(Boolean)workspace.getProperty(Workspace.SCHEMA,Workspace.PROP_ISVALIDATED);
      boolean isValidated;
      if (wasValidated != null && wasValidated) {
        isValidated=validationService.validateServices(session,doc).isEveryValidationPassed();
      }
 else {
        isValidated=validationService.validateServices(session,workspace).isEveryValidationPassed();
      }
      if (wasValidated == null || wasValidated != isValidated) {
        workspace.setProperty(Workspace.SCHEMA,Workspace.PROP_ISVALIDATED,isValidated);
        session.saveDocument(workspace);
      }
      session.save();
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + doc.getType(),e);
  }
}
Program: 18298
Project: 18298
Buggy source:
private DocumentModel findFirstDocument(CoreSession session,String type,String field,String value) throws ClientException {
  DocumentModelList results=session.query("String_Node_Str" + type + "String_Node_Str"+ field+ "String_Node_Str"+ value+ "String_Node_Str",new Filter(){
    private static final long serialVersionUID=1L;
    public boolean accept(    DocumentModel docModel){
      try {
        return docModel.isLatestVersion() || !docModel.hasFacet("String_Node_Str");
      }
 catch (      ClientException e) {
        return false;
      }
    }
  }
);
  return (results != null && !results.isEmpty()) ? results.get(0) : null;
}

Fixed version (ground truth):
private DocumentModel findFirstDocument(CoreSession session,String type,String field,String value) throws ClientException {
  DocumentModelList results=session.query("String_Node_Str" + type + "String_Node_Str"+ field+ "String_Node_Str"+ value+ "String_Node_Str");
  return (results != null && !results.isEmpty()) ? results.get(0) : null;
}
Program: 18300
Project: 18300
Buggy source:
@Override public void deactivate(ComponentContext context) throws Exception {
  if (parsingPoolThread != null) {
    parsingPoolThread.interrupt();
  }
}

Fixed version (ground truth):
@Override public void deactivate(ComponentContext context) throws Exception {
  if (parsingPoolThread != null) {
    parsingPoolThread.interrupt();
  }
  if (coreSession != null) {
    CoreInstance.getInstance().close(coreSession);
  }
  if (loginContext != null) {
    loginContext.logout();
  }
}
Program: 18301
Project: 18301
Buggy source:
@Override public void handleEvent(Event event) throws ClientException {
  try {
    CoreSession session=Framework.getService(RepositoryManager.class).getDefaultRepository().open();
    String environmentName=(String)event.getContext().getProperty("String_Node_Str");
    String tmpWorkspaceName="String_Node_Str" + environmentName + System.currentTimeMillis();
    DocumentModel environmentModel=docService.findEnvironment(session,environmentName);
    if (environmentModel != null) {
      DocumentModel tmpWorkspaceModel=null;
      ValidationResultList validationResults=null;
      try {
        tmpWorkspaceModel=publicationService.forkEnvironment(session,environmentModel,tmpWorkspaceName);
        validationResults=serviceValidationService.validateServices(session,tmpWorkspaceModel);
      }
 catch (      Exception e) {
        log.error("String_Node_Str",e);
      }
 finally {
        if (tmpWorkspaceModel != null) {
          session.removeDocument(tmpWorkspaceModel.getRef());
        }
      }
      DocumentModel workspaceModel=docService.findWorkspace(session,environmentName);
    }
 else {
      log.error("String_Node_Str" + environmentName + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void handleEvent(Event event) throws ClientException {
synchronized (log) {
    try {
      RepositoryManager mgr=Framework.getService(RepositoryManager.class);
      Repository repository=mgr.getDefaultRepository();
      TransactionHelper.startTransaction();
      session=repository.open();
      String environmentName=(String)event.getContext().getProperty("String_Node_Str");
      String tmpWorkspaceName="String_Node_Str" + environmentName + System.currentTimeMillis();
      DocumentModel environmentModel=docService.findEnvironment(session,environmentName);
      if (environmentModel != null) {
        DocumentModel tmpWorkspaceModel=null;
        ValidationResultList validationResults=null;
        try {
          tmpWorkspaceModel=publicationService.forkEnvironment(session,environmentModel,tmpWorkspaceName);
          validationResults=serviceValidationService.validateServices(session,tmpWorkspaceModel);
        }
 catch (        Exception e) {
          log.error("String_Node_Str",e);
        }
 finally {
          if (tmpWorkspaceModel != null) {
            session.removeDocument(tmpWorkspaceModel.getRef());
          }
        }
        DocumentModel workspaceModel=docService.findWorkspace(session,environmentName);
      }
 else {
        log.error("String_Node_Str" + environmentName + "String_Node_Str");
      }
    }
 catch (    Exception e) {
      log.error("String_Node_Str",e);
    }
 finally {
      TransactionHelper.commitOrRollbackTransaction();
      if (session != null) {
        CoreInstance.getInstance().close(session);
      }
    }
  }
}
Program: 18302
Project: 18302
Buggy source:
/** 
 * Check the recorded exchanges
 * @throws IOException
 */
public void checkExchanges(){
  boolean none=true;
  for (  ExchangeRecord record : recordList) {
    none=false;
    assertTrue("String_Node_Str",record.getInMessage().getMessageContent().getContent().contains("String_Node_Str"));
  }
  assertTrue("String_Node_Str",none);
}

Fixed version (ground truth):
/** 
 * Check the recorded exchanges
 * @throws IOException
 */
public void checkExchanges(){
  boolean none=true;
  for (  ExchangeRecord record : recordList) {
    none=false;
    assertTrue("String_Node_Str",record.getInMessage().getMessageContent().getRawContent().contains("String_Node_Str"));
  }
  assertTrue("String_Node_Str",none);
}
Program: 18303
Project: 18303
Buggy source:
/** 
 * Return the name of the object, which is also an   {@ŀink EObject}
 * @param t the object of which the name is to find
 * @return the name of the object passed on as parameter
 */
protected abstract String getName(T t);

Fixed version (ground truth):
/** 
 * Return the name of the object, which is also an   {@link EObject}
 * @param t the object of which the name is to find
 * @return the name of the object passed on as parameter
 */
protected abstract String getName(T t);