nus-yam/ex-repair huggingface dataset:
Program: 120794
Project: 120794
Buggy source:
/** 
 * DOC ycbai Comment method "getJobScriptsUncompressed".
 * @param resource
 * @param process
 */
protected void getJobScriptsUncompressed(ExportFileResource resource,ProcessItem process){
  String projectName=getCorrespondingProjectName(process);
  List<String> jobFolderNames=getRelatedJobFolderNames(process);
  try {
    for (    String jobFolderName : jobFolderNames) {
      String classRoot=getClassRootLocation() + projectName + File.separator+ jobFolderName;
      String targetPath=getTmpFolder() + File.separator + projectName+ File.separator+ jobFolderName;
      File sourceFile=new File(classRoot);
      File targetFile=new File(targetPath);
      FilesUtils.copyFolder(sourceFile,targetFile,true,null,null,true,false);
      List<URL> fileURLs=FilesUtils.getFileURLs(targetFile);
      for (      URL url : fileURLs) {
        String path=url.getPath();
        String relPath=path.replace(getTmpFolder().replace("String_Node_Str","String_Node_Str"),"String_Node_Str");
        relPath=relPath.substring(0,relPath.lastIndexOf("String_Node_Str"));
        resource.addResource(relPath,url);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "getJobScriptsUncompressed".
 * @param resource
 * @param process
 */
protected void getJobScriptsUncompressed(ExportFileResource resource,ProcessItem process){
  final URI classRootURI=classesLocation.toURI();
  List<String> jobFolderNames=getRelatedJobFolderNames(process);
  try {
    for (    String jobFolderName : jobFolderNames) {
      String[] jf=jobFolderName.split("String_Node_Str");
      String projectName=jf[0];
      String folderName=jf[1];
      String classRootLocation=getClassRootLocation() + projectName + File.separator;
      String classRoot=classRootLocation + folderName;
      String targetPath=classesLocation + File.separator + projectName+ File.separator+ folderName;
      File sourceFile=new File(classRoot);
      File targetFile=new File(targetPath);
      FilesUtils.copyFolder(sourceFile,targetFile,true,null,null,true,false);
      List<URL> fileURLs=FilesUtils.getFileURLs(targetFile);
      for (      URL url : fileURLs) {
        resource.addResource(classRootURI.relativize(new File(url.toURI()).getParentFile().toURI()).toString(),url);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}
Program: 120795
Project: 120795
Buggy source:
protected List<String> getRelatedJobFolderNames(ProcessItem process,boolean includeSelf){
  List<String> jobFolderNames=new ArrayList<String>();
  if (includeSelf) {
    String jobName=process.getProperty().getLabel();
    String jobVersion=process.getProperty().getVersion();
    String jobFolderName=JavaResourcesHelper.getJobFolderName(jobName,jobVersion);
    jobFolderNames.add(jobFolderName);
  }
  Set<JobInfo> subjobInfos=ProcessorUtilities.getChildrenJobInfo(process);
  for (  JobInfo subjobInfo : subjobInfos) {
    jobFolderNames.addAll(getRelatedJobFolderNames(subjobInfo.getProcessItem(),true));
  }
  return jobFolderNames;
}

Fixed version (ground truth):
protected List<String> getRelatedJobFolderNames(ProcessItem process,Set<String> jobNameVersionChecked){
  List<String> jobFolderNames=new ArrayList<String>();
  String projectName=getCorrespondingProjectName(process);
  String jobName=process.getProperty().getLabel();
  String jobVersion=process.getProperty().getVersion();
  String id=projectName + "String_Node_Str" + jobName+ "String_Node_Str"+ jobVersion;
  if (jobNameVersionChecked.contains(id)) {
    return jobFolderNames;
  }
  jobNameVersionChecked.add(id);
  String jobFolderName=JavaResourcesHelper.getJobFolderName(jobName,jobVersion);
  jobFolderNames.add(projectName + "String_Node_Str" + jobFolderName);
  Set<JobInfo> subjobInfos=ProcessorUtilities.getChildrenJobInfo(process);
  for (  JobInfo subjobInfo : subjobInfos) {
    jobFolderNames.addAll(getRelatedJobFolderNames(subjobInfo.getProcessItem(),jobNameVersionChecked));
  }
  return jobFolderNames;
}
Program: 120797
Project: 120797
Buggy source:
public OnRowsEndCode(){
  count=0;
  buffer=new StringBuffer();
}

Fixed version (ground truth):
public OnRowsEndCode(){
  count=0;
}
Program: 120798
Project: 120798
Buggy source:
public void clear(){
  count=0;
  buffer.delete(0,buffer.length());
}

Fixed version (ground truth):
public void clear(){
  count=0;
  bufferList.clear();
}
Program: 120799
Project: 120799
Buggy source:
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  CSVReader rdr=new CSVReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId));
  List<String> resultHeader=rdr.nextRecord();
  int resultCols=resultHeader.size();
  List<String> row;
  while ((row=rdr.nextRecord()) != null) {
    resultInfo=new HashMap<String,String>();
    for (int i=0; i < resultCols; i++) {
      resultInfo.put(resultHeader.get(i),row.get(i));
    }
    resultInfoList.add(resultInfo);
  }
  return resultInfoList;
}

Fixed version (ground truth):
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  baseFileReader=new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId),FILE_ENCODING)),',');
  if (baseFileReader.readNext()) {
    baseFileHeader=Arrays.asList(baseFileReader.getValues());
  }
  baseFileHeaderSize=baseFileHeader.size();
  String[] row;
  while (baseFileReader.readNext()) {
    if ((row=baseFileReader.getValues()) != null) {
      resultInfo=new HashMap<String,String>();
      for (int i=0; i < baseFileHeaderSize; i++) {
        resultInfo.put(baseFileHeader.get(i),row[i]);
      }
      resultInfoList.add(resultInfo);
    }
  }
  return resultInfoList;
}
Program: 120800
Project: 120800
Buggy source:
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  baseFileReader=new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId),FILE_ENCODING)),',');
  if (baseFileReader.readNext()) {
    baseFileHeader=Arrays.asList(baseFileReader.getValues());
  }
  baseFileHeaderSize=baseFileHeader.size();
  String[] row;
  while (baseFileReader.readNext()) {
    if ((row=baseFileReader.getValues()) != null) {
      resultInfo=new HashMap<String,String>();
      for (int i=0; i < baseFileHeaderSize; i++) {
        resultInfo.put(baseFileHeader.get(i),row[i]);
      }
      resultInfoList.add(resultInfo);
    }
  }
  return resultInfoList;
}

Fixed version (ground truth):
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  baseFileReader=new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId),FILE_ENCODING)),',');
  if (baseFileReader.readNext()) {
    baseFileHeader=Arrays.asList(baseFileReader.getValues());
  }
  baseFileHeaderSize=baseFileHeader.size();
  String[] row;
  while (baseFileReader.readNext()) {
    if ((row=baseFileReader.getValues()) != null) {
      resultInfo=new HashMap<String,String>();
      for (int i=0; i < baseFileHeaderSize; i++) {
        resultInfo.put(baseFileHeader.get(i),row[i]);
      }
      resultInfoList.add(resultInfo);
    }
  }
  closeFileRead();
  return resultInfoList;
}
Program: 120802
Project: 120802
Buggy source:
public OnRowsEndCode(){
  count=0;
  buffer=new StringBuffer();
}

Fixed version (ground truth):
public OnRowsEndCode(){
  count=0;
}
Program: 120803
Project: 120803
Buggy source:
public void clear(){
  count=0;
  buffer.delete(0,buffer.length());
}

Fixed version (ground truth):
public void clear(){
  count=0;
  bufferList.clear();
}
Program: 120804
Project: 120804
Buggy source:
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  baseFileReader=new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId),FILE_ENCODING)),',');
  if (baseFileReader.readNext()) {
    baseFileHeader=Arrays.asList(baseFileReader.getValues());
  }
  baseFileHeaderSize=baseFileHeader.size();
  String[] row;
  while (baseFileReader.readNext()) {
    if ((row=baseFileReader.getValues()) != null) {
      resultInfo=new HashMap<String,String>();
      for (int i=0; i < baseFileHeaderSize; i++) {
        resultInfo.put(baseFileHeader.get(i),row[i]);
      }
      resultInfoList.add(resultInfo);
    }
  }
  return resultInfoList;
}

Fixed version (ground truth):
public List<Map<String,String>> getQueryResult(String resultId) throws AsyncApiException, IOException {
  List<Map<String,String>> resultInfoList=new ArrayList<Map<String,String>>();
  Map<String,String> resultInfo;
  baseFileReader=new com.talend.csv.CSVReader(new java.io.BufferedReader(new java.io.InputStreamReader(connection.getQueryResultStream(job.getId(),batchInfoList.get(0).getId(),resultId),FILE_ENCODING)),',');
  if (baseFileReader.readNext()) {
    baseFileHeader=Arrays.asList(baseFileReader.getValues());
  }
  baseFileHeaderSize=baseFileHeader.size();
  String[] row;
  while (baseFileReader.readNext()) {
    if ((row=baseFileReader.getValues()) != null) {
      resultInfo=new HashMap<String,String>();
      for (int i=0; i < baseFileHeaderSize; i++) {
        resultInfo.put(baseFileHeader.get(i),row[i]);
      }
      resultInfoList.add(resultInfo);
    }
  }
  closeFileRead();
  return resultInfoList;
}
Program: 120805
Project: 120805
Buggy source:
public String getColumnText(Object element,int columnIndex){
  if (element instanceof ParameterInfo) {
    ParameterInfo para=(ParameterInfo)element;
    if (columnIndex == 0) {
      if (para.getArraySize() != 0) {
        int size=para.getArraySize();
        if (size == -1) {
          return para.getName() + "String_Node_Str" + "String_Node_Str";
        }
 else {
          return para.getName() + "String_Node_Str" + size+ "String_Node_Str";
        }
      }
 else       if (para.getParameterInfos().size() > 0) {
        return para.getName() + "String_Node_Str";
      }
 else {
        return para.getName();
      }
    }
 else     if (columnIndex == 1) {
      if (para.getArraySize() != 0) {
        return para.getIndex() == null ? "String_Node_Str" : para.getIndex();
      }
 else       if (para.getParameterInfos().size() > 1) {
        String index=para.getIndex() == null ? "String_Node_Str" : para.getIndex();
        para.setArraySize(-1);
        para.setIndex("String_Node_Str");
        return index;
      }
 else {
        return null;
      }
    }
  }
  return super.getText(element);
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  if (element instanceof ParameterInfo) {
    ParameterInfo para=(ParameterInfo)element;
    if (columnIndex == 0) {
      if (para.getArraySize() != 0) {
        int size=para.getArraySize();
        if (size == -1) {
          return para.getName() + "String_Node_Str" + "String_Node_Str";
        }
 else {
          return para.getName() + "String_Node_Str" + size+ "String_Node_Str";
        }
      }
 else       if (para.getParameterInfos().size() > 0) {
        return para.getName() + "String_Node_Str";
      }
 else {
        return para.getName();
      }
    }
 else     if (columnIndex == 1) {
      if (para.getArraySize() != 0) {
        return para.getIndex() == null ? "String_Node_Str" : para.getIndex();
      }
 else {
        return null;
      }
    }
  }
  return super.getText(element);
}
Program: 120808
Project: 120808
Buggy source:
public void initCategoryCombo(){
  if (categoryCombo.getItemCount() > 0) {
    return;
  }
  for (  Category category : fCategorys) {
    categoryCombo.add(category.getCategoryName());
  }
  categoryCombo.select(0);
  categoryCombo.pack();
}

Fixed version (ground truth):
public void initCategoryCombo(){
  if (categoryCombo.getItemCount() > 0) {
    return;
  }
  for (  Category category : fCategorys) {
    if ("String_Node_Str".equals(category.getCategoryName()) || "String_Node_Str".equals(category.getCategoryName())) {
      continue;
    }
    categoryCombo.add(category.getCategoryName());
  }
  categoryCombo.select(0);
  categoryCombo.pack();
}
Program: 120810
Project: 120810
Buggy source:
@Override public void execute(){
  setParallelization(this.node);
  if (!parallelForCon) {
    MessageDialog.openInformation(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void execute(){
  setParallelization(this.node);
  if (!isExistParallel) {
    MessageDialog.openInformation(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
}
Program: 120811
Project: 120811
Buggy source:
public String getColumnText(Object element,int columnIndex){
  if (element instanceof ParameterInfo) {
    ParameterInfo para=(ParameterInfo)element;
    if (columnIndex == 0) {
      if (para.getArraySize() != 0) {
        int size=para.getArraySize();
        if (size == -1) {
          return para.getName() + "String_Node_Str" + "String_Node_Str";
        }
 else {
          return para.getName() + "String_Node_Str" + size+ "String_Node_Str";
        }
      }
 else       if (para.getParameterInfos().size() > 0) {
        return para.getName() + "String_Node_Str";
      }
 else {
        return para.getName();
      }
    }
 else     if (columnIndex == 1) {
      if (para.getArraySize() != 0) {
        return para.getIndex() == null ? "String_Node_Str" : para.getIndex();
      }
 else       if (para.getParameterInfos().size() > 1) {
        String index=para.getIndex() == null ? "String_Node_Str" : para.getIndex();
        para.setArraySize(-1);
        para.setIndex("String_Node_Str");
        return index;
      }
 else {
        return null;
      }
    }
  }
  return super.getText(element);
}

Fixed version (ground truth):
public String getColumnText(Object element,int columnIndex){
  if (element instanceof ParameterInfo) {
    ParameterInfo para=(ParameterInfo)element;
    if (columnIndex == 0) {
      if (para.getArraySize() != 0) {
        int size=para.getArraySize();
        if (size == -1) {
          return para.getName() + "String_Node_Str" + "String_Node_Str";
        }
 else {
          return para.getName() + "String_Node_Str" + size+ "String_Node_Str";
        }
      }
 else       if (para.getParameterInfos().size() > 0) {
        return para.getName() + "String_Node_Str";
      }
 else {
        return para.getName();
      }
    }
 else     if (columnIndex == 1) {
      if (para.getArraySize() != 0) {
        return para.getIndex() == null ? "String_Node_Str" : para.getIndex();
      }
 else {
        return null;
      }
    }
  }
  return super.getText(element);
}
Program: 120814
Project: 120814
Buggy source:
public static IConnection getPreviousParCon(Node previousNode){
  IConnection previousCon=null;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true)) || (con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
        previousCon=con;
        break;
      }
 else {
        previousCon=getPreviousParCon((Node)con.getSource());
      }
    }
  }
  return previousCon;
}

Fixed version (ground truth):
public static IConnection getPreviousParCon(Node previousNode){
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true)) || (con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
        return con;
      }
 else {
        return getPreviousParCon((Node)con.getSource());
      }
    }
  }
  return null;
}
Program: 120816
Project: 120816
Buggy source:
@Override public void execute(){
  setParallelization(this.node);
  if (!parallelForCon) {
    MessageDialog.openInformation(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void execute(){
  setParallelization(this.node);
  if (!isExistParallel) {
    MessageDialog.openInformation(new Shell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
  }
}
Program: 120819
Project: 120819
Buggy source:
private void getConnFromNode(){
  DriverShim wapperDriver=null;
  try {
    List list=null;
    if (dbType.equals(EDatabaseTypeName.GENERAL_JDBC.getDisplayName())) {
      list=ExtractMetaDataUtils.connect(trueDBTypeForJDBC,url,username,pwd,driverClassName,driverJarPath,dbVersion,additionalParams);
    }
 else {
      driverJarPath="String_Node_Str";
      list=ExtractMetaDataUtils.connect(dbType,url,username,pwd,driverClassName,driverJarPath,dbVersion,additionalParams);
    }
    if (list != null && list.size() > 0) {
      for (int i=0; i < list.size(); i++) {
        if (list.get(i) instanceof Connection) {
          conn=(Connection)list.get(i);
        }
        if (list.get(i) instanceof DriverShim) {
          wapperDriver=(DriverShim)list.get(i);
        }
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    if ((driverClassName.equals(EDatabase4DriverClassName.JAVADB_EMBEDED.getDriverClass()) || dbType.equals(EDatabaseTypeName.JAVADB_EMBEDED.getDisplayName()) || dbType.equals(EDatabaseTypeName.JAVADB_DERBYCLIENT.getDisplayName())|| dbType.equals(EDatabaseTypeName.JAVADB_JCCJDBC.getDisplayName())|| dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName())|| dbType.equals(EDatabaseTypeName.GENERAL_JDBC.getDisplayName())) && wapperDriver != null) {
      try {
        if (conn != null && !conn.isClosed() && (dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName()) || dbType.equals(EDatabaseTypeName.JAVADB_EMBEDED.getDisplayName()))) {
          conn.close();
        }
        wapperDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void getConnFromNode(){
  DriverShim wapperDriver=null;
  try {
    List list=null;
    if (dbType.equals(EDatabaseTypeName.GENERAL_JDBC.getDisplayName())) {
      list=ExtractMetaDataUtils.connect(trueDBTypeForJDBC,url,username,pwd,driverClassName,driverJarPath,dbVersion,additionalParams);
    }
 else {
      driverJarPath="String_Node_Str";
      list=ExtractMetaDataUtils.connect(dbType,url,username,pwd,driverClassName,driverJarPath,dbVersion,additionalParams);
    }
    if (list != null && list.size() > 0) {
      for (int i=0; i < list.size(); i++) {
        if (list.get(i) instanceof Connection) {
          conn=(Connection)list.get(i);
        }
        if (list.get(i) instanceof DriverShim) {
          wapperDriver=(DriverShim)list.get(i);
        }
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    if ((driverClassName.equals(EDatabase4DriverClassName.JAVADB_EMBEDED.getDriverClass()) || isJavaDB() || dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName())|| dbType.equals(EDatabaseTypeName.GENERAL_JDBC.getDisplayName())) && wapperDriver != null) {
      try {
        if (conn != null && !conn.isClosed()) {
          conn.close();
        }
        if (isJavaDB()) {
          wapperDriver.connect("String_Node_Str",null);
        }
      }
 catch (      SQLException e) {
      }
    }
  }
}
Program: 120822
Project: 120822
Buggy source:
public static IConnection getPreviousParCon(Node previousNode){
  IConnection previousCon=null;
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true)) || (con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
        previousCon=con;
        break;
      }
 else {
        previousCon=getPreviousParCon((Node)con.getSource());
      }
    }
  }
  return previousCon;
}

Fixed version (ground truth):
public static IConnection getPreviousParCon(Node previousNode){
  if (previousNode.getIncomingConnections().size() > 0) {
    for (    IConnection con : previousNode.getIncomingConnections()) {
      if ((con.getElementParameter(EParameterName.PARTITIONER.getName()) != null && con.getElementParameter(EParameterName.PARTITIONER.getName()).getValue().equals(true)) || (con.getElementParameter(EParameterName.REPARTITIONER.getName()) != null && con.getElementParameter(EParameterName.REPARTITIONER.getName()).getValue().equals(true))) {
        return con;
      }
 else {
        return getPreviousParCon((Node)con.getSource());
      }
    }
  }
  return null;
}
Program: 120824
Project: 120824
Buggy source:
public void clearBlocked(){
  Dialog.getBlockedHandler().clearBlocked();
}

Fixed version (ground truth):
public void clearBlocked(){
  if (CommonUIPlugin.isFullyHeadless()) {
    return;
  }
  final Display disp=DisplayUtils.getDisplay();
  disp.syncExec(new Runnable(){
    @Override public void run(){
      Dialog.getBlockedHandler().clearBlocked();
    }
  }
);
}
Program: 120825
Project: 120825
Buggy source:
public void setBlocked(IStatus reason){
}

Fixed version (ground truth):
public void setBlocked(final IStatus reason){
  if (CommonUIPlugin.isFullyHeadless()) {
    return;
  }
  final Display disp=DisplayUtils.getDisplay();
  disp.syncExec(new Runnable(){
    @Override public void run(){
      Dialog.getBlockedHandler().showBlocked(CodeGeneratorProgressMonitor.this,reason,taskName);
    }
  }
);
}
Program: 120827
Project: 120827
Buggy source:
private void computeProperty(ResourcesManager manager,ItemRecord itemRecord){
  InputStream stream=null;
  try {
    stream=manager.getStream(itemRecord.getPath());
    final Resource resource=createResource(itemRecord,itemRecord.getPath(),false);
    URIConverter uriConverter=resource.getResourceSet().getURIConverter();
    resource.getResourceSet().setURIConverter(new ExtensibleURIConverterImpl(){
      @Override public InputStream createInputStream(      URI uri,      Map<?,?> options) throws IOException {
        InputStream inputStream=null;
        EPackage ePackage=resource.getResourceSet().getPackageRegistry().getEPackage(uri.toString());
        if (ePackage != null || !"String_Node_Str".equals(uri.scheme())) {
          inputStream=super.createInputStream(uri,options);
        }
 else {
          inputStream=null;
        }
        return inputStream;
      }
    }
);
    EmfHelper.loadResource(resource,stream,null);
    resource.getResourceSet().setURIConverter(uriConverter);
    itemRecord.setProperty((Property)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProperty()));
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void computeProperty(ResourcesManager manager,ItemRecord itemRecord){
  InputStream stream=null;
  try {
    stream=manager.getStream(itemRecord.getPath());
    final Resource resource=createResource(itemRecord,itemRecord.getPath(),false);
    URIConverter uriConverter=resource.getResourceSet().getURIConverter();
    resource.getResourceSet().setURIConverter(new ExtensibleURIConverterImpl(){
      @Override public InputStream createInputStream(      URI uri,      Map<?,?> options) throws IOException {
        InputStream inputStream=null;
        EPackage ePackage=resource.getResourceSet().getPackageRegistry().getEPackage(uri.toString());
        if (ePackage != null || !"String_Node_Str".equals(uri.scheme())) {
          inputStream=super.createInputStream(uri,options);
        }
 else {
          inputStream=null;
        }
        return inputStream;
      }
    }
);
    EmfHelper.loadResource(resource,stream,null);
    resource.getResourceSet().setURIConverter(uriConverter);
    itemRecord.setProperty((Property)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProperty()));
  }
 catch (  Exception e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 120829
Project: 120829
Buggy source:
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode node : jobletService.getGraphNodesForJoblet(this)) {
          if (("String_Node_Str").equals(node.getUniqueName())) {
            continue;
          }
          String componentName=node.getComponent().getName();
          if (componentName != null && componentName.equals(TPREJOB_STR)) {
            if (!multiNodes.containsKey(TPREJOB_STR)) {
              multiNodes.put(TPREJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPREJOB_STR);
              Problems.add(ProblemStatus.WARNING,this,errorMessage);
            }
          }
          if (componentName != null && componentName.equals(TPOSTJOB_STR)) {
            if (!multiNodes.containsKey(TPOSTJOB_STR)) {
              multiNodes.put(TPOSTJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPOSTJOB_STR);
              Problems.add(ProblemStatus.WARNING,this,errorMessage);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode proGraphicNode : process.getGraphicalNodes()) {
          boolean jobletComponent=jobletService.isJobletComponent(proGraphicNode);
          if (jobletComponent) {
            for (            INode node : jobletService.getGraphNodesForJoblet(proGraphicNode)) {
              if (("String_Node_Str").equals(node.getUniqueName())) {
                continue;
              }
              checktPreOrPost(multiNodes,node);
            }
          }
 else {
            if (("String_Node_Str").equals(proGraphicNode.getUniqueName())) {
              continue;
            }
            checktPreOrPost(multiNodes,proGraphicNode);
          }
        }
      }
    }
  }
}
Program: 120830
Project: 120830
Buggy source:
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode node : jobletService.getGraphNodesForJoblet(this)) {
          if (("String_Node_Str").equals(node.getUniqueName())) {
            continue;
          }
          String componentName=node.getComponent().getName();
          if (componentName != null && componentName.equals(TPREJOB_STR)) {
            if (!multiNodes.containsKey(TPREJOB_STR)) {
              multiNodes.put(TPREJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPREJOB_STR);
              Problems.add(ProblemStatus.WARNING,this,errorMessage);
            }
          }
          if (componentName != null && componentName.equals(TPOSTJOB_STR)) {
            if (!multiNodes.containsKey(TPOSTJOB_STR)) {
              multiNodes.put(TPOSTJOB_STR,node);
            }
 else {
              String errorMessage=Messages.getString("String_Node_Str",TPOSTJOB_STR);
              Problems.add(ProblemStatus.WARNING,this,errorMessage);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC hcyi Comment method "checkHasMultiPrejobOrPostJobComponents".
 */
private void checkHasMultiPrejobOrPostJobComponents(){
  if (PluginChecker.isJobLetPluginLoaded()) {
    IJobletProviderService jobletService=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
    if (jobletService != null) {
      if (jobletService.isJobletComponent(this)) {
        Map<String,INode> multiNodes=new HashMap<String,INode>();
        for (        INode proGraphicNode : process.getGraphicalNodes()) {
          boolean jobletComponent=jobletService.isJobletComponent(proGraphicNode);
          if (jobletComponent) {
            for (            INode node : jobletService.getGraphNodesForJoblet(proGraphicNode)) {
              if (("String_Node_Str").equals(node.getUniqueName())) {
                continue;
              }
              checktPreOrPost(multiNodes,node);
            }
          }
 else {
            if (("String_Node_Str").equals(proGraphicNode.getUniqueName())) {
              continue;
            }
            checktPreOrPost(multiNodes,proGraphicNode);
          }
        }
      }
    }
  }
}
Program: 120831
Project: 120831
Buggy source:
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    String extensionName=tm.getType().getName();
    String parentDisplayName=tm.getDisplayName();
    int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
    parentName=parentDisplayName.substring(0,extensionIndex - 1);
  }
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ TalendTextUtils.LBRACKET+ this.primitive.getName()+ TalendTextUtils.RBRACKET;
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    Type type=tm.getType();
    String parentDisplayName=tm.getDisplayName();
    parentName=parentDisplayName;
    if (type != null) {
      String extensionName=type.getName();
      int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
      parentName=parentDisplayName.substring(0,extensionIndex - 1);
    }
  }
  String typeDispaly=primitive == null ? "String_Node_Str" : TalendTextUtils.LBRACKET + this.primitive.getName() + TalendTextUtils.RBRACKET;
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ typeDispaly;
}
Program: 120832
Project: 120832
Buggy source:
protected void generateDisplayName(){
  this.displayName=seg.getName();
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  this.displayName=seg.getName();
}
Program: 120833
Project: 120833
Buggy source:
private void generateDataTypes(){
  int number=this.seg.numFields();
  ArrayList<TypeModel> datatypes=new ArrayList<TypeModel>();
  for (int i=1; i < number; i++) {
    try {
      Type[] reps=seg.getField(i);
      for (int j=0; j < reps.length; j++) {
        TypeModel tm=new TypeModel(reps[j],seg,j,i);
        datatypes.add(tm);
      }
    }
 catch (    HL7Exception e) {
      e.printStackTrace();
    }
  }
  this.types=datatypes.toArray(new TypeModel[0]);
}

Fixed version (ground truth):
private void generateDataTypes(){
  int number=this.seg.numFields();
  ArrayList<TypeModel> datatypes=new ArrayList<TypeModel>();
  try {
    int lastNotEmptyFiledIndex=0;
    for (int i=1; i < number; i++) {
      Type[] reps=seg.getField(i);
      if (reps.length > 0) {
        lastNotEmptyFiledIndex=i;
      }
    }
    for (int i=1; i <= lastNotEmptyFiledIndex; i++) {
      Type[] reps=seg.getField(i);
      if (reps.length > 0) {
        for (int j=0; j < reps.length; j++) {
          TypeModel tm=new TypeModel(reps[j],seg,j,i);
          datatypes.add(tm);
        }
      }
 else {
        TypeModel tm=new TypeModel(null,seg,0,i);
        datatypes.add(tm);
      }
    }
  }
 catch (  HL7Exception e) {
    e.printStackTrace();
  }
  this.types=datatypes.toArray(new TypeModel[0]);
}
Program: 120834
Project: 120834
Buggy source:
protected void generateDisplayName(){
  this.displayName=getParent().getName() + "String_Node_Str" + index+ "String_Node_Str"+ (++rep)+ "String_Node_Str"+ TalendTextUtils.LBRACKET+ type.getName()+ TalendTextUtils.RBRACKET;
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  String typeDispaly=type == null ? "String_Node_Str" : TalendTextUtils.LBRACKET + this.type.getName() + TalendTextUtils.RBRACKET;
  this.displayName=getParent().getName() + "String_Node_Str" + index+ "String_Node_Str"+ (++rep)+ "String_Node_Str"+ typeDispaly;
}
Program: 120835
Project: 120835
Buggy source:
private void generatePrimitive(){
  List<PrimitiveModel> pms=new ArrayList<PrimitiveModel>();
  int numComp=Terser.numComponents(this.type);
  for (int k=1; k <= numComp; k++) {
    int numSubComp=Terser.numSubComponents(this.type,k);
    for (int m=1; m <= numSubComp; m++) {
      Primitive p=getPrimitive(this.type,k,m);
      if (p.getValue() != null) {
        PrimitiveModel pm=new PrimitiveModel(this,p,k,m);
        pms.add(pm);
      }
    }
  }
  primitives=pms.toArray(new PrimitiveModel[0]);
}

Fixed version (ground truth):
private void generatePrimitive(){
  if (type != null) {
    List<PrimitiveModel> pms=new ArrayList<PrimitiveModel>();
    int numComp=Terser.numComponents(this.type);
    for (int k=1; k <= numComp; k++) {
      int numSubComp=Terser.numSubComponents(this.type,k);
      for (int m=1; m <= numSubComp; m++) {
        Primitive p=getPrimitive(this.type,k,m);
        if (p.getValue() != null) {
          PrimitiveModel pm=new PrimitiveModel(this,p,k,m);
          pms.add(pm);
        }
      }
    }
    primitives=pms.toArray(new PrimitiveModel[0]);
  }
 else {
    PrimitiveModel pm=new PrimitiveModel(this,null,1,1);
    primitives=new PrimitiveModel[]{pm};
  }
}
Program: 120836
Project: 120836
Buggy source:
private Type getComponent(Type type,int comp){
  Type ret=null;
  if (Varies.class.isAssignableFrom(type.getClass())) {
    Varies v=(Varies)type;
    try {
      if (comp > 1 && GenericPrimitive.class.isAssignableFrom(v.getData().getClass()))       v.setData(new GenericComposite(v.getMessage()));
    }
 catch (    DataTypeException de) {
      String message="String_Node_Str" + de.getMessage();
      throw new Error(message);
    }
    ret=getComponent(v.getData(),comp);
  }
 else {
    if (Primitive.class.isAssignableFrom(type.getClass()) && comp == 1) {
      ret=type;
    }
 else     if (GenericComposite.class.isAssignableFrom(type.getClass()) || (Composite.class.isAssignableFrom(type.getClass()) && comp <= numStandardComponents(type))) {
      try {
        ret=((Composite)type).getComponent(comp - 1);
      }
 catch (      Exception e) {
        throw new Error("String_Node_Str",e);
      }
    }
 else {
      ret=type.getExtraComponents().getComponent(comp - numStandardComponents(type) - 1);
    }
  }
  return ret;
}

Fixed version (ground truth):
private Type getComponent(Type type,int comp){
  Type ret=null;
  if (Varies.class.isAssignableFrom(type.getClass())) {
    Varies v=(Varies)type;
    try {
      if (comp > 1 && GenericPrimitive.class.isAssignableFrom(v.getData().getClass())) {
        v.setData(new GenericComposite(v.getMessage()));
      }
    }
 catch (    DataTypeException de) {
      String message="String_Node_Str" + de.getMessage();
      throw new Error(message);
    }
    ret=getComponent(v.getData(),comp);
  }
 else {
    if (Primitive.class.isAssignableFrom(type.getClass()) && comp == 1) {
      ret=type;
    }
 else     if (GenericComposite.class.isAssignableFrom(type.getClass()) || (Composite.class.isAssignableFrom(type.getClass()) && comp <= numStandardComponents(type))) {
      try {
        ret=((Composite)type).getComponent(comp - 1);
      }
 catch (      Exception e) {
        throw new Error("String_Node_Str",e);
      }
    }
 else {
      ret=type.getExtraComponents().getComponent(comp - numStandardComponents(type) - 1);
    }
  }
  return ret;
}
Program: 120838
Project: 120838
Buggy source:
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    String extensionName=tm.getType().getName();
    String parentDisplayName=tm.getDisplayName();
    int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
    parentName=parentDisplayName.substring(0,extensionIndex - 1);
  }
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ TalendTextUtils.LBRACKET+ this.primitive.getName()+ TalendTextUtils.RBRACKET;
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    Type type=tm.getType();
    String parentDisplayName=tm.getDisplayName();
    parentName=parentDisplayName;
    if (type != null) {
      String extensionName=type.getName();
      int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
      parentName=parentDisplayName.substring(0,extensionIndex - 1);
    }
  }
  String typeDispaly=primitive == null ? "String_Node_Str" : TalendTextUtils.LBRACKET + this.primitive.getName() + TalendTextUtils.RBRACKET;
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ typeDispaly;
}
Program: 120839
Project: 120839
Buggy source:
protected void generateDisplayName(){
  this.displayName=seg.getName();
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  this.displayName=seg.getName();
}
Program: 120840
Project: 120840
Buggy source:
private void generateDataTypes(){
  int number=this.seg.numFields();
  ArrayList<TypeModel> datatypes=new ArrayList<TypeModel>();
  for (int i=1; i < number; i++) {
    try {
      Type[] reps=seg.getField(i);
      for (int j=0; j < reps.length; j++) {
        TypeModel tm=new TypeModel(reps[j],seg,j,i);
        datatypes.add(tm);
      }
    }
 catch (    HL7Exception e) {
      e.printStackTrace();
    }
  }
  this.types=datatypes.toArray(new TypeModel[0]);
}

Fixed version (ground truth):
private void generateDataTypes(){
  int number=this.seg.numFields();
  ArrayList<TypeModel> datatypes=new ArrayList<TypeModel>();
  try {
    int lastNotEmptyFiledIndex=0;
    for (int i=1; i < number; i++) {
      Type[] reps=seg.getField(i);
      if (reps.length > 0) {
        lastNotEmptyFiledIndex=i;
      }
    }
    for (int i=1; i <= lastNotEmptyFiledIndex; i++) {
      Type[] reps=seg.getField(i);
      if (reps.length > 0) {
        for (int j=0; j < reps.length; j++) {
          TypeModel tm=new TypeModel(reps[j],seg,j,i);
          datatypes.add(tm);
        }
      }
 else {
        TypeModel tm=new TypeModel(null,seg,0,i);
        datatypes.add(tm);
      }
    }
  }
 catch (  HL7Exception e) {
    e.printStackTrace();
  }
  this.types=datatypes.toArray(new TypeModel[0]);
}
Program: 120841
Project: 120841
Buggy source:
protected void generateDisplayName(){
  this.displayName=getParent().getName() + "String_Node_Str" + index+ "String_Node_Str"+ (++rep)+ "String_Node_Str"+ TalendTextUtils.LBRACKET+ type.getName()+ TalendTextUtils.RBRACKET;
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  String typeDispaly=type == null ? "String_Node_Str" : TalendTextUtils.LBRACKET + this.type.getName() + TalendTextUtils.RBRACKET;
  this.displayName=getParent().getName() + "String_Node_Str" + index+ "String_Node_Str"+ (++rep)+ "String_Node_Str"+ typeDispaly;
}
Program: 120842
Project: 120842
Buggy source:
private void generatePrimitive(){
  List<PrimitiveModel> pms=new ArrayList<PrimitiveModel>();
  int numComp=Terser.numComponents(this.type);
  for (int k=1; k <= numComp; k++) {
    int numSubComp=Terser.numSubComponents(this.type,k);
    for (int m=1; m <= numSubComp; m++) {
      Primitive p=getPrimitive(this.type,k,m);
      if (p.getValue() != null) {
        PrimitiveModel pm=new PrimitiveModel(this,p,k,m);
        pms.add(pm);
      }
    }
  }
  primitives=pms.toArray(new PrimitiveModel[0]);
}

Fixed version (ground truth):
private void generatePrimitive(){
  if (type != null) {
    List<PrimitiveModel> pms=new ArrayList<PrimitiveModel>();
    int numComp=Terser.numComponents(this.type);
    for (int k=1; k <= numComp; k++) {
      int numSubComp=Terser.numSubComponents(this.type,k);
      for (int m=1; m <= numSubComp; m++) {
        Primitive p=getPrimitive(this.type,k,m);
        if (p.getValue() != null) {
          PrimitiveModel pm=new PrimitiveModel(this,p,k,m);
          pms.add(pm);
        }
      }
    }
    primitives=pms.toArray(new PrimitiveModel[0]);
  }
 else {
    PrimitiveModel pm=new PrimitiveModel(this,null,1,1);
    primitives=new PrimitiveModel[]{pm};
  }
}
Program: 120843
Project: 120843
Buggy source:
private Type getComponent(Type type,int comp){
  Type ret=null;
  if (Varies.class.isAssignableFrom(type.getClass())) {
    Varies v=(Varies)type;
    try {
      if (comp > 1 && GenericPrimitive.class.isAssignableFrom(v.getData().getClass()))       v.setData(new GenericComposite(v.getMessage()));
    }
 catch (    DataTypeException de) {
      String message="String_Node_Str" + de.getMessage();
      throw new Error(message);
    }
    ret=getComponent(v.getData(),comp);
  }
 else {
    if (Primitive.class.isAssignableFrom(type.getClass()) && comp == 1) {
      ret=type;
    }
 else     if (GenericComposite.class.isAssignableFrom(type.getClass()) || (Composite.class.isAssignableFrom(type.getClass()) && comp <= numStandardComponents(type))) {
      try {
        ret=((Composite)type).getComponent(comp - 1);
      }
 catch (      Exception e) {
        throw new Error("String_Node_Str",e);
      }
    }
 else {
      ret=type.getExtraComponents().getComponent(comp - numStandardComponents(type) - 1);
    }
  }
  return ret;
}

Fixed version (ground truth):
private Type getComponent(Type type,int comp){
  Type ret=null;
  if (Varies.class.isAssignableFrom(type.getClass())) {
    Varies v=(Varies)type;
    try {
      if (comp > 1 && GenericPrimitive.class.isAssignableFrom(v.getData().getClass())) {
        v.setData(new GenericComposite(v.getMessage()));
      }
    }
 catch (    DataTypeException de) {
      String message="String_Node_Str" + de.getMessage();
      throw new Error(message);
    }
    ret=getComponent(v.getData(),comp);
  }
 else {
    if (Primitive.class.isAssignableFrom(type.getClass()) && comp == 1) {
      ret=type;
    }
 else     if (GenericComposite.class.isAssignableFrom(type.getClass()) || (Composite.class.isAssignableFrom(type.getClass()) && comp <= numStandardComponents(type))) {
      try {
        ret=((Composite)type).getComponent(comp - 1);
      }
 catch (      Exception e) {
        throw new Error("String_Node_Str",e);
      }
    }
 else {
      ret=type.getExtraComponents().getComponent(comp - numStandardComponents(type) - 1);
    }
  }
  return ret;
}
Program: 120844
Project: 120844
Buggy source:
public int compare(ItemRecord o1,ItemRecord o2){
  return VersionUtils.compareTo(o1.getProperty().getVersion(),o2.getProperty().getVersion());
}

Fixed version (ground truth):
@Override public int compare(ItemRecord o1,ItemRecord o2){
  return VersionUtils.compareTo(o1.getProperty().getVersion(),o2.getProperty().getVersion());
}
Program: 120849
Project: 120849
Buggy source:
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    String extensionName=tm.getType().getName();
    String parentDisplayName=tm.getDisplayName();
    int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
    parentName=parentDisplayName.substring(0,extensionIndex - 1);
  }
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ TalendTextUtils.LBRACKET+ this.primitive.getName()+ TalendTextUtils.RBRACKET;
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  String parentName="String_Node_Str";
  if (parent instanceof TypeModel) {
    TypeModel tm=(TypeModel)parent;
    Type type=tm.getType();
    String parentDisplayName=tm.getDisplayName();
    parentName=parentDisplayName;
    if (type != null) {
      String extensionName=type.getName();
      int extensionIndex=parentDisplayName.lastIndexOf(extensionName);
      parentName=parentDisplayName.substring(0,extensionIndex - 1);
    }
  }
  String typeDispaly=primitive == null ? "String_Node_Str" : TalendTextUtils.LBRACKET + this.primitive.getName() + TalendTextUtils.RBRACKET;
  this.displayName=parentName + "String_Node_Str" + this.componentindex+ "String_Node_Str"+ this.subcomponentindex+ typeDispaly;
}
Program: 120850
Project: 120850
Buggy source:
protected void generateDisplayName(){
  this.displayName=seg.getName();
}

Fixed version (ground truth):
@Override protected void generateDisplayName(){
  this.displayName=seg.getName();
}
Program: 120851
Project: 120851
Buggy source:
private void generateDataTypes(){
  int number=this.seg.numFields();
  ArrayList<TypeModel> datatypes=new ArrayList<TypeModel>();
  for (int i=1; i < number; i++) {
    try {
      Type[] reps=seg.getField(i);
      for (int j=0; j < reps.length; j++) {
        TypeModel tm=new TypeModel(reps[j],seg,j,i);
        datatypes.add(tm);
      }
    }
 catch (    HL7Exception e) {
      e.printStackTrace();
    }
  }
  this.types=datatypes.toArray(new TypeModel[0]);
}

Fixed version (ground truth):
private void generateDataTypes(){
  int number=this.seg.numFields();
  ArrayList<TypeModel> datatypes=new ArrayList<TypeModel>();
  try {
    int lastNotEmptyFiledIndex=0;
    for (int i=1; i < number; i++) {
      Type[] reps=seg.getField(i);
      if (reps.length > 0) {
        lastNotEmptyFiledIndex=i;
      }
    }
    for (int i=1; i <= lastNotEmptyFiledIndex; i++) {
      Type[] reps=seg.getField(i);
      if (reps.length > 0) {
        for (int j=0; j < reps.length; j++) {
          TypeModel tm=new TypeModel(reps[j],seg,j,i);
          datatypes.add(tm);
        }
      }
 else {
        TypeModel tm=new TypeModel(null,seg,0,i);
        datatypes.add(tm);
      }
    }
  }
 catch (  HL7Exception e) {
    e.printStackTrace();
  }
  this.types=datatypes.toArray(new TypeModel[0]);
}