nus-yam/ex-repair huggingface dataset:
Program: 117871
Project: 117871
Buggy source:
private Object getParamValueForOldJDBC(IElementParameter param,Object objectValue){
  String paramName=param.getName();
  if (connection instanceof DatabaseConnection) {
    String databaseType=((DatabaseConnection)connection).getDatabaseType();
    if ("String_Node_Str".equals(databaseType)) {
      IComponent component=node.getComponent();
      if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getComponentType()) && component.getName().startsWith("String_Node_Str")) {
        if (EParameterName.DRIVER_JAR.getName().equals(paramName)) {
          List valueList=(List)objectValue;
          List newValue=new ArrayList<>();
          for (          Object value : valueList) {
            if (value instanceof Map) {
              Map map=new HashMap();
              String driver=String.valueOf(((Map)value).get("String_Node_Str"));
              MavenArtifact artifact=MavenUrlHelper.parseMvnUrl(TalendTextUtils.removeQuotes(driver));
              if (artifact != null) {
                driver=artifact.getFileName();
              }
              map.put("String_Node_Str",driver);
              newValue.add(map);
            }
          }
          if (!newValue.isEmpty()) {
            objectValue=newValue;
          }
        }
      }
    }
  }
  return objectValue;
}

Fixed version (ground truth):
private Object getParamValueForOldJDBC(IElementParameter param,Object objectValue){
  String paramName=param.getName();
  if (connection instanceof DatabaseConnection) {
    String databaseType=((DatabaseConnection)connection).getDatabaseType();
    if ("String_Node_Str".equals(databaseType)) {
      IComponent component=node.getComponent();
      if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getPaletteType()) && component.getName().startsWith("String_Node_Str")) {
        if (EParameterName.DRIVER_JAR.getName().equals(paramName)) {
          List valueList=(List)objectValue;
          List newValue=new ArrayList<>();
          for (          Object value : valueList) {
            if (value instanceof Map) {
              Map map=new HashMap();
              String driver=String.valueOf(((Map)value).get("String_Node_Str"));
              MavenArtifact artifact=MavenUrlHelper.parseMvnUrl(TalendTextUtils.removeQuotes(driver));
              if (artifact != null) {
                driver=artifact.getFileName();
              }
              map.put("String_Node_Str",driver);
              newValue.add(map);
            }
          }
          if (!newValue.isEmpty()) {
            objectValue=newValue;
          }
        }
      }
    }
  }
  return objectValue;
}
Program: 117873
Project: 117873
Buggy source:
private boolean sameDriverForJDBC(Node node,Connection repositoryConnection,List<Map<String,Object>> oldList,Object objectValue){
  boolean sameValues=true;
  List objectList=(List)objectValue;
  if (oldList.size() != objectList.size()) {
    sameValues=false;
  }
 else {
    if (isOldJDBC(node,repositoryConnection)) {
      for (int i=0; i < oldList.size(); i++) {
        Map<String,Object> oldMap=oldList.get(i);
        Map<String,Object> objectMap=(Map<String,Object>)objectList.get(i);
        String driver=String.valueOf(objectMap.get("String_Node_Str"));
        if (driver != null) {
          MavenArtifact artifact=MavenUrlHelper.parseMvnUrl(TalendTextUtils.removeQuotes(driver));
          if (artifact != null) {
            driver=artifact.getFileName();
          }
        }
        if (oldMap.get("String_Node_Str").equals(driver)) {
          sameValues=true;
        }
 else {
          sameValues=false;
          break;
        }
      }
    }
 else {
      for (int i=0; i < oldList.size(); i++) {
        Map<String,Object> oldMap=oldList.get(i);
        Map<String,Object> objectMap=(Map<String,Object>)objectList.get(i);
        if (oldMap.get("String_Node_Str").equals(objectMap.get("String_Node_Str"))) {
          sameValues=true;
        }
 else {
          sameValues=false;
          break;
        }
      }
    }
  }
  return sameValues;
}

Fixed version (ground truth):
private boolean sameDriverForJDBC(Node node,Connection repositoryConnection,List<Map<String,Object>> oldList,Object objectValue){
  boolean sameValues=true;
  List objectList=(List)objectValue;
  if (oldList.size() != objectList.size()) {
    sameValues=false;
  }
 else {
    String nodeParamDriverKey=null;
    if (isOldJDBC(node,repositoryConnection)) {
      nodeParamDriverKey="String_Node_Str";
    }
 else {
      nodeParamDriverKey="String_Node_Str";
    }
    for (int i=0; i < oldList.size(); i++) {
      Map<String,Object> oldMap=oldList.get(i);
      Map<String,Object> objectMap=(Map<String,Object>)objectList.get(i);
      String driver=String.valueOf(objectMap.get("String_Node_Str"));
      if (driver != null) {
        MavenArtifact artifact=MavenUrlHelper.parseMvnUrl(TalendTextUtils.removeQuotes(driver));
        if (artifact != null) {
          driver=artifact.getFileName();
        }
      }
      if (oldMap.get(nodeParamDriverKey).equals(driver)) {
        sameValues=true;
      }
 else {
        sameValues=false;
        break;
      }
    }
  }
  return sameValues;
}
Program: 117874
Project: 117874
Buggy source:
private boolean isOldJDBC(Node node,Connection repositoryConnection){
  boolean isOldJDBC=false;
  if (repositoryConnection instanceof DatabaseConnection) {
    String databaseType=((DatabaseConnection)repositoryConnection).getDatabaseType();
    if ("String_Node_Str".equals(databaseType)) {
      IComponent component=node.getComponent();
      if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getComponentType()) && component.getName().startsWith("String_Node_Str")) {
        isOldJDBC=true;
      }
    }
  }
  return isOldJDBC;
}

Fixed version (ground truth):
private boolean isOldJDBC(Node node,Connection repositoryConnection){
  boolean isOldJDBC=false;
  if (repositoryConnection instanceof DatabaseConnection) {
    String databaseType=((DatabaseConnection)repositoryConnection).getDatabaseType();
    if ("String_Node_Str".equals(databaseType)) {
      IComponent component=node.getComponent();
      if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getPaletteType()) && component.getName().startsWith("String_Node_Str")) {
        isOldJDBC=true;
      }
    }
  }
  return isOldJDBC;
}
Program: 117875
Project: 117875
Buggy source:
private String getReposiotryValueForOldJDBC(Node node,Connection repositoryConnection,IElementParameter param){
  String repositoryValue=param.getRepositoryValue();
  if (repositoryConnection instanceof DatabaseConnection) {
    String databaseType=((DatabaseConnection)repositoryConnection).getDatabaseType();
    if ("String_Node_Str".equals(databaseType)) {
      IComponent component=node.getComponent();
      if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getComponentType()) && component.getName().startsWith("String_Node_Str")) {
        if (EParameterName.URL.getName().equals(repositoryValue)) {
          repositoryValue="String_Node_Str";
        }
 else         if (EParameterName.DRIVER_JAR.getName().equals(repositoryValue)) {
          repositoryValue="String_Node_Str";
        }
 else         if (EParameterName.DRIVER_CLASS.getName().equals(repositoryValue)) {
          repositoryValue="String_Node_Str";
        }
      }
    }
  }
  return repositoryValue;
}

Fixed version (ground truth):
private String getReposiotryValueForOldJDBC(Node node,Connection repositoryConnection,IElementParameter param){
  String repositoryValue=param.getRepositoryValue();
  if (repositoryConnection instanceof DatabaseConnection) {
    String databaseType=((DatabaseConnection)repositoryConnection).getDatabaseType();
    if ("String_Node_Str".equals(databaseType)) {
      IComponent component=node.getComponent();
      if (!ComponentCategory.CATEGORY_4_DI.getName().equals(component.getPaletteType()) && component.getName().startsWith("String_Node_Str")) {
        if (EParameterName.URL.getName().equals(repositoryValue)) {
          repositoryValue="String_Node_Str";
        }
 else         if (EParameterName.DRIVER_JAR.getName().equals(repositoryValue)) {
          repositoryValue="String_Node_Str";
        }
 else         if (EParameterName.DRIVER_CLASS.getName().equals(repositoryValue)) {
          repositoryValue="String_Node_Str";
        }
      }
    }
  }
  return repositoryValue;
}
Program: 117881
Project: 117881
Buggy source:
@Before public void importEeDemo() throws Exception {
  initDemo(BIG_DATA_EE_DEMO_PLUGIN_ID);
  Assert.assertNotNull(currentDemo);
  initTestPaths();
  initTempPro();
  eeResManager=DemoImportTestUtil.getResourceManager(currentDemo);
  Assert.assertNotNull(eeResManager);
  ImportExportHandlersManager importManager=new ImportExportHandlersManager();
  List<ImportItem> projectRecords=importManager.populateImportingItems(eeResManager,true,new NullProgressMonitor());
  Assert.assertTrue(projectRecords.size() > 0);
  importManager.importItemRecords(new NullProgressMonitor(),eeResManager,projectRecords,true,projectRecords.toArray(new ImportItem[0]),null);
}

Fixed version (ground truth):
@Before public void importEeDemo() throws Exception {
  initDemo(BIG_DATA_EE_DEMO_PLUGIN_ID);
  Assert.assertNotNull(currentDemo);
  initTestPaths();
  initTempPro();
  eeResManager=DemoImportTestUtil.getResourceManager(currentDemo);
  Assert.assertNotNull(eeResManager);
  rootPath=getRootPath(eeResManager);
  collectDemoData(rootPath);
  ImportExportHandlersManager importManager=new ImportExportHandlersManager();
  List<ImportItem> projectRecords=importManager.populateImportingItems(eeResManager,true,new NullProgressMonitor());
  Assert.assertTrue(projectRecords.size() > 0);
  importManager.importItemRecords(new NullProgressMonitor(),eeResManager,projectRecords,true,projectRecords.toArray(new ImportItem[0]),null);
}
Program: 117882
Project: 117882
Buggy source:
@Test public void testBdCeDemoComplete() throws Exception {
  if (currentDemo == null) {
    return;
  }
  Assert.assertTrue(ceResManager instanceof FileResourcesUnityManager);
  Iterator path=ceResManager.getPaths().iterator();
  String firstFilePath=((Path)path.next()).toPortableString();
  String ceDemoName=demoName.substring(0,demoName.indexOf("String_Node_Str"));
  String tempFolderPath=firstFilePath.substring(0,firstFilePath.indexOf(TEMP_FOLDER_SUFFIEX) + TEMP_FOLDER_SUFFIEX.length());
  Assert.assertTrue(new File(tempFolderPath).exists());
  String rootPath=tempFolderPath + File.separator + ceDemoName;
  Assert.assertTrue(new File(rootPath).exists());
  File tempJobsFolder=new File(rootPath + File.separator + processItemPath);
  List<File> demoJobItemFiles=DemoImportTestUtil.collectProjectFilesFromDirectory(tempJobsFolder,FileConstants.ITEM_EXTENSION,true);
  Assert.assertTrue(demoJobItemFiles.size() > 0);
  int currentJobItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS).size();
  Assert.assertTrue(currentJobItemsSize > 0);
  Assert.assertEquals(demoJobItemFiles.size(),currentJobItemsSize);
  int currentContextItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.CONTEXT).size();
  Assert.assertTrue(currentContextItemsSize > 0);
  File tempContextItemsFolder=new File(rootPath + File.separator + contextItemPath);
  List<File> demoContextItemsFiles=DemoImportTestUtil.collectProjectFilesFromDirectory(tempContextItemsFolder,FileConstants.ITEM_EXTENSION,true);
  Assert.assertTrue(demoContextItemsFiles.size() > 0);
  Assert.assertEquals(demoContextItemsFiles.size(),currentContextItemsSize);
}

Fixed version (ground truth):
@Test public void testBdCeDemoComplete() throws Exception {
  if (currentDemo == null) {
    return;
  }
  Assert.assertTrue(ceResManager instanceof FileResourcesUnityManager);
  List<File> demoJobItemFiles=getDemoItemFileList(rootPath + File.separator + processItemPath);
  Assert.assertTrue(demoJobItemFiles.size() > 0);
  int currentJobItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS).size();
  Assert.assertTrue(currentJobItemsSize > 0);
  Assert.assertEquals(demoJobItemFiles.size(),currentJobItemsSize);
  int currentContextItemsSize=ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.CONTEXT).size();
  Assert.assertTrue(currentContextItemsSize > 0);
  List<File> demoContextItemsFiles=getDemoItemFileList(rootPath + File.separator + contextItemPath);
  Assert.assertTrue(demoContextItemsFiles.size() > 0);
  Assert.assertEquals(demoContextItemsFiles.size(),currentContextItemsSize);
}
Program: 117883
Project: 117883
Buggy source:
@Before public void importCeDemo() throws Exception {
  initDemo(BIG_DATA_CE_DEMO_PLUGIN_ID);
  if (currentDemo == null) {
    return;
  }
  initTestPaths();
  initTempPro();
  Assert.assertNotNull(currentDemo);
  ceResManager=DemoImportTestUtil.getResourceManager(currentDemo);
  Assert.assertNotNull(ceResManager);
  ImportExportHandlersManager importManager=new ImportExportHandlersManager();
  List<ImportItem> projectRecords=importManager.populateImportingItems(ceResManager,true,new NullProgressMonitor());
  Assert.assertTrue(projectRecords.size() > 0);
  importManager.importItemRecords(new NullProgressMonitor(),ceResManager,projectRecords,true,projectRecords.toArray(new ImportItem[0]),null);
}

Fixed version (ground truth):
@Before public void importCeDemo() throws Exception {
  initDemo(BIG_DATA_CE_DEMO_PLUGIN_ID);
  if (currentDemo == null) {
    return;
  }
  initTestPaths();
  initTempPro();
  Assert.assertNotNull(currentDemo);
  ceResManager=DemoImportTestUtil.getResourceManager(currentDemo);
  Assert.assertNotNull(ceResManager);
  rootPath=getRootPath(ceResManager);
  Assert.assertTrue(new File(rootPath).exists());
  collectDemoData(rootPath);
  ImportExportHandlersManager importManager=new ImportExportHandlersManager();
  List<ImportItem> projectRecords=importManager.populateImportingItems(ceResManager,true,new NullProgressMonitor());
  Assert.assertTrue(projectRecords.size() > 0);
  importManager.importItemRecords(new NullProgressMonitor(),ceResManager,projectRecords,true,projectRecords.toArray(new ImportItem[0]),null);
}
Program: 117886
Project: 117886
Buggy source:
public void propertyChange(PropertyChangeEvent evt){
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent evt){
}
Program: 117889
Project: 117889
Buggy source:
@Override public String getMVNPath(String value){
  ModuleNeeded module=new ModuleNeeded("String_Node_Str",value,"String_Node_Str",true);
  String mvnPath=module.getMavenUri();
  if (mvnPath != null && mvnPath.endsWith("String_Node_Str")) {
    mvnPath=mvnPath.substring(0,mvnPath.lastIndexOf("String_Node_Str"));
    return TalendQuoteUtils.addQuotesIfNotExist(mvnPath);
  }
  return value;
}

Fixed version (ground truth):
@Override public String getMVNPath(String value){
  String valueNoQuote=TalendQuoteUtils.removeQuotes(value);
  boolean isMvnUri=MavenUrlHelper.isMvnUrl(valueNoQuote);
  ModuleNeeded module=null;
  if (isMvnUri) {
    module=new ModuleNeeded("String_Node_Str","String_Node_Str",true,valueNoQuote);
  }
 else {
    module=new ModuleNeeded("String_Node_Str",valueNoQuote,"String_Node_Str",true);
  }
  String mvnPath=module.getMavenUri();
  if (mvnPath != null) {
    return TalendQuoteUtils.addQuotesIfNotExist(mvnPath);
  }
  return value;
}
Program: 117890
Project: 117890
Buggy source:
private String getSchema(){
  DatabaseConnection connection=(DatabaseConnection)((ConnectionItem)rootNode.getObject().getProperty().getItem()).getConnection();
  String schema="String_Node_Str";
  boolean isCalculationView=false;
  if (ConnectionUtils.isTeradata(connection.getURL())) {
    schema=connection.getSID();
  }
 else   if (EDatabaseTypeName.SAPHana.getDisplayName().equals(getCurrentDbType())) {
    if (erDiagram != null) {
      List<MetadataTable> tables=erDiagram.getMetadataTables();
      for (      MetadataTable table : tables) {
        if (MetadataManager.TYPE_CALCULATION_VIEW.equals(table.getTableType())) {
          isCalculationView=true;
        }
        schema=TaggedValueHelper.getValueString(GetTable.TABLE_SCHEM.name(),table);
        if (StringUtils.isEmpty(schema)) {
          schema=connection.getUiSchema();
        }
      }
    }
  }
 else {
    schema=connection.getUiSchema();
  }
  if (connection.isContextMode() && !isCalculationView) {
    schema=DatabaseConnectionParameterUtil.getContextTrueValue(connection,schema);
  }
  return schema;
}

Fixed version (ground truth):
private String getSchema(){
  DatabaseConnection connection=(DatabaseConnection)((ConnectionItem)rootNode.getObject().getProperty().getItem()).getConnection();
  String schema="String_Node_Str";
  boolean isCalculationView=false;
  if (ConnectionUtils.isTeradata(connection.getURL())) {
    schema=connection.getSID();
  }
 else   if (EDatabaseTypeName.SAPHana.getDisplayName().equals(getCurrentDbType())) {
    if (erDiagram != null) {
      List<MetadataTable> tables=erDiagram.getMetadataTables();
      for (      MetadataTable table : tables) {
        if (MetadataManager.TYPE_CALCULATION_VIEW.equals(table.getTableType())) {
          isCalculationView=true;
        }
        schema=TaggedValueHelper.getValueString(GetTable.TABLE_SCHEM.name(),table);
        if (StringUtils.isEmpty(schema)) {
          schema=connection.getUiSchema();
        }
      }
    }
  }
 else {
    schema=connection.getUiSchema();
  }
  if (connection.isContextMode() && !isCalculationView) {
    schema=DatabaseConnectionParameterUtil.getContextTrueValue(connection,schema);
  }
  if (schema == null) {
    schema="String_Node_Str";
  }
  return schema;
}
Program: 117891
Project: 117891
Buggy source:
public static void addNodeRelatedModules(final IProcess process,List<ModuleNeeded> modulesNeeded,INode node,boolean onlyMR){
  if (!node.isActivate()) {
    return;
  }
  List<ModuleNeeded> moduleList=node.getModulesNeeded();
  for (  ModuleNeeded needed : moduleList) {
    if (needed != null) {
      if (needed.isRequired(node.getElementParameters())) {
        if (onlyMR && !needed.isMrRequired()) {
          continue;
        }
        modulesNeeded.add(needed);
      }
    }
  }
  for (  IElementParameter curParam : node.getElementParameters()) {
    if (curParam.getFieldType() == null) {
      continue;
    }
    if (!curParam.isShow(node.getElementParameters())) {
      continue;
    }
    if (curParam.getFieldType().equals(EParameterFieldType.MODULE_LIST)) {
      if (curParam.getValue() != null && !"String_Node_Str".equals(curParam.getValue())) {
        modulesNeeded.add(getModuleValue(process,(String)curParam.getValue()));
      }
    }
 else     if (curParam.getFieldType() == EParameterFieldType.TABLE) {
      getModulesInTable(process,curParam,modulesNeeded);
    }
    findMoreLibraries(process,modulesNeeded,curParam);
  }
}

Fixed version (ground truth):
public static void addNodeRelatedModules(final IProcess process,List<ModuleNeeded> modulesNeeded,INode node,boolean onlyMR){
  if (!node.isActivate()) {
    return;
  }
  List<ModuleNeeded> moduleList=node.getModulesNeeded();
  for (  ModuleNeeded needed : moduleList) {
    if (needed != null) {
      if (needed.isRequired(node.getElementParameters())) {
        if (onlyMR && !needed.isMrRequired()) {
          continue;
        }
        modulesNeeded.add(needed);
      }
    }
  }
  for (  IElementParameter curParam : node.getElementParameters()) {
    if (curParam.getFieldType() == null) {
      continue;
    }
    if (!curParam.isShow(node.getElementParameters())) {
      continue;
    }
    if (curParam.getFieldType().equals(EParameterFieldType.MODULE_LIST)) {
      Object curParamValue=curParam.getValue();
      if (curParamValue != null) {
        if (curParamValue instanceof String) {
          if (StringUtils.isNotEmpty((String)curParamValue)) {
            modulesNeeded.add(getModuleValue(process,(String)curParamValue));
          }
        }
 else         if (curParamValue instanceof List) {
          getModulesInTable(process,curParam,modulesNeeded);
        }
      }
    }
 else     if (curParam.getFieldType() == EParameterFieldType.TABLE) {
      getModulesInTable(process,curParam,modulesNeeded);
    }
    findMoreLibraries(process,modulesNeeded,curParam);
  }
}
Program: 117896
Project: 117896
Buggy source:
private void updateProSetingParameters(EList listParamType){
  for (int j=0; j < listParamType.size(); j++) {
    ElementParameterType pType=(ElementParameterType)listParamType.get(j);
    if (EParameterName.STATANDLOG_USE_PROJECT_SETTINGS.getName().equals(pType.getName())) {
      if (Boolean.valueOf(pType.getValue())) {
        ProjectSettingManager.reloadStatsAndLogFromProjectSettings(this,ProjectManager.getInstance().getCurrentProject(),null);
        break;
      }
    }
  }
}

Fixed version (ground truth):
private void updateProSetingParameters(EList listParamType){
  Project project=ProjectManager.getInstance().getCurrentProject();
  boolean updateStandardLog=false;
  boolean updateImplicitContext=false;
  for (int j=0; j < listParamType.size(); j++) {
    ElementParameterType pType=(ElementParameterType)listParamType.get(j);
    if (Boolean.valueOf(pType.getValue())) {
      if (EParameterName.STATANDLOG_USE_PROJECT_SETTINGS.getName().equals(pType.getName())) {
        ProjectSettingManager.reloadStatsAndLogFromProjectSettings(this,project,null);
        updateStandardLog=true;
      }
 else       if (EParameterName.IMPLICITCONTEXT_USE_PROJECT_SETTINGS.getName().equals(pType.getName())) {
        Element elem=ProjectSettingManager.createImplicitContextLoadElement(project);
        Map<String,Set<String>> contextVars=DetectContextVarsUtils.detectByPropertyType(elem,true);
        boolean addContextModel=false;
        List<ContextItem> allContextItems=null;
        if (!contextVars.isEmpty()) {
          org.talend.core.model.metadata.builder.connection.Connection connection=null;
          IElementParameter ptParam=elem.getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
          if (ptParam != null) {
            IElementParameter propertyElem=ptParam.getChildParameters().get(EParameterName.PROPERTY_TYPE.getName());
            Object proValue=propertyElem.getValue();
            if (proValue instanceof String && ((String)proValue).equalsIgnoreCase(EmfComponent.REPOSITORY)) {
              IElementParameter repositoryElem=ptParam.getChildParameters().get(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
              String value=(String)repositoryElem.getValue();
              org.talend.core.model.properties.ConnectionItem connectionItem=UpdateRepositoryUtils.getConnectionItemByItemId(value);
              connection=connectionItem.getConnection();
              if (connection != null && connection.isContextMode()) {
                addContextModel=true;
                allContextItems=ContextUtils.getAllContextItem();
              }
            }
          }
        }
        ProjectSettingManager.reloadImplicitValuesFromProjectSettings(this,project,null);
        if (addContextModel && !contextVars.isEmpty() && allContextItems != null) {
          ContextUtils.addInContextModelForProcessItem(property.getItem(),contextVars,allContextItems);
        }
        updateImplicitContext=true;
      }
    }
    if (updateStandardLog && updateImplicitContext) {
      break;
    }
  }
}
Program: 117904
Project: 117904
Buggy source:
protected void initSchemaTable(){
  IConnection inConn=null;
  for (  IConnection conn : externalNode.getIncomingConnections()) {
    if ((conn.getLineStyle().equals(EConnectionType.FLOW_MAIN)) || (conn.getLineStyle().equals(EConnectionType.FLOW_REF)) || (conn.getLineStyle().equals(EConnectionType.FLOW_MERGE))) {
      inConn=conn;
      break;
    }
  }
  if (inConn != null) {
    List<IMetadataColumn> columnList=inConn.getMetadataTable().getListColumns();
    schemaViewer.setInput(columnList);
  }
 else {
    schemaViewer.setInput(new ArrayList<IMetadataColumn>());
  }
}

Fixed version (ground truth):
protected void initSchemaTable(){
  IConnection inConn=null;
  for (  IConnection conn : externalNode.getIncomingConnections()) {
    if ((conn.getLineStyle().equals(EConnectionType.FLOW_MAIN)) || (conn.getLineStyle().equals(EConnectionType.FLOW_REF)) || (conn.getLineStyle().equals(EConnectionType.FLOW_MERGE))) {
      inConn=conn;
      break;
    }
  }
  if (inConn != null) {
    List<IMetadataColumn> columnList=inConn.getMetadataTable().getListColumns();
    schemaViewer.setInput(columnList);
  }
 else {
    schemaViewer.setInput(new ArrayList<IMetadataColumn>());
  }
  if (Platform.OS_MACOSX.equals(Platform.getOS())) {
    TableItem[] items=schemaViewer.getTable().getItems();
    for (int rowid=0; rowid < items.length; rowid++) {
      if (rowid % 2 == 0)       items[rowid].setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
 else       items[rowid].setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
    }
  }
}
Program: 117905
Project: 117905
Buggy source:
private void addSchemaViewer(final Composite mainComposite,final int width,final int height){
  final Group group=Form.createGroup(mainComposite,1,Messages.getString("String_Node_Str"),height);
  createCombo(group);
  schemaViewer=new TableViewer(group);
  SchemaTableViewerProvider provider=new SchemaTableViewerProvider();
  schemaViewer.setContentProvider(provider);
  schemaViewer.setLabelProvider(provider);
  GridData data2=new GridData(GridData.FILL_BOTH);
  Table table=schemaViewer.getTable();
  if (canModify || isRepository) {
    table.setEnabled(false);
  }
  table.setHeaderVisible(true);
  TableColumn column1=new TableColumn(table,SWT.LEFT);
  column1.setText(Messages.getString("String_Node_Str"));
  column1.setWidth(100);
  table.setLayoutData(data2);
  table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      if (footerComp != null) {
        footerComp.isActivateBtn(false);
      }
    }
  }
);
}

Fixed version (ground truth):
private void addSchemaViewer(final Composite mainComposite,final int width,final int height){
  final Group group=Form.createGroup(mainComposite,1,Messages.getString("String_Node_Str"),height);
  createCombo(group);
  schemaViewer=new TableViewer(group);
  SchemaTableViewerProvider provider=new SchemaTableViewerProvider();
  schemaViewer.setContentProvider(provider);
  schemaViewer.setLabelProvider(provider);
  GridData data2=new GridData(GridData.FILL_BOTH);
  Table table=schemaViewer.getTable();
  if (canModify || isRepository) {
    table.setEnabled(false);
  }
  table.setHeaderVisible(true);
  TableColumn column1=new TableColumn(table,SWT.LEFT);
  column1.setText(Messages.getString("String_Node_Str"));
  if (Platform.OS_MACOSX.equals(Platform.getOS())) {
    column1.setWidth(mainComposite.getShell().getBounds().width);
    column1.addControlListener(new ControlListener(){
      @Override public void controlMoved(      ControlEvent e){
      }
      @Override public void controlResized(      ControlEvent e){
        column1.setWidth(mainComposite.getShell().getBounds().width);
      }
    }
);
  }
 else {
    column1.setWidth(100);
  }
  table.setLayoutData(data2);
  table.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      if (footerComp != null) {
        footerComp.isActivateBtn(false);
      }
    }
  }
);
}
Program: 117908
Project: 117908
Buggy source:
@Override public List<? extends INodeReturn> createReturns(){
  return new ArrayList<NodeReturn>();
}

Fixed version (ground truth):
@Override public List<? extends INodeReturn> createReturns(INode node){
  return new ArrayList<NodeReturn>();
}
Program: 117911
Project: 117911
Buggy source:
@Override public List<? extends INodeReturn> createReturns(){
  return null;
}

Fixed version (ground truth):
@Override public List<? extends INodeReturn> createReturns(INode node){
  return null;
}
Program: 117912
Project: 117912
Buggy source:
@Override public List<? extends INodeReturn> createReturns(){
  return null;
}

Fixed version (ground truth):
@Override public List<? extends INodeReturn> createReturns(INode node){
  return null;
}
Program: 117913
Project: 117913
Buggy source:
public Node(INode oldNode,IProcess2 process){
  this.oldcomponent=oldNode.getComponent();
  this.componentProperties=oldNode.getComponentProperties();
  this.process=process;
  init(oldNode.getComponent());
  needlibrary=false;
}

Fixed version (ground truth):
public Node(INode oldNode,IProcess2 process){
  this.oldcomponent=oldNode.getComponent();
  if (component != null && component instanceof AbstractBasicComponent) {
    AbstractBasicComponent comp=(AbstractBasicComponent)component;
    comp.initNodePropertiesFromSerialized(this,oldNode.getComponentProperties().toSerialized());
  }
  this.process=process;
  init(oldNode.getComponent());
  needlibrary=false;
}
Program: 117915
Project: 117915
Buggy source:
@Override public List<? extends INodeReturn> createReturns(){
  return Collections.emptyList();
}

Fixed version (ground truth):
@Override public List<? extends INodeReturn> createReturns(INode node){
  return Collections.emptyList();
}
Program: 117916
Project: 117916
Buggy source:
@Override public List<? extends INodeReturn> createReturns(){
  return null;
}

Fixed version (ground truth):
@Override public List<? extends INodeReturn> createReturns(INode node){
  return null;
}
Program: 117918
Project: 117918
Buggy source:
public void changePaletteComponentHandler(){
  ComponentsFactoryProvider.getInstance().setComponentsHandler(designerEditor.getComponenentsHandler());
}

Fixed version (ground truth):
@Override public void changePaletteComponentHandler(){
  ComponentsFactoryProvider.getInstance().setComponentsHandler(designerEditor.getComponenentsHandler());
}
Program: 117919
Project: 117919
Buggy source:
@Override protected void okPressed(){
  Tree tree=viewer.getTree();
  if (tree.isDisposed()) {
    return;
  }
  setResult(getInputElements());
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  selectedElement=getCheckedElements();
  Tree tree=viewer.getTree();
  if (tree.isDisposed()) {
    return;
  }
  setResult(getInputElements());
  super.okPressed();
}
Program: 117920
Project: 117920
Buggy source:
/** 
 * create table view.
 */
private Composite createTreeTableView(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  int style=SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER;
  if (!isOnlySimpleShow()) {
    style=SWT.CHECK | style;
  }
  viewer=new CheckboxTreeViewer(new Tree(composite,style));
  viewer.setContentProvider(new UpdateContentProvider());
  viewer.setLabelProvider(new UpdateLabelProvider());
  viewer.setSorter(new UpdateViewerSorter());
  viewer.setInput(getInputElements());
  final Tree tree=viewer.getTree();
  tree.setHeaderVisible(true);
  tree.setLinesVisible(true);
  tree.setLayoutData(new GridData(GridData.FILL_BOTH));
  addViewerListener();
  createColumns(tree);
  return composite;
}

Fixed version (ground truth):
/** 
 * create table view.
 */
private Composite createTreeTableView(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  int style=SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL| SWT.BORDER;
  if (!isOnlySimpleShow()) {
    style=SWT.CHECK | style;
  }
  viewer=new CheckboxTreeViewer(new Tree(composite,style));
  viewer.setContentProvider(new UpdateContentProvider());
  viewer.setLabelProvider(new UpdateLabelProvider());
  viewer.setSorter(new UpdateViewerSorter());
  viewer.setInput(getInputElements());
  final Tree tree=viewer.getTree();
  tree.setHeaderVisible(true);
  tree.setLinesVisible(true);
  tree.setLayoutData(new GridData(GridData.FILL_BOTH));
  addViewerListener();
  createColumns(tree);
  helper.selectAll(true);
  return composite;
}
Program: 117921
Project: 117921
Buggy source:
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getProperties(EProperties.CONTENT_TYPE) != ERepositoryObjectType.PROCESS) {
      canWork=false;
      break;
    }
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT && node.getChildren().isEmpty()) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}

Fixed version (ground truth):
@Override public void init(TreeViewer viewer,IStructuredSelection selection){
  boolean canWork=true;
  if (selection.isEmpty()) {
    setEnabled(false);
    return;
  }
  List<RepositoryNode> nodes=selection.toList();
  for (  RepositoryNode node : nodes) {
    if (node.getProperties(EProperties.CONTENT_TYPE) != ERepositoryObjectType.PROCESS) {
      canWork=false;
      break;
    }
    if (node.getType() != ENodeType.REPOSITORY_ELEMENT && node.getChildren().isEmpty()) {
      canWork=false;
      break;
    }
    if (canWork && node.getObject() != null && ProxyRepositoryFactory.getInstance().getStatus(node.getObject()) == ERepositoryStatus.DELETED) {
      canWork=false;
      break;
    }
    if (ExportJobUtil.getProcessItem(nodes) == null) {
      canWork=false;
      break;
    }
  }
  setEnabled(canWork);
}
Program: 117922
Project: 117922
Buggy source:
protected ProcessItem getProcessItem(){
  if ((processItem == null) && (nodes != null) && (nodes.length >= 1)) {
    IRepositoryViewObject repositoryObject=nodes[0].getObject();
    List<IRepositoryNode> nodesChildren=nodes[0].getChildren();
    IRepositoryViewObject childObject=null;
    if ((nodesChildren != null) && (nodesChildren.size() >= 1)) {
      childObject=nodesChildren.get(0).getObject();
    }
    if (repositoryObject == null && childObject != null && childObject.getProperty().getItem() instanceof ProcessItem) {
      processItem=(ProcessItem)childObject.getProperty().getItem();
    }
    if (repositoryObject != null && repositoryObject.getProperty().getItem() instanceof ProcessItem) {
      processItem=(ProcessItem)repositoryObject.getProperty().getItem();
    }
 else     if (repositoryObject != null && repositoryObject.getProperty().getItem() instanceof FolderItem) {
      processItem=getProcessItemIfSelectFolder(repositoryObject);
    }
  }
  return processItem;
}

Fixed version (ground truth):
protected ProcessItem getProcessItem(){
  if ((processItem == null) && (nodes != null) && (nodes.length >= 1)) {
    processItem=ExportJobUtil.getProcessItem(Arrays.asList(nodes));
  }
  return processItem;
}
Program: 117926
Project: 117926
Buggy source:
public DeploymentComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,IRepositoryViewObject repositoryViewObject){
  super(parent,style,widgetFactory,repositoryViewObject);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
    esbService=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
  }
  if (repositoryViewObject instanceof Process) {
    process=(Process)repositoryViewObject;
    commandStack=process.getCommandStack();
    defaultVersion=getDefaultVersion(process.getVersion());
    isDataServiceJob=false;
    if (!process.getComponentsType().equals(ComponentCategory.CATEGORY_4_CAMEL.getName())) {
      List<INode> nodes=(List<INode>)process.getGraphicalNodes();
      for (      INode node : nodes) {
        if ("String_Node_Str".equals(node.getComponent().getName())) {
          isDataServiceJob=true;
          defaultVersion="String_Node_Str";
          break;
        }
      }
    }
  }
 else {
    IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (esbService.isWSDLEditor(editor) && esbService.getServicesType() == repositoryViewObject.getRepositoryObjectType()) {
      serviceItem=esbService.getWSDLEditorItem(editor);
      commandStack=(CommandStack)editor.getAdapter(CommandStack.class);
      defaultVersion=getDefaultVersion(serviceItem.getProperty().getVersion());
      isService=true;
    }
  }
  createControl();
  initialize();
  addListeners();
  checkReadOnly();
}

Fixed version (ground truth):
public DeploymentComposite(Composite parent,int style,TabbedPropertySheetWidgetFactory widgetFactory,IRepositoryViewObject repositoryViewObject){
  super(parent,style,widgetFactory,repositoryViewObject);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
    esbService=(IESBService)GlobalServiceRegister.getDefault().getService(IESBService.class);
  }
  if (repositoryViewObject instanceof Process) {
    process=(Process)repositoryViewObject;
    commandStack=process.getCommandStack();
    defaultVersion=getDefaultVersion(process.getVersion());
    isDataServiceJob=false;
    if (!process.getComponentsType().equals(ComponentCategory.CATEGORY_4_CAMEL.getName())) {
      List<INode> nodes=(List<INode>)process.getGraphicalNodes();
      for (      INode node : nodes) {
        if ("String_Node_Str".equals(node.getComponent().getName())) {
          isDataServiceJob=true;
          defaultVersion="String_Node_Str";
          break;
        }
      }
    }
  }
 else {
    IEditorPart editor=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (esbService != null && esbService.isWSDLEditor(editor)) {
      serviceItem=esbService.getWSDLEditorItem(editor);
      commandStack=(CommandStack)editor.getAdapter(CommandStack.class);
      defaultVersion=getDefaultVersion(serviceItem.getProperty().getVersion());
      isService=true;
    }
  }
  createControl();
  initialize();
  addListeners();
  checkReadOnly();
}
Program: 117927
Project: 117927
Buggy source:
@Override protected void checkVisibleTopMessages(){
  missModulesNeeded.clear();
  final Element ele=this.getElement();
  if (ele instanceof Node) {
    List<ModuleNeeded> updatedModules=LibrariesManagerUtils.getNotInstalledModules(((Node)ele));
    missModulesNeeded.addAll(updatedModules);
  }
  setVisibleTopMessage(!missModulesNeeded.isEmpty());
}

Fixed version (ground truth):
@Override protected void checkVisibleTopMessages(){
  missModulesNeeded.clear();
  final Element ele=this.getElement();
  if (ele instanceof Node) {
    List<ModuleNeeded> updatedModules=LibrariesManagerUtils.getNotInstalledModules(((Node)ele));
    missModulesNeeded.addAll(updatedModules);
    ((Node)ele).checkAndRefreshNode();
  }
  setVisibleTopMessage(!missModulesNeeded.isEmpty());
}
Program: 117930
Project: 117930
Buggy source:
/** 
 * Test if the current node can be the start of the job not.
 * @return
 */
@Override public boolean checkIfCanBeStart(){
  if (isELTComponent()) {
    if (this.checkELTTableReference()) {
      return false;
    }
    boolean isThereConditionLink=false;
    for (int j=0; j < getIncomingConnections().size() && !isThereConditionLink; j++) {
      IConnection connection=getIncomingConnections().get(j);
      if (connection.isActivate() && connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DEPENDENCY)) {
        isThereConditionLink=true;
      }
    }
    return !isThereConditionLink;
  }
 else {
    boolean canBeStart=false;
    boolean isActivatedConnection=false;
    for (int j=0; j < getIncomingConnections().size() && !isActivatedConnection; j++) {
      IConnection connection=getIncomingConnections().get(j);
      if (connection.isActivate() && !connection.getLineStyle().hasConnectionCategory(IConnectionCategory.USE_HASH)) {
        isActivatedConnection=true;
      }
    }
    boolean isOnMainBranch=true;
    Map<INode,Integer> mergeInfo=getLinkedMergeInfo();
    for (    INode node : mergeInfo.keySet()) {
      if (mergeInfo.get(node) != 1) {
        isOnMainBranch=false;
      }
    }
    if (!isActivatedConnection) {
      if (!getProcess().isThereLinkWithHash(this) && isOnMainBranch) {
        canBeStart=true;
      }
    }
 else {
      if (getIncomingConnections().size() == 0 && isOnMainBranch) {
        if (!getProcess().isThereLinkWithHash(this)) {
          canBeStart=true;
        }
      }
    }
    return canBeStart;
  }
}

Fixed version (ground truth):
/** 
 * Test if the current node can be the start of the job not.
 * @return
 */
@Override public boolean checkIfCanBeStart(){
  if (isELTSAPMapComponent()) {
    if (!isThereConditionLink() && isOnMainBranch()) {
      return true;
    }
    return false;
  }
 else   if (isELTComponent()) {
    if (this.checkELTTableReference()) {
      return false;
    }
    return !isThereConditionLink();
  }
 else {
    boolean canBeStart=false;
    boolean isActivatedConnection=false;
    for (int j=0; j < getIncomingConnections().size() && !isActivatedConnection; j++) {
      IConnection connection=getIncomingConnections().get(j);
      if (connection.isActivate() && !connection.getLineStyle().hasConnectionCategory(IConnectionCategory.USE_HASH)) {
        isActivatedConnection=true;
      }
    }
    boolean isOnMainBranch=isOnMainBranch();
    if (!isActivatedConnection) {
      if (!getProcess().isThereLinkWithHash(this) && isOnMainBranch) {
        canBeStart=true;
      }
    }
 else {
      if (getIncomingConnections().size() == 0 && isOnMainBranch) {
        if (!getProcess().isThereLinkWithHash(this)) {
          canBeStart=true;
        }
      }
    }
    return canBeStart;
  }
}
Program: 117932
Project: 117932
Buggy source:
/** 
 * read all components belongs to some category (DI, CAMEL etc.) then store it into a map which can be reused
 * @param categoryName
 * @param entries
 */
private static void readComponentsInCategory(String categoryName,Map<String,IComponent> entries){
  IComponentsFactory componentsFactory=ComponentsFactoryProvider.getInstance();
  Set<IComponent> allComponents=componentsFactory.getComponents();
  for (  IComponent component : allComponents) {
    String compType=component.getPaletteType();
    if (!component.isTechnical() && compType != null && categoryName.equals(compType)) {
      entries.put(component.getName(),component);
    }
  }
  DummyComponent noteComponent=new DummyComponent("String_Node_Str");
  noteComponent.setIcon16(ImageProvider.getImageDesc(ECoreImage.CODE_ICON));
  noteComponent.setOriginalFamilyName("String_Node_Str");
  entries.put("String_Node_Str",noteComponent);
}

Fixed version (ground truth):
/** 
 * read all components belongs to some category (DI, CAMEL etc.) then store it into a map which can be reused
 * @param categoryName
 * @param entries
 */
private static void readComponentsInCategory(String categoryName,Map<String,IComponent> entries){
  IComponentsFactory componentsFactory=ComponentsFactoryProvider.getInstance();
  Collection<IComponent> allComponents=componentsFactory.readComponents();
  for (  IComponent component : allComponents) {
    String compType=component.getPaletteType();
    if (!component.isTechnical() && compType != null && categoryName.equals(compType)) {
      entries.put(component.getName(),component);
    }
  }
  DummyComponent noteComponent=new DummyComponent("String_Node_Str");
  noteComponent.setIcon16(ImageProvider.getImageDesc(ECoreImage.CODE_ICON));
  noteComponent.setOriginalFamilyName("String_Node_Str");
  entries.put("String_Node_Str",noteComponent);
}
Program: 117933
Project: 117933
Buggy source:
protected static void addComponentsByNameFilter(final IComponentsFactory compFac,Set<IComponent> componentSet,String nameFilter){
  if (compFac == null || componentSet == null) {
    return;
  }
  if (nameFilter != null && !nameFilter.trim().isEmpty()) {
    Set<IComponent> components=compFac.getComponents();
    Iterator<IComponent> iter=components.iterator();
    String regex=getFilterRegex(nameFilter);
    Pattern pattern=Pattern.compile(regex);
    Set<ComponentHit> resultByName=new LinkedHashSet<ComponentHit>();
    Set<ComponentHit> resultByLongName=new LinkedHashSet<ComponentHit>();
    while (iter.hasNext()) {
      IComponent xmlComponent=iter.next();
      Matcher matcher=pattern.matcher(xmlComponent.getName().toLowerCase());
      if (matcher.find()) {
        resultByName.add(new ComponentHit(xmlComponent,matcher.start()));
        continue;
      }
      matcher=pattern.matcher(xmlComponent.getLongName().toLowerCase());
      if (matcher.find()) {
        resultByLongName.add(new ComponentHit(xmlComponent,matcher.start()));
        continue;
      }
    }
    if (!resultByName.isEmpty()) {
      ComponentHit[] hitArray=resultByName.toArray(new ComponentHit[resultByName.size()]);
      Arrays.sort(hitArray);
      addComponents(componentSet,hitArray);
    }
    if (!resultByLongName.isEmpty()) {
      ComponentHit[] hitArray=resultByLongName.toArray(new ComponentHit[resultByLongName.size()]);
      Arrays.sort(hitArray);
      addComponents(componentSet,hitArray);
    }
  }
}

Fixed version (ground truth):
protected static void addComponentsByNameFilter(final IComponentsFactory compFac,Collection<IComponent> componentSet,String nameFilter){
  if (compFac == null || componentSet == null) {
    return;
  }
  if (nameFilter != null && !nameFilter.trim().isEmpty()) {
    Collection<IComponent> components=compFac.readComponents();
    Iterator<IComponent> iter=components.iterator();
    String regex=getFilterRegex(nameFilter);
    Pattern pattern=Pattern.compile(regex);
    Set<ComponentHit> resultByName=new LinkedHashSet<ComponentHit>();
    Set<ComponentHit> resultByLongName=new LinkedHashSet<ComponentHit>();
    while (iter.hasNext()) {
      IComponent xmlComponent=iter.next();
      Matcher matcher=pattern.matcher(xmlComponent.getName().toLowerCase());
      if (matcher.find()) {
        resultByName.add(new ComponentHit(xmlComponent,matcher.start()));
        continue;
      }
      matcher=pattern.matcher(xmlComponent.getLongName().toLowerCase());
      if (matcher.find()) {
        resultByLongName.add(new ComponentHit(xmlComponent,matcher.start()));
        continue;
      }
    }
    if (!resultByName.isEmpty()) {
      ComponentHit[] hitArray=resultByName.toArray(new ComponentHit[resultByName.size()]);
      Arrays.sort(hitArray);
      addComponents(componentSet,hitArray);
    }
    if (!resultByLongName.isEmpty()) {
      ComponentHit[] hitArray=resultByLongName.toArray(new ComponentHit[resultByLongName.size()]);
      Arrays.sort(hitArray);
      addComponents(componentSet,hitArray);
    }
  }
}
Program: 117934
Project: 117934
Buggy source:
private static void addComponents(Set<IComponent> componentSet,ComponentHit[] hitArray){
  for (  ComponentHit ch : hitArray) {
    componentSet.add(ch.getComponent());
  }
}

Fixed version (ground truth):
private static void addComponents(Collection<IComponent> componentSet,ComponentHit[] hitArray){
  for (  ComponentHit ch : hitArray) {
    componentSet.add(ch.getComponent());
  }
}
Program: 117939
Project: 117939
Buggy source:
@Override public List<IComponent> filterNeededComponents(Item item,RepositoryNode seletetedNode,ERepositoryObjectType type){
  List<IComponent> neededComponents=new ArrayList<>();
  if (!(item instanceof GenericConnectionItem)) {
    return neededComponents;
  }
  IComponentsService service=(IComponentsService)GlobalServiceRegister.getDefault().getService(IComponentsService.class);
  Set<IComponent> components=service.getComponentsFactory().getComponents();
  for (  IComponent component : components) {
    if (EComponentType.GENERIC.equals(component.getComponentType())) {
      if (!neededComponents.contains(component) && isValid(seletetedNode,component)) {
        neededComponents.add(component);
      }
    }
  }
  return neededComponents;
}

Fixed version (ground truth):
@Override public List<IComponent> filterNeededComponents(Item item,RepositoryNode seletetedNode,ERepositoryObjectType type){
  List<IComponent> neededComponents=new ArrayList<>();
  if (!(item instanceof GenericConnectionItem)) {
    return neededComponents;
  }
  IComponentsService service=(IComponentsService)GlobalServiceRegister.getDefault().getService(IComponentsService.class);
  Collection<IComponent> components=service.getComponentsFactory().readComponents();
  for (  IComponent component : components) {
    if (EComponentType.GENERIC.equals(component.getComponentType())) {
      if (!neededComponents.contains(component) && isValid(seletetedNode,component)) {
        neededComponents.add(component);
      }
    }
  }
  return neededComponents;
}