Program: 119571
Project: 119571
Buggy source:
private void addListenerForInputCom(){
  rowTableForin.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
    }
  }
);
  expressTableForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TableItem[] selectedItem=expressTableForIn.getSelection();
      currentElementIndexForIn=expressTableForIn.getSelectionIndex();
      currentInputMappingData=(InputMappingData)selectedItem[0].getData();
      if (currentInputMappingData.getParameter() == null) {
        return;
      }
      List<ParameterInfo> infoList=currentInputMappingData.getParameter().getParameterInfos();
      Boolean isArray=false;
      String isArrayName=currentInputMappingData.getParameterName();
      if ((currentInputMappingData.getParameter().getArraySize() == -1 || currentInputMappingData.getParameter().getArraySize() > 1) && !isArrayName.endsWith("String_Node_Str")) {
        isArray=true;
      }
      if (isArrayName.contains("String_Node_Str")) {
        isArray=true;
      }
      ParameterInfo infoPa=currentInputMappingData.getParameter().getParent();
      if (infoList != null && infoList.size() > 0 || isArray) {
        addListButForIn.setEnabled(true);
      }
 else {
        addListButForIn.setEnabled(false);
      }
      if (infoPa != null) {
        removeButForIn.setEnabled(true);
      }
 else {
        removeButForIn.setEnabled(false);
      }
      List<IMetadataColumn> columnList=currentInputMappingData.getMetadataColumnList();
      if (columnList != null && columnList.size() != 1) {
        normalizeButForIn.setEnabled(false);
        denorButForIn.setEnabled(false);
      }
 else       if (columnList != null && columnList.size() == 1) {
        IMetadataColumn column=columnList.get(0);
        if (column == null) {
          return;
        }
        if (column.getTalendType().equals("String_Node_Str") && !isArray && !currentInputMappingData.getInputColumnValue().contains("String_Node_Str")) {
          denorButForIn.setEnabled(true);
        }
 else {
          denorButForIn.setEnabled(false);
        }
        if (!column.getTalendType().equals("String_Node_Str") && isArray && !currentInputMappingData.getInputColumnValue().contains("String_Node_Str")) {
          normalizeButForIn.setEnabled(true);
        }
 else {
          normalizeButForIn.setEnabled(false);
        }
      }
    }
  }
);
  inputschemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Shell shell=uiParent.getShell();
      MetadataTable inmetadataTable=null;
      if (connection != null) {
        Set<org.talend.core.model.metadata.builder.connection.MetadataTable> tables=ConnectionHelper.getTables(connection);
        Iterator it=tables.iterator();
        while (it.hasNext()) {
          org.talend.core.model.metadata.builder.connection.MetadataTable metadatatable=(org.talend.core.model.metadata.builder.connection.MetadataTable)it.next();
          if (metadatatable.getLabel().equals("String_Node_Str")) {
            inmetadataTable=metadatatable;
          }
        }
      }
 else {
        inmetadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
        inmetadataTable.setLabel("String_Node_Str");
        EList schemaMetadataColumn=inmetadataTable.getColumns();
        for (int i=0; i < inPutcolumnList.size(); i++) {
          org.talend.core.model.metadata.MetadataColumn metadatacolumn=(org.talend.core.model.metadata.MetadataColumn)inPutcolumnList.get(i);
          MetadataColumn column=ConnectionFactory.eINSTANCE.createMetadataColumn();
          column.setLabel(metadatacolumn.getLabel());
          column.setTalendType(metadatacolumn.getTalendType());
          column.setOriginalField(metadatacolumn.getLabel());
          schemaMetadataColumn.add(column);
        }
      }
      WSDLSchemaDialog dialog=new WSDLSchemaDialog(shell,inmetadataTable);
      EList columnList=inmetadataTable.getColumns();
      if (dialog != null && dialog.open() == WSDLSchemaDialog.OK) {
        IMetadataTable inputMetadataTable=connector.getMetadataFromConnector("String_Node_Str");
        inputMetadataTable.getListColumns().clear();
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        List<org.talend.core.model.metadata.IMetadataColumn> llist=new ArrayList<org.talend.core.model.metadata.IMetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          org.talend.core.model.metadata.MetadataColumn metadatacolumn=new org.talend.core.model.metadata.MetadataColumn();
          metadatacolumn.setLabel(column.getLabel());
          metadatacolumn.setTalendType(column.getTalendType());
          metadatacolumn.setOriginalDbColumnName(column.getLabel());
          llist.add(metadatacolumn);
        }
        inPutcolumnList.clear();
        inPutcolumnList.addAll(llist);
        if (inputMetaCopy != null) {
          inputMetaCopy.getListColumns().clear();
          inputMetaCopy.setListColumns(llist);
        }
        inputMetadataTable.setListColumns(llist);
        columnInPutTableView.getTableViewerCreator().getTableViewer().refresh();
        synchronizeInputLinks(tabTotabLinkForin,llist);
      }
    }
  }
);
  addListButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Shell shell=uiParent.getShell();
      TableItem[] items=expressTableForIn.getSelection();
      if (items.length <= 0) {
        return;
      }
      ParameterInfo para=((InputMappingData)items[0].getData()).getParameter();
      if (para.getArraySize() == -1 && para.getParameterInfos().isEmpty()) {
        InputDialog dlg=new InputDialog(shell,"String_Node_Str",Messages.getString("String_Node_Str"),"String_Node_Str",new InputIndexValidator());
        if (dlg.open() == dlg.OK) {
          String indexValue=dlg.getValue();
          InputMappingData data=new InputMappingData();
          data.setParameter(para);
          if (para.getParent() != null) {
            String name=((InputMappingData)items[0].getData()).getParameterName() + "String_Node_Str" + indexValue+ "String_Node_Str";
            data.setParameterName(name);
          }
 else {
            data.setParameterName(para.getName());
          }
          inputMappingList.size();
          expressinPutTableView.getExtendedTableModel().add(data,inputMappingList.size() + 1);
          expressTableForIn.select(currentElementIndexForIn);
          expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
        }
        return;
      }
      dialogInputList=new AddListDialog(shell,((InputMappingData)items[0].getData()).getParameter(),"String_Node_Str",URLValue,serverConfig);
      dialogInputList.setTitle(Messages.getString("String_Node_Str"));
      Rectangle boundsMapper=new Rectangle(50,50,100,50);
      if (ExternalWebServiceUIProperties.isShellMaximized()) {
        dialogInputList.setMaximized(ExternalWebServiceUIProperties.isShellMaximized());
      }
 else {
        boundsMapper=ExternalWebServiceUIProperties.getBoundsMapper();
        if (boundsMapper.x < 0) {
          boundsMapper.x=0;
        }
        if (boundsMapper.y < 0) {
          boundsMapper.y=0;
        }
        dialogInputList.setSize(boundsMapper);
        if (dialogInputList.open() == AddListDialog.OK) {
          multiSelectedInChildren=dialogInputList.getParamList();
          if (multiSelectedInChildren != null && !multiSelectedInChildren.isEmpty()) {
            int selectAmount=multiSelectedInChildren.size();
            for (int i=0; i < selectAmount; i++) {
              ParameterInfo paramet=multiSelectedInChildren.get(i);
              InputMappingData data=new InputMappingData();
              data.setParameter(paramet);
              if (paramet.getParent() != null) {
                String name=dialogInputList.getParaUtil().getArrayFullName(paramet);
                if (name.contains("String_Node_Str") && name.contains("String_Node_Str")) {
                  int index=name.indexOf("String_Node_Str");
                  name=name.substring(0,index);
                }
                if (name.contains("String_Node_Str")) {
                  name=name.substring(0,10) + "String_Node_Str" + name.substring(11,name.length());
                }
                data.setParameterName(name);
              }
 else {
                data.setParameterName(paramet.getName());
              }
              if (currentElementIndexForIn == 0) {
                expressinPutTableView.getExtendedTableModel().add(data,-1);
              }
 else {
                expressinPutTableView.getExtendedTableModel().add(data,currentElementIndexForIn + i + 1);
              }
            }
            expressTableForIn.select(currentElementIndexForIn);
            expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
          }
 else {
            currentSelectedInChildren=dialogInputList.getSelectedParaInfo();
            if (currentSelectedInChildren == null || currentSelectedInChildren.getName() == null) {
              return;
            }
            if (currentElementIndexForIn >= 0) {
              InputMappingData data=new InputMappingData();
              data.setParameter(currentSelectedInChildren);
              if (currentSelectedInChildren.getParent() != null) {
                String name=dialogInputList.getParaUtil().getArrayFullName(currentSelectedInChildren);
                String element=name.substring(name.lastIndexOf("String_Node_Str"),name.length());
                data.setParameterName(name);
              }
 else {
                data.setParameterName(currentSelectedInChildren.getName());
              }
              if (currentElementIndexForIn == 0) {
                expressinPutTableView.getExtendedTableModel().add(data,-1);
              }
 else {
                expressinPutTableView.getExtendedTableModel().add(data,currentElementIndexForIn + 1);
              }
              expressTableForIn.select(currentElementIndexForIn);
              expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
            }
          }
        }
      }
    }
  }
);
  removeButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TableItem[] items=expressTableForIn.getSelection();
      for (      TableItem item : items) {
        InputMappingData info=(InputMappingData)item.getData();
        expressinPutTableView.getExtendedTableModel().remove(info);
      }
      items=expressTableForIn.getSelection();
      if ((((InputMappingData)items[0].getData()).getParameter()).getParameterInfos().size() == 0) {
        addListButForIn.setEnabled(false);
      }
      if ((((InputMappingData)items[0].getData()).getParameter()).getParent() == null) {
        removeButForIn.setEnabled(false);
      }
      expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
    }
  }
);
  normalizeButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String columnName=currentInputMappingData.getInputColumnValue();
      if (!(columnName.contains("String_Node_Str") && columnName.contains("String_Node_Str"))) {
        ExtendedTableModel model=expressinPutTableView.getExtendedTableModel();
        currentInputMappingData.setInputColumnValue("String_Node_Str" + columnName + "String_Node_Str");
        model.remove(currentElementIndexForIn);
        model.add(currentInputMappingData,currentElementIndexForIn);
      }
    }
  }
);
  denorButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String columnName=currentInputMappingData.getInputColumnValue();
      if (!(columnName.contains("String_Node_Str") && columnName.contains("String_Node_Str"))) {
        ExtendedTableModel model=expressinPutTableView.getExtendedTableModel();
        currentInputMappingData.setInputColumnValue("String_Node_Str" + columnName + "String_Node_Str");
        model.remove(currentElementIndexForIn);
        model.add(currentInputMappingData,currentElementIndexForIn);
      }
    }
  }
);
}

Fixed version (ground truth):
private void addListenerForInputCom(){
  rowTableForin.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
    }
  }
);
  expressTableForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TableItem[] selectedItem=expressTableForIn.getSelection();
      currentElementIndexForIn=expressTableForIn.getSelectionIndex();
      currentInputMappingData=(InputMappingData)selectedItem[0].getData();
      if (currentInputMappingData.getParameter() == null) {
        return;
      }
      List<ParameterInfo> infoList=currentInputMappingData.getParameter().getParameterInfos();
      Boolean isArray=false;
      String isArrayName=currentInputMappingData.getParameterName();
      if ((currentInputMappingData.getParameter().getArraySize() == -1 || currentInputMappingData.getParameter().getArraySize() > 1) && !isArrayName.endsWith("String_Node_Str")) {
        isArray=true;
      }
      if (isArrayName.contains("String_Node_Str")) {
        isArray=true;
      }
      ParameterInfo infoPa=currentInputMappingData.getParameter().getParent();
      if (infoList != null && infoList.size() > 0 || isArray) {
        addListButForIn.setEnabled(true);
      }
 else {
        addListButForIn.setEnabled(false);
      }
      if (infoPa != null) {
        removeButForIn.setEnabled(true);
      }
 else {
        removeButForIn.setEnabled(false);
      }
      List<IMetadataColumn> columnList=currentInputMappingData.getMetadataColumnList();
      if (columnList != null && columnList.size() != 1) {
        normalizeButForIn.setEnabled(false);
        denorButForIn.setEnabled(false);
      }
 else       if (columnList != null && columnList.size() == 1) {
        IMetadataColumn column=columnList.get(0);
        if (column == null) {
          return;
        }
        if (column.getTalendType().equals("String_Node_Str") && !isArray && !currentInputMappingData.getInputColumnValue().contains("String_Node_Str")) {
          denorButForIn.setEnabled(true);
        }
 else {
          denorButForIn.setEnabled(false);
        }
        if (!column.getTalendType().equals("String_Node_Str") && isArray && !currentInputMappingData.getInputColumnValue().contains("String_Node_Str")) {
          normalizeButForIn.setEnabled(true);
        }
 else {
          normalizeButForIn.setEnabled(false);
        }
      }
    }
  }
);
  inputschemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Shell shell=uiParent.getShell();
      MetadataTable inmetadataTable=null;
      if (connection != null) {
        Set<org.talend.core.model.metadata.builder.connection.MetadataTable> tables=ConnectionHelper.getTables(connection);
        Iterator it=tables.iterator();
        while (it.hasNext()) {
          org.talend.core.model.metadata.builder.connection.MetadataTable metadatatable=(org.talend.core.model.metadata.builder.connection.MetadataTable)it.next();
          if (metadatatable.getLabel().equals("String_Node_Str")) {
            inmetadataTable=metadatatable;
          }
        }
      }
 else {
        inmetadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
        inmetadataTable.setLabel("String_Node_Str");
        EList schemaMetadataColumn=inmetadataTable.getColumns();
        for (int i=0; i < inPutcolumnList.size(); i++) {
          org.talend.core.model.metadata.MetadataColumn metadatacolumn=(org.talend.core.model.metadata.MetadataColumn)inPutcolumnList.get(i);
          MetadataColumn column=ConnectionFactory.eINSTANCE.createMetadataColumn();
          column.setLabel(metadatacolumn.getLabel());
          column.setTalendType(metadatacolumn.getTalendType());
          column.setOriginalField(metadatacolumn.getLabel());
          schemaMetadataColumn.add(column);
        }
      }
      WSDLSchemaDialog dialog=new WSDLSchemaDialog(shell,inmetadataTable);
      EList columnList=inmetadataTable.getColumns();
      if (dialog != null && dialog.open() == WSDLSchemaDialog.OK) {
        IMetadataTable inputMetadataTable=connector.getMetadataFromConnector("String_Node_Str");
        inputMetadataTable.getListColumns().clear();
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        List<org.talend.core.model.metadata.IMetadataColumn> llist=new ArrayList<org.talend.core.model.metadata.IMetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          org.talend.core.model.metadata.MetadataColumn metadatacolumn=new org.talend.core.model.metadata.MetadataColumn();
          metadatacolumn.setLabel(column.getLabel());
          metadatacolumn.setTalendType(column.getTalendType());
          metadatacolumn.setOriginalDbColumnName(column.getLabel());
          llist.add(metadatacolumn);
        }
        inPutcolumnList.clear();
        inPutcolumnList.addAll(llist);
        if (inputMetaCopy != null) {
          inputMetaCopy.getListColumns().clear();
          inputMetaCopy.setListColumns(llist);
        }
        inputMetadataTable.setListColumns(llist);
        columnInPutTableView.getTableViewerCreator().getTableViewer().refresh();
        synchronizeInputLinks(tabTotabLinkForin,llist);
      }
    }
  }
);
  addListButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      Shell shell=uiParent.getShell();
      TableItem[] items=expressTableForIn.getSelection();
      if (items.length <= 0) {
        return;
      }
      ParameterInfo para=((InputMappingData)items[0].getData()).getParameter();
      if (para.getArraySize() == -1 && para.getParameterInfos().isEmpty()) {
        InputDialog dlg=new InputDialog(shell,"String_Node_Str",Messages.getString("String_Node_Str"),"String_Node_Str",new InputIndexValidator());
        if (dlg.open() == dlg.OK) {
          String indexValue=dlg.getValue();
          InputMappingData data=new InputMappingData();
          data.setParameter(para);
          if (para.getParent() != null) {
            String name=((InputMappingData)items[0].getData()).getParameterName() + "String_Node_Str" + indexValue+ "String_Node_Str";
            data.setParameterName(name);
          }
 else {
            data.setParameterName(para.getName());
          }
          inputMappingList.size();
          expressinPutTableView.getExtendedTableModel().add(data,inputMappingList.size() + 1);
          expressTableForIn.select(currentElementIndexForIn);
          expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
        }
        return;
      }
      dialogInputList=new AddListDialog(shell,((InputMappingData)items[0].getData()).getParameter(),"String_Node_Str",URLValue,serverConfig);
      dialogInputList.setTitle(Messages.getString("String_Node_Str"));
      Rectangle boundsMapper=new Rectangle(50,50,100,50);
      if (ExternalWebServiceUIProperties.isShellMaximized()) {
        dialogInputList.setMaximized(ExternalWebServiceUIProperties.isShellMaximized());
      }
 else {
        boundsMapper=ExternalWebServiceUIProperties.getBoundsMapper();
        if (boundsMapper.x < 0) {
          boundsMapper.x=0;
        }
        if (boundsMapper.y < 0) {
          boundsMapper.y=0;
        }
        dialogInputList.setSize(boundsMapper);
        if (dialogInputList.open() == AddListDialog.OK) {
          multiSelectedInChildren=dialogInputList.getParamList();
          if (multiSelectedInChildren != null && !multiSelectedInChildren.isEmpty()) {
            int selectAmount=multiSelectedInChildren.size();
            for (int i=0; i < selectAmount; i++) {
              ParameterInfo paramet=multiSelectedInChildren.get(i);
              InputMappingData data=new InputMappingData();
              data.setParameter(paramet);
              if (paramet.getParent() != null) {
                String name=dialogInputList.getParaUtil().getArrayFullName(paramet);
                if (name.contains("String_Node_Str") && name.contains("String_Node_Str")) {
                  int index=name.indexOf("String_Node_Str");
                  name=name.substring(0,index);
                }
                if (name.contains("String_Node_Str")) {
                  name=name.substring(0,10) + "String_Node_Str" + name.substring(11,name.length());
                }
                data.setParameterName(name);
              }
 else {
                data.setParameterName(paramet.getName());
              }
              if (currentElementIndexForIn == 0) {
                expressinPutTableView.getExtendedTableModel().add(data,-1);
              }
 else {
                expressinPutTableView.getExtendedTableModel().add(data,currentElementIndexForIn + i + 1);
              }
            }
            expressTableForIn.select(currentElementIndexForIn);
            expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
          }
 else {
            currentSelectedInChildren=dialogInputList.getSelectedParaInfo();
            if (currentSelectedInChildren == null || currentSelectedInChildren.getName() == null) {
              return;
            }
            if (currentElementIndexForIn >= 0) {
              InputMappingData data=new InputMappingData();
              data.setParameter(currentSelectedInChildren);
              if (currentSelectedInChildren.getParent() != null) {
                String name=dialogInputList.getParaUtil().getArrayFullName(currentSelectedInChildren);
                String element=name.substring(name.lastIndexOf("String_Node_Str"),name.length());
                data.setParameterName(name);
              }
 else {
                data.setParameterName(currentSelectedInChildren.getName());
              }
              if (currentElementIndexForIn == 0) {
                expressinPutTableView.getExtendedTableModel().add(data,-1);
              }
 else {
                expressinPutTableView.getExtendedTableModel().add(data,currentElementIndexForIn + 1);
              }
              expressTableForIn.select(currentElementIndexForIn);
              expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
            }
          }
        }
      }
    }
  }
);
  removeButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      TableItem[] items=expressTableForIn.getSelection();
      for (      TableItem item : items) {
        InputMappingData info=(InputMappingData)item.getData();
        List<LinkDescriptor<TableItem,Object,Table,Object>> links=tabTotabLinkForin.getLinksManager().getLinks();
        List<LinkDescriptor<TableItem,Object,Table,Object>> removeLinks=new ArrayList<LinkDescriptor<TableItem,Object,Table,Object>>();
        for (        LinkDescriptor<TableItem,Object,Table,Object> link : links) {
          InputMappingData dataItem=(InputMappingData)link.getExtremity2().getDataItem();
          if (info == dataItem) {
            removeLinks.add(link);
          }
        }
        for (        LinkDescriptor<TableItem,Object,Table,Object> link : removeLinks) {
          tabTotabLinkForin.getLinksManager().removeLink(link);
        }
        tabTotabLinkForin.getBackgroundRefresher().refreshBackground();
        expressinPutTableView.getExtendedTableModel().remove(info);
      }
      items=expressTableForIn.getSelection();
      if ((((InputMappingData)items[0].getData()).getParameter()).getParameterInfos().size() == 0) {
        addListButForIn.setEnabled(false);
      }
      if ((((InputMappingData)items[0].getData()).getParameter()).getParent() == null) {
        removeButForIn.setEnabled(false);
      }
      expressinPutTableView.getTableViewerCreator().getTableViewer().refresh();
    }
  }
);
  normalizeButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String columnName=currentInputMappingData.getInputColumnValue();
      if (!(columnName.contains("String_Node_Str") && columnName.contains("String_Node_Str"))) {
        ExtendedTableModel model=expressinPutTableView.getExtendedTableModel();
        currentInputMappingData.setInputColumnValue("String_Node_Str" + columnName + "String_Node_Str");
        model.remove(currentElementIndexForIn);
        model.add(currentInputMappingData,currentElementIndexForIn);
      }
    }
  }
);
  denorButForIn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String columnName=currentInputMappingData.getInputColumnValue();
      if (!(columnName.contains("String_Node_Str") && columnName.contains("String_Node_Str"))) {
        ExtendedTableModel model=expressinPutTableView.getExtendedTableModel();
        currentInputMappingData.setInputColumnValue("String_Node_Str" + columnName + "String_Node_Str");
        model.remove(currentElementIndexForIn);
        model.add(currentInputMappingData,currentElementIndexForIn);
      }
    }
  }
);
}