nus-yam/ex-repair huggingface dataset:
Program: 18208
Project: 18208
Buggy source:
public List<JavaServiceConsumptionInformation> find(JavaClass c,MavenDeliverable mavenDeliverable,Map<String,JavaServiceInterfaceInformation> serviceInterfaces) throws Exception {
  List<JavaServiceConsumptionInformation> foundConsumptions=new ArrayList<JavaServiceConsumptionInformation>();
  for (  String importedClassName : c.getSource().getImports()) {
    Type importedClassType=new Type(importedClassName);
    for (    String serviceInterface : serviceInterfaces.keySet()) {
      if (importedClassType.equals(serviceInterface)) {
        foundConsumptions.add(new JavaServiceConsumptionInformation(mavenDeliverable.getSoaNodeId(),c.getFullyQualifiedName(),importedClassName,serviceInterface));
      }
    }
  }
  return foundConsumptions;
}

Fixed version (ground truth):
public List<JavaServiceConsumptionInformation> find(JavaClass c,MavenDeliverable mavenDeliverable,Map<String,JavaServiceInterfaceInformation> serviceInterfaces) throws Exception {
  List<JavaServiceConsumptionInformation> foundConsumptions=new ArrayList<JavaServiceConsumptionInformation>();
  for (  String importedClassName : c.getSource().getImports()) {
    Type importedClassType=new Type(importedClassName);
    for (    String serviceInterface : serviceInterfaces.keySet()) {
      if (importedClassType.getFullyQualifiedName().equals(serviceInterface)) {
        foundConsumptions.add(new JavaServiceConsumptionInformation(mavenDeliverable.getSoaNodeId(),c.getFullyQualifiedName(),importedClassName,serviceInterface));
      }
    }
  }
  return foundConsumptions;
}
Program: 18210
Project: 18210
Buggy source:
@Override public List<String> getStoreList(String path){
  File folder=new File(path);
  File[] listOfFiles=folder.listFiles();
  List<String> storeList=new ArrayList<String>();
  for (  File file : listOfFiles) {
    if (file.isDirectory()) {
      storeList.add(file.getName());
    }
  }
  return storeList;
}

Fixed version (ground truth):
@Override public List<String> getStoreList(String path){
  File folder=new File(path);
  File[] listOfFiles=folder.listFiles();
  List<String> storeList=new ArrayList<String>();
  if (listOfFiles != null) {
    for (    File file : listOfFiles) {
      if (file.isDirectory()) {
        storeList.add(file.getName());
      }
    }
  }
  return storeList;
}
Program: 18211
Project: 18211
Buggy source:
private boolean maintainInternalProperties(CoreSession session,DocumentModel appliImplModel,String environment){
  try {
    String url=(String)appliImplModel.getProperty(SCHEMA,PROP_URL);
    String server=(String)appliImplModel.getProperty(SCHEMA,PROP_SERVER);
    if (url != null && !url.isEmpty() && !AppliImpl.DEFAULT_APPLIIMPL_URL.equals(url) && (server == null || server.isEmpty())) {
      try {
        url=PropertyNormalizer.normalizeUrl(url);
        appliImplModel.setProperty(SCHEMA,PROP_URL,url);
        server=new URL(url).getHost();
        appliImplModel.setProperty(SCHEMA,PROP_SERVER,server);
        appliImplModel.setProperty(SCHEMA,PROP_SERVERENTRY,environment + "String_Node_Str" + server);
      }
 catch (      MalformedURLException e) {
        log.warn("String_Node_Str" + url + "String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean maintainInternalProperties(CoreSession session,DocumentModel appliImplModel,String environment){
  try {
    String url=(String)appliImplModel.getProperty(SCHEMA,PROP_URL);
    String server=(String)appliImplModel.getProperty(SCHEMA,PROP_SERVER);
    if (url != null && !url.isEmpty() && !"String_Node_Str".equals(url) && !AppliImpl.DEFAULT_APPLIIMPL_URL.equals(url) && (server == null || server.isEmpty())) {
      try {
        url=PropertyNormalizer.normalizeUrl(url);
        appliImplModel.setProperty(SCHEMA,PROP_URL,url);
        server=new URL(url).getHost();
        appliImplModel.setProperty(SCHEMA,PROP_SERVER,server);
        appliImplModel.setProperty(SCHEMA,PROP_SERVERENTRY,environment + "String_Node_Str" + server);
      }
 catch (      MalformedURLException e) {
        log.warn("String_Node_Str" + url + "String_Node_Str");
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return false;
  }
  return true;
}
Program: 18212
Project: 18212
Buggy source:
private static String extractApplicationNameFromUrl(URL url) throws Exception {
  HttpDownloaderService httpDownloaderService=Framework.getService(HttpDownloaderService.class);
  HttpDownloader siteRootFile=httpDownloaderService.createHttpDownloader(url);
  siteRootFile.download();
  TagNode siteRootCleanHtml=cleaner.clean(siteRootFile.getFile());
  return extractApplicationName(siteRootCleanHtml);
}

Fixed version (ground truth):
private static String extractApplicationNameFromUrl(URL url) throws Exception {
  HttpDownloaderService httpDownloaderService=Framework.getService(HttpDownloaderService.class);
  HttpDownloader siteRootFile=httpDownloaderService.createHttpDownloader(url);
  siteRootFile.download();
  try {
    TagNode siteRootCleanHtml=cleaner.clean(siteRootFile.getFile());
    return extractApplicationName(siteRootCleanHtml);
  }
 catch (  StackOverflowError e) {
    log.warn("String_Node_Str" + url + "String_Node_Str");
    return null;
  }
}
Program: 18213
Project: 18213
Buggy source:
@Override public List<FoundService> findFromContext(BrowsingContext context) throws Exception {
  List<FoundService> foundServices=new LinkedList<FoundService>();
  URL url=context.getURL();
  String urlString=url.toString();
  if (urlString.toLowerCase().endsWith("String_Node_Str")) {
    WSDLReader reader=WSDLFactory.newInstance().newWSDLReader();
    Description desc=reader.read(url);
    String serviceName=desc.getQName().getLocalPart();
    foundServices.add(new FoundService(serviceName,urlString));
  }
  return foundServices;
}

Fixed version (ground truth):
@Override public List<FoundService> findFromContext(BrowsingContext context) throws Exception {
  List<FoundService> foundServices=new LinkedList<FoundService>();
  URL url=context.getURL();
  String urlString=url.toString();
  if (urlString.toLowerCase().endsWith("String_Node_Str")) {
    WSDLReader reader=WSDLFactory.newInstance().newWSDLReader();
    Description desc=reader.read(url);
    String serviceName=null;
    try {
      serviceName=desc.getQName().getLocalPart();
    }
 catch (    Exception e) {
      String[] splitUrl=urlString.toLowerCase().split("String_Node_Str");
      serviceName=(splitUrl[splitUrl.length - 1].contains("String_Node_Str")) ? splitUrl[splitUrl.length - 2] : splitUrl[splitUrl.length - 1];
    }
    foundServices.add(new FoundService(serviceName,urlString));
  }
  return foundServices;
}
Program: 18215
Project: 18215
Buggy source:
/** 
 * Constructor
 * @param response
 * @throws IOException 
 * @throws UnsupportedEncodingException 
 */
public HttpMessageResponseWrapper(HttpServletResponse response) throws UnsupportedEncodingException, IOException {
  super(response);
  writer=new CopyWriter(new OutputStreamWriter(response.getOutputStream(),response.getCharacterEncoding()));
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param response
 * @throws IOException 
 * @throws UnsupportedEncodingException 
 */
public HttpMessageResponseWrapper(HttpServletResponse response) throws UnsupportedEncodingException, IOException {
  super(response);
}
Program: 18216
Project: 18216
Buggy source:
/** 
 * @return
 */
public PrintWriter getWriter(){
  return this.writer;
}

Fixed version (ground truth):
/** 
 * @return
 */
public PrintWriter getWriter() throws IOException {
  copyOut=new CopyOutputStream(this.getResponse().getOutputStream());
  writer=new PrintWriter(new OutputStreamWriter(copyOut,this.getCharacterEncoding()));
  return this.writer;
}
Program: 18217
Project: 18217
Buggy source:
public ServletOutputStream getOutputStream(){
  return new ServletOutputStream(){
    private ByteArrayOutputStream bos=new ByteArrayOutputStream();
    @Override public void write(    int b) throws IOException {
      bos.write(writer.getCopy().getBytes());
    }
  }
;
}

Fixed version (ground truth):
public ServletOutputStream getOutputStream() throws IOException {
  copyOut=new CopyOutputStream(this.getResponse().getOutputStream());
  writer=new PrintWriter(new OutputStreamWriter(copyOut,this.getCharacterEncoding()));
  return new ServletOutputStream(){
    @Override public void write(    int b) throws IOException {
      copyOut.write(b);
    }
  }
;
}
Program: 18218
Project: 18218
Buggy source:
/** 
 * @return
 */
public String getMessageContent(){
  return this.writer.getCopy();
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getMessageContent(){
  return new String(this.copyOut.getCopy(),Charset.forName(this.getCharacterEncoding()));
}
Program: 18219
Project: 18219
Buggy source:
@Override public void write(int b) throws IOException {
  bos.write(writer.getCopy().getBytes());
}

Fixed version (ground truth):
@Override public void write(int b) throws IOException {
  copyOut.write(b);
}
Program: 18220
Project: 18220
Buggy source:
/** 
 * Process the filter 
 */
public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  logger.info("String_Node_Str");
  if (exchangeHandler != null) {
    if (request instanceof HttpServletRequest) {
      HttpMessageRequestWrapper requestWrapper=new HttpMessageRequestWrapper((HttpServletRequest)request);
      HttpMessageResponseWrapper responseWrapper=new HttpMessageResponseWrapper((HttpServletResponse)response);
      try {
        exchangeHandler.handleExchange(requestWrapper,responseWrapper);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
      }
    }
  }
  chain.doFilter(request,response);
}

Fixed version (ground truth):
/** 
 * Process the filter 
 */
public void doFilter(ServletRequest request,ServletResponse response,FilterChain chain) throws IOException, ServletException {
  logger.info("String_Node_Str");
  if (exchangeHandler != null) {
    response=new HttpMessageResponseWrapper((HttpServletResponse)response);
  }
  chain.doFilter(request,response);
  if (exchangeHandler != null) {
    if (request instanceof HttpServletRequest) {
      try {
        exchangeHandler.handleExchange((HttpServletRequest)request,(HttpServletResponse)response);
      }
 catch (      Exception e) {
        logger.error("String_Node_Str",e);
      }
    }
  }
}
Program: 18221
Project: 18221
Buggy source:
public void handleExchange(HttpServletRequest request,HttpServletResponse response) throws Exception {
  HttpMessageRequestWrapper requestWrapper=new HttpMessageRequestWrapper(request);
  HttpMessageResponseWrapper responseWrapper=new HttpMessageResponseWrapper(response);
  InMessage inMessage=new InMessage(requestWrapper);
  OutMessage outMessage=new OutMessage(responseWrapper);
  this.handleMessage(inMessage,outMessage);
}

Fixed version (ground truth):
public void handleExchange(HttpServletRequest request,HttpServletResponse response) throws Exception {
  HttpMessageRequestWrapper requestWrapper=new HttpMessageRequestWrapper(request);
  HttpMessageResponseWrapper responseWrapper;
  if (response instanceof HttpMessageResponseWrapper) {
    responseWrapper=(HttpMessageResponseWrapper)response;
  }
 else {
    responseWrapper=new HttpMessageResponseWrapper(response);
  }
  InMessage inMessage=new InMessage(requestWrapper);
  OutMessage outMessage=new OutMessage(responseWrapper);
  this.handleMessage(inMessage,outMessage);
}
Program: 18222
Project: 18222
Buggy source:
/** 
 * Prefer   {@link EasySOAApiFraSCAti#getInstance()} static method instead(constructor only made public to let the Nuxeo framework instanciate it)
 */
public EasySOAApiFraSCAti() throws InstantiationException {
  if (instance != null) {
    throw new InstantiationException("String_Node_Str");
  }
  try {
    remoteProvider=new RemoteFraSCAtiServiceProvider(LIBRARIES_DIRECTORY);
    this.frascati=remoteProvider.getFraSCAtiService();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  instance=this;
}

Fixed version (ground truth):
/** 
 * Hidden constructor Use   {@link EasySOAApiFraSCAti#getInstance()} staticmethod instead
 */
protected EasySOAApiFraSCAti(){
  try {
    remoteProvider=new RemoteFraSCAtiServiceProvider(null);
    this.frascati=remoteProvider.getFraSCAtiService();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 18223
Project: 18223
Buggy source:
/** 
 * Return the singleton instance of EasySOAApiFraSCAti
 * @return the EasySOAApiFraSCAti singleton
 */
public static final EasySOAApiFraSCAti getInstance(){
  if (instance == null) {
    try {
      instance=new EasySOAApiFraSCAti();
    }
 catch (    InstantiationException e) {
      e.printStackTrace();
    }
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Return the singleton instance of EasySOAApiFraSCAti
 * @return the EasySOAApiFraSCAti singleton
 */
public static final EasySOAApiFraSCAti getInstance(){
  if (instance == null) {
    instance=new EasySOAApiFraSCAti();
  }
  return instance;
}
Program: 18224
Project: 18224
Buggy source:
/** 
 * Register a new event receiver
 * @param eventReceiver The RunManagerEventReciver to register
 */
public void addEventReceiver(RunManagerEventReceiver eventReceiver){
  if (eventReceiver != null) {
    runManagerEventReceiverList.add(eventReceiver);
  }
}

Fixed version (ground truth):
/** 
 * Register a new event receiver
 * @param eventReceiver The RunManagerEventReceiver to register
 */
public static void addEventReceiver(RunManagerEventReceiver eventReceiver){
  if (eventReceiver != null) {
    runManagerEventReceiverList.add(eventReceiver);
  }
}
Program: 18226
Project: 18226
Buggy source:
/** 
 * @param templateField
 * @return
 */
private boolean match(AbstractTemplateField inputField,AbstractTemplateField recordedField){
  boolean match=false;
  if (recordedField.getFieldName().equals(inputField.getFieldName()) && recordedField.getDefaultValue().equals(inputField.getDefaultValue()) && recordedField.getFieldType().equals(inputField.getFieldType())) {
    match=true;
  }
  return match;
}

Fixed version (ground truth):
/** 
 * @param templateField
 * @return
 */
private boolean match(AbstractTemplateField inputField,AbstractTemplateField recordedField){
  boolean match=false;
  if (inputField.getFieldName().equals(recordedField.getFieldName()) && inputField.getDefaultValue().equals(recordedField.getDefaultValue()) && inputField.getFieldType().equals(recordedField.getFieldType())) {
    match=true;
  }
  return match;
}
Program: 18227
Project: 18227
Buggy source:
/** 
 * @param defaultValue
 */
public void setDefaultValue(String defaultValue){
  this.defaultValue=defaultValue;
}

Fixed version (ground truth):
/** 
 * @param defaultValue
 */
public void setDefaultValue(String defaultValue){
  this.defaultValue=defaultValue.replace("String_Node_Str","String_Node_Str");
}
Program: 18228
Project: 18228
Buggy source:
public abstract void setPathParamPosition(int pathParamPosition);

Fixed version (ground truth):
/** 
 * Number to define the parameter position in url path (eg : for http://localhost:8088/1/users/show/FR3Aquitaine.xml, the param user correspond to number 4 (FR3Aquitaine.xml)), the first '/' represent the root of the path. 
 * @param pathParamPosition
 */
public void setPathParamPosition(int pathParamPosition){
  this.pathParamPosition=pathParamPosition;
}
Program: 18229
Project: 18229
Buggy source:
/** 
 * Default constructor
 */
public AbstractTemplateField(){
  fieldName="String_Node_Str";
  fieldType="String_Node_Str";
  defaultValue="String_Node_Str";
  setFieldEquality(true);
}

Fixed version (ground truth):
/** 
 * Default constructor
 */
public AbstractTemplateField(){
  fieldName="String_Node_Str";
  fieldType="String_Node_Str";
  defaultValue="String_Node_Str";
  setFieldEquality(true);
  pathParamPosition=0;
}
Program: 18230
Project: 18230
Buggy source:
public abstract int getPathParamPosition();

Fixed version (ground truth):
/** 
 * @return
 */
public int getPathParamPosition(){
  return pathParamPosition;
}
Program: 18231
Project: 18231
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);
  return renderedTemplate;
}

Fixed version (ground truth):
@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;
}
Program: 18232
Project: 18232
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);
  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 TemplateExecutor();
  return executor.execute(renderedTemplate);
}
Program: 18233
Project: 18233
Buggy source:
public String getResponsetemplate(){
  JSONObject jsonRecord=JSONObject.fromObject(customRecord.getOutMessage());
  return VELOCIMACRO_RESPONSE_PREFIX + "String_Node_Str" + jsonRecord.toString().replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ VELOCIMACRO_SUFFIX;
}

Fixed version (ground truth):
public String getResponsetemplate(){
  JSONObject jsonRecord=JSONObject.fromObject(customRecord.getOutMessage());
  return VELOCIMACRO_RESPONSE_PREFIX + "String_Node_Str" + jsonRecord.toString()+ "String_Node_Str"+ VELOCIMACRO_SUFFIX;
}
Program: 18234
Project: 18234
Buggy source:
public String getRequestTemplate(){
  JSONObject jsonRecord=JSONObject.fromObject(customRecord.getInMessage());
  return VELOCIMACRO_REQUEST_PREFIX + "String_Node_Str" + jsonRecord.toString().replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ VELOCIMACRO_SUFFIX;
}

Fixed version (ground truth):
public String getRequestTemplate(){
  JSONObject jsonRecord=JSONObject.fromObject(customRecord.getInMessage());
  String jsonString;
  if (customRecord.getInMessage().getMessageContent().isXMLContent()) {
    jsonString=jsonRecord.toString();
  }
 else {
    jsonString=jsonRecord.toString().replace("String_Node_Str","String_Node_Str");
  }
  return VELOCIMACRO_REQUEST_PREFIX + "String_Node_Str" + jsonString+ "String_Node_Str"+ VELOCIMACRO_SUFFIX;
}
Program: 18235
Project: 18235
Buggy source:
/** 
 * To get the Twitter URL data set
 * @return The Twitter URL data set
 */
public ArrayList<String> getTwitterUrlData(String baseUrl){
  if (baseUrl == null || "String_Node_Str".equals(baseUrl)) {
    logger.warn("String_Node_Str");
    baseUrl="String_Node_Str";
  }
  twitterTestSet=new ArrayList<String>();
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  return twitterTestSet;
}

Fixed version (ground truth):
/** 
 * To get the Twitter URL data set
 * @return The Twitter URL data set
 */
public ArrayList<String> getTwitterUrlData(String baseUrl){
  if (baseUrl == null || "String_Node_Str".equals(baseUrl)) {
    logger.warn("String_Node_Str");
    baseUrl="String_Node_Str";
  }
  twitterTestSet=new ArrayList<String>();
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  twitterTestSet.add("String_Node_Str" + baseUrl + "String_Node_Str");
  return twitterTestSet;
}
Program: 18236
Project: 18236
Buggy source:
/** 
 * Sets the text.
 * @param text The text to set.
 */
public void setRawContent(String rawContent){
  if (rawContent != null) {
    rawContent.replace("String_Node_Str","String_Node_Str");
    this.rawContent=rawContent;
    this.contentType=ContentChecker.checkJsonXmlContent(rawContent);
    if (ContentType.JSON.equals(contentType)) {
      this.JSONContent=JSONSerializer.toJSON(this.rawContent);
      this.XMLContent=null;
    }
 else     if (ContentType.XML.equals(contentType)) {
      try {
        DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
        this.XMLContent=docBuilder.parse(new InputSource(new StringReader(this.rawContent)));
      }
 catch (      Exception ex) {
        ex.printStackTrace();
        this.contentType=ContentType.Undefined;
        this.XMLContent=null;
      }
      this.JSONContent=null;
    }
 else {
      this.JSONContent=null;
      this.XMLContent=null;
    }
  }
 else {
    this.rawContent="String_Node_Str";
    this.contentType=ContentChecker.ContentType.Undefined;
  }
}

Fixed version (ground truth):
/** 
 * Sets the text.
 * @param text The text to set.
 */
public void setRawContent(String rawContent){
  if (rawContent != null) {
    this.rawContent=rawContent;
    this.contentType=ContentChecker.checkJsonXmlContent(rawContent);
    if (ContentType.JSON.equals(contentType)) {
      this.JSONContent=JSONSerializer.toJSON(rawContent);
      this.XMLContent=null;
    }
 else     if (ContentType.XML.equals(contentType)) {
      try {
        DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
        this.XMLContent=docBuilder.parse(new InputSource(new StringReader(rawContent)));
      }
 catch (      Exception ex) {
        ex.printStackTrace();
        this.contentType=ContentType.Undefined;
        this.XMLContent=null;
      }
      this.JSONContent=null;
    }
 else {
      this.JSONContent=null;
      this.XMLContent=null;
    }
  }
 else {
    this.rawContent="String_Node_Str";
    this.contentType=ContentChecker.ContentType.Undefined;
  }
}
Program: 18237
Project: 18237
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){
  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;
}

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){
  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: 18238
Project: 18238
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){
  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;
}

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){
  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: 18239
Project: 18239
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){
  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;
}

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){
  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: 18240
Project: 18240
Buggy source:
/** 
 * @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;
}

Fixed version (ground truth):
/** 
 * @param outMessage
 * @return
 */
public HashMap<String,CandidateField> getOutputFields(OutMessage outMessage){
  HashMap<String,CandidateField> fieldMap=new HashMap<String,CandidateField>();
  logger.debug("String_Node_Str");
  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: 18241
Project: 18241
Buggy source:
@Override public SimulationStore getSimulationStoreFromSuggestion(String storeName,List<ExchangeRecord> exchangeRecordList){
  SimulationStore store=new SimulationStore(storeName);
  FieldExtractor extractor=new FieldExtractor();
  for (  ExchangeRecord exchangeRecord : exchangeRecordList) {
    TemplateFieldSuggestions suggestions=correlationEngine.correlateWithSubpath(exchangeRecord,extractor.getInputPathParams(exchangeRecord.getInMessage()),extractor.getInputQueryParams(exchangeRecord.getInMessage()),extractor.getInputContentParam(exchangeRecord.getInMessage()),extractor.getOutputFields(exchangeRecord.getOutMessage()));
    store.addRecordSuggestions(exchangeRecord,suggestions);
  }
  return store;
}

Fixed version (ground truth):
@Override public SimulationStore getSimulationStoreFromSuggestion(String storeName,List<ExchangeRecord> exchangeRecordList){
  SimulationStore store=new SimulationStore(storeName);
  FieldExtractor extractor=new FieldExtractor();
  for (  ExchangeRecord exchangeRecord : exchangeRecordList) {
    logger.debug("String_Node_Str" + exchangeRecord.getExchange().getExchangeID());
    TemplateFieldSuggestions suggestions=correlationEngine.correlateWithSubpath(exchangeRecord,extractor.getInputPathParams(exchangeRecord.getInMessage()),extractor.getInputQueryParams(exchangeRecord.getInMessage()),extractor.getInputContentParam(exchangeRecord.getInMessage()),extractor.getOutputFields(exchangeRecord.getOutMessage()));
    store.addRecordSuggestions(exchangeRecord,suggestions);
  }
  return store;
}
Program: 18242
Project: 18242
Buggy source:
@Override public ExchangeRecord simulate(ExchangeRecord exchangeRecord,SimulationStore simulationStore,SimulationMethod method,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception {
  FieldExtractor extractor=new FieldExtractor();
  TemplateFieldSuggestions fieldSuggestions=correlationEngine.correlateWithSubpath(exchangeRecord,extractor.getInputPathParams(exchangeRecord.getInMessage()),extractor.getInputQueryParams(exchangeRecord.getInMessage()),extractor.getInputContentParam(exchangeRecord.getInMessage()),extractor.getOutputFields(exchangeRecord.getOutMessage()));
  templateEngine.generateTemplate(fieldSuggestions,exchangeRecord,simulationStore.getStoreName(),true);
  return method.simulate(exchangeRecord,fieldSuggestions,simulationStore,templateEngine,fieldValues);
}

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: 18243
Project: 18243
Buggy source:
@Override public boolean canParse(OutMessage outMessage){
  return outMessage.getMessageContent().isJSONContent();
}

Fixed version (ground truth):
@Override public boolean canParse(OutMessage outMessage){
  logger.debug("String_Node_Str" + outMessage.getMessageContent().isJSONContent());
  return outMessage.getMessageContent().isJSONContent();
}
Program: 18244
Project: 18244
Buggy source:
@Override public HashMap<String,CandidateField> parse(OutMessage outMessage,HashMap<String,CandidateField> fieldMap){
  JSONObject jsonOutObject=(JSONObject)JSONSerializer.toJSON(outMessage.getMessageContent().getRawContent());
  findJSONOutFields("String_Node_Str",jsonOutObject,-1,fieldMap);
  return fieldMap;
}

Fixed version (ground truth):
@Override public HashMap<String,CandidateField> parse(OutMessage outMessage,HashMap<String,CandidateField> fieldMap){
  logger.debug("String_Node_Str");
  JSONObject jsonOutObject=(JSONObject)JSONSerializer.toJSON(outMessage.getMessageContent().getRawContent());
  findJSONOutFields("String_Node_Str",jsonOutObject,-1,fieldMap);
  return fieldMap;
}
Program: 18245
Project: 18245
Buggy source:
@Override public boolean canParse(OutMessage outMessage){
  return outMessage.getMessageContent().isXMLContent();
}

Fixed version (ground truth):
@Override public boolean canParse(OutMessage outMessage){
  logger.debug("String_Node_Str" + outMessage.getMessageContent().isXMLContent());
  return outMessage.getMessageContent().isXMLContent();
}
Program: 18246
Project: 18246
Buggy source:
@Override public HashMap<String,CandidateField> parse(OutMessage outMessage,HashMap<String,CandidateField> fieldMap){
  Document content=outMessage.getMessageContent().getXMLContent();
  NodeList nodeList=content.getElementsByTagName("String_Node_Str");
  if (nodeList.getLength() > 0) {
    for (int index=0; index < nodeList.getLength(); index++) {
      Node node=nodeList.item(index);
      if (node.hasChildNodes() && node.getChildNodes().getLength() == 1) {
        CandidateField field=new CandidateField(node.getNodeName(),node.getTextContent());
        fieldMap.put(node.getNodeName(),field);
      }
    }
  }
  return fieldMap;
}

Fixed version (ground truth):
@Override public HashMap<String,CandidateField> parse(OutMessage outMessage,HashMap<String,CandidateField> fieldMap){
  logger.debug("String_Node_Str");
  Document content=outMessage.getMessageContent().getXMLContent();
  return fieldMap;
}
Program: 18248
Project: 18248
Buggy source:
@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);
}

Fixed version (ground truth):
@Override public ExchangeRecord simulate(ExchangeRecord exchangeRecord,SimulationStore simulationStore,SimulationMethod method,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception {
  FieldExtractor extractor=new FieldExtractor();
  TemplateFieldSuggestions fieldSuggestions=correlationEngine.correlateWithSubpath(exchangeRecord,extractor.getInputPathParams(exchangeRecord.getInMessage()),extractor.getInputQueryParams(exchangeRecord.getInMessage()),extractor.getInputContentParam(exchangeRecord.getInMessage()),extractor.getOutputFields(exchangeRecord.getOutMessage()));
  templateEngine.generateTemplate(fieldSuggestions,exchangeRecord,simulationStore.getStoreName(),true);
  return method.simulate(exchangeRecord,fieldSuggestions,simulationStore,templateEngine,fieldValues);
}
Program: 18249
Project: 18249
Buggy source:
/** 
 * @param templateField
 * @return
 */
private boolean match(AbstractTemplateField inputField,AbstractTemplateField recordedField){
  boolean match=false;
  if (inputField.getFieldName().equals(recordedField.getFieldName()) && inputField.getDefaultValue().equals(recordedField.getDefaultValue()) && inputField.getFieldType().equals(recordedField.getFieldType())) {
    match=true;
  }
  return match;
}

Fixed version (ground truth):
/** 
 * @param templateField
 * @return
 */
private boolean match(AbstractTemplateField inputField,AbstractTemplateField recordedField){
  boolean match=false;
  if (recordedField.getFieldName().equals(inputField.getFieldName()) && recordedField.getDefaultValue().equals(inputField.getDefaultValue()) && recordedField.getFieldType().equals(inputField.getFieldType())) {
    match=true;
  }
  return match;
}
Program: 18250
Project: 18250
Buggy source:
@Override public HashMap<String,CandidateField> parse(OutMessage outMessage,HashMap<String,CandidateField> fieldMap){
  logger.debug("String_Node_Str");
  Document content=outMessage.getMessageContent().getXMLContent();
  return fieldMap;
}

Fixed version (ground truth):
@Override public HashMap<String,CandidateField> parse(OutMessage outMessage,HashMap<String,CandidateField> fieldMap){
  logger.debug("String_Node_Str");
  Document content=outMessage.getMessageContent().getXMLContent();
  NodeList nodeList=content.getElementsByTagName("String_Node_Str");
  if (nodeList.getLength() > 0) {
    for (int index=0; index < nodeList.getLength(); index++) {
      Node node=nodeList.item(index);
      if (node.hasChildNodes() && node.getChildNodes().getLength() == 1) {
        CandidateField field=new CandidateField(node.getNodeName(),node.getTextContent());
        fieldMap.put(node.getNodeName(),field);
      }
    }
  }
  return fieldMap;
}
Program: 18252
Project: 18252
Buggy source:
/** 
 * Constructor
 */
public HttpDiscoveryProxy(){
  try {
    propertyManager=new ProxyPropertyManager(ProxyPropertyManager.PROPERTY_FILE_NAME,this.getClass().getResourceAsStream("String_Node_Str" + ProxyPropertyManager.PROPERTY_FILE_NAME));
  }
 catch (  Exception ex) {
    logger.warn("String_Node_Str");
    try {
      propertyManager=new ProxyPropertyManager();
    }
 catch (    Exception exc) {
      logger.error("String_Node_Str",exc);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public HttpDiscoveryProxy(){
  try {
    propertyManager=new ProxyPropertyManager();
  }
 catch (  Exception ex) {
    logger.warn("String_Node_Str");
    try {
      propertyManager=new ProxyPropertyManager(ProxyPropertyManager.PROPERTY_FILE_NAME,this.getClass().getResourceAsStream("String_Node_Str" + ProxyPropertyManager.PROPERTY_FILE_NAME));
    }
 catch (    Exception exc) {
      logger.error("String_Node_Str",exc);
    }
  }
}
Program: 18253
Project: 18253
Buggy source:
/** 
 * Save the current run
 */
@POST @Path("String_Node_Str") public void save();

Fixed version (ground truth):
/** 
 * Save the current run
 * @throws Exception 
 */
@POST @Path("String_Node_Str") public void save() throws Exception ;
Program: 18254
Project: 18254
Buggy source:
/** 
 * Constructor
 */
public HttpProxyDriverImpl(){
  try {
    propertyManager=new ProxyPropertyManager(ProxyPropertyManager.PROPERTY_FILE_NAME,this.getClass().getResourceAsStream("String_Node_Str" + ProxyPropertyManager.PROPERTY_FILE_NAME));
  }
 catch (  Exception ex) {
    logger.warn("String_Node_Str");
    try {
      propertyManager=new ProxyPropertyManager();
    }
 catch (    Exception exc) {
      logger.error("String_Node_Str",exc);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 */
public HttpProxyDriverImpl(){
  try {
    propertyManager=new ProxyPropertyManager();
  }
 catch (  Exception ex) {
    logger.warn("String_Node_Str");
    try {
      propertyManager=new ProxyPropertyManager(ProxyPropertyManager.PROPERTY_FILE_NAME,this.getClass().getResourceAsStream("String_Node_Str" + ProxyPropertyManager.PROPERTY_FILE_NAME));
    }
 catch (    Exception exc) {
      logger.error("String_Node_Str",exc);
    }
  }
}
Program: 18255
Project: 18255
Buggy source:
public void save(){
}

Fixed version (ground truth):
public void save() throws Exception {
  runManager.save();
  runManager.getMonitoringService().registerDetectedServicesToNuxeo();
}
Program: 18256
Project: 18256
Buggy source:
public String stopCurrentRun(){
  logger.debug("String_Node_Str");
  try {
    runManager.stop();
    runManager.getMonitoringService().registerDetectedServicesToNuxeo();
  }
 catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    return ex.getMessage();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String stopCurrentRun(){
  logger.debug("String_Node_Str");
  try {
    runManager.stop();
  }
 catch (  Exception ex) {
    logger.error("String_Node_Str",ex);
    return ex.getMessage();
  }
  return "String_Node_Str";
}
Program: 18257
Project: 18257
Buggy source:
/** 
 * To replay a customized exchange record using template, field suggestions and assertions files generated before.
 * @param formData
 * @param exchangeStoreName
 * @param exchangeRecordID
 * @param templateName
 * @return
 * @throws Exception
 */
@Override public OutMessage replayWithTemplate(Map<String,List<String>> formData,String exchangeStoreName,String exchangeRecordID) throws Exception {
  ProxyFileStore proxyFileStore=new ProxyFileStore();
  ExchangeRecord record=proxyFileStore.loadExchangeRecord(exchangeStoreName,exchangeRecordID,true);
  TemplateFieldSuggestions fieldSuggestions=templateEngine.suggestFields(record,exchangeStoreName,true);
  templateEngine.generateTemplate(fieldSuggestions,record,exchangeStoreName,true);
  OutMessage replayedResponse=templateEngine.renderTemplateAndReplay(exchangeStoreName,record,formData);
  AssertionSuggestions assertionSuggestions=assertionEngine.suggestAssertions(fieldSuggestions,record.getExchange().getExchangeID(),exchangeStoreName);
  List<AssertionResult> assertionResults=assertionEngine.executeAssertions(assertionSuggestions,record.getOutMessage(),replayedResponse);
  if (replaySessionName != null) {
    AssertionReport report=(AssertionReport)logEngine.getLogSession(replaySessionName).getReport();
    if (report != null) {
      report.AddAssertionResult(assertionResults);
    }
  }
  return replayedResponse;
}

Fixed version (ground truth):
/** 
 * To replay a customized exchange record using template, field suggestions and assertions files generated before.
 * @param formData
 * @param exchangeStoreName
 * @param exchangeRecordID
 * @param templateName
 * @return
 * @throws Exception
 */
@Override public OutMessage replayWithTemplate(Map<String,List<String>> formData,String exchangeStoreName,String exchangeRecordID) throws Exception {
  ProxyFileStore proxyFileStore=new ProxyFileStore();
  ExchangeRecord record=proxyFileStore.loadExchangeRecord(exchangeStoreName,exchangeRecordID,true);
  TemplateFieldSuggestions fieldSuggestions=templateEngine.suggestFields(record,exchangeStoreName,true);
  templateEngine.generateTemplate(fieldSuggestions,record,exchangeStoreName,true);
  OutMessage replayedResponse=templateEngine.renderTemplateAndReplay(exchangeStoreName,record,formData,false);
  AssertionSuggestions assertionSuggestions=assertionEngine.suggestAssertions(fieldSuggestions,record.getExchange().getExchangeID(),exchangeStoreName);
  List<AssertionResult> assertionResults=assertionEngine.executeAssertions(assertionSuggestions,record.getOutMessage(),replayedResponse);
  if (replaySessionName != null) {
    AssertionReport report=(AssertionReport)logEngine.getLogSession(replaySessionName).getReport();
    if (report != null) {
      report.AddAssertionResult(assertionResults);
    }
  }
  return replayedResponse;
}
Program: 18258
Project: 18258
Buggy source:
@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);
}

Fixed version (ground truth):
@Override public ExchangeRecord simulate(ExchangeRecord exchangeRecord,SimulationStore simulationStore,SimulationMethod method,TemplateEngine templateEngine,Map<String,List<String>> fieldValues) throws Exception {
  FieldExtractor extractor=new FieldExtractor();
  TemplateFieldSuggestions fieldSuggestions=correlationEngine.correlateWithSubpath(exchangeRecord,extractor.getInputPathParams(exchangeRecord.getInMessage()),extractor.getInputQueryParams(exchangeRecord.getInMessage()),extractor.getInputContentParam(exchangeRecord.getInMessage()),extractor.getOutputFields(exchangeRecord.getOutMessage()));
  templateEngine.generateTemplate(fieldSuggestions,exchangeRecord,simulationStore.getStoreName(),true);
  return method.simulate(exchangeRecord,fieldSuggestions,simulationStore,templateEngine,fieldValues);
}
Program: 18259
Project: 18259
Buggy source:
/** 
 * @param templateField
 * @return
 */
private boolean match(AbstractTemplateField inputField,AbstractTemplateField recordedField){
  boolean match=false;
  if (inputField.getFieldName().equals(recordedField.getFieldName()) && inputField.getDefaultValue().equals(recordedField.getDefaultValue())) {
    match=true;
  }
  return match;
}

Fixed version (ground truth):
/** 
 * @param templateField
 * @return
 */
private boolean match(AbstractTemplateField inputField,AbstractTemplateField recordedField){
  boolean match=false;
  if (recordedField.getFieldName().equals(inputField.getFieldName()) && recordedField.getDefaultValue().equals(inputField.getDefaultValue()) && recordedField.getFieldType().equals(inputField.getFieldType())) {
    match=true;
  }
  return match;
}