nus-yam/ex-repair huggingface dataset:
Program: 127628
Project: 127628
Buggy source:
public void widgetSelected(SelectionEvent event){
  Widget widget=event.widget;
  if (widget == addButton) {
    addPressed();
  }
 else   if (widget == removeButton) {
    removePressed();
  }
 else   if (widget == upButton) {
    upPressed();
  }
 else   if (widget == downButton) {
    downPressed();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent event){
  Widget widget=event.widget;
  if (widget == addButton) {
    addPressed();
  }
 else   if (widget == removeButton) {
    removePressed();
  }
 else   if (widget == upButton) {
    upPressed();
  }
 else   if (widget == downButton) {
    downPressed();
  }
}
Program: 127629
Project: 127629
Buggy source:
public void setFocus(){
  if (viewer != null) {
    viewer.getTable().setFocus();
  }
}

Fixed version (ground truth):
@Override public void setFocus(){
  if (viewer != null) {
    viewer.getTable().setFocus();
  }
}
Program: 127630
Project: 127630
Buggy source:
/** 
 * Creates a selection listener.
 */
public void createSelectionListener(){
  selectionListener=new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent event){
      Widget widget=event.widget;
      if (widget == addButton) {
        addPressed();
      }
 else       if (widget == removeButton) {
        removePressed();
      }
 else       if (widget == upButton) {
        upPressed();
      }
 else       if (widget == downButton) {
        downPressed();
      }
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates a selection listener.
 */
public void createSelectionListener(){
  selectionListener=new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent event){
      Widget widget=event.widget;
      if (widget == addButton) {
        addPressed();
      }
 else       if (widget == removeButton) {
        removePressed();
      }
 else       if (widget == upButton) {
        upPressed();
      }
 else       if (widget == downButton) {
        downPressed();
      }
    }
  }
;
}
Program: 127631
Project: 127631
Buggy source:
public void setEnabled(boolean enabled,Composite parent){
  super.setEnabled(enabled,parent);
  setControlEnable(getTableControl(parent).getTable(),enabled);
  setControlEnable(addButton,enabled);
  setControlEnable(removeButton,enabled);
  setControlEnable(upButton,enabled);
  setControlEnable(downButton,enabled);
}

Fixed version (ground truth):
@Override public void setEnabled(boolean enabled,Composite parent){
  super.setEnabled(enabled,parent);
  setControlEnable(getTableControl(parent).getTable(),enabled);
  setControlEnable(addButton,enabled);
  setControlEnable(removeButton,enabled);
  setControlEnable(upButton,enabled);
  setControlEnable(downButton,enabled);
}
Program: 127632
Project: 127632
Buggy source:
protected void doLoad(){
  if (viewer != null) {
    String s=getPreferenceStore().getString(getPreferenceName());
    if (s != null && !"String_Node_Str".equals(s)) {
      for (      String tmp : readString(s)) {
        list.add(tmp);
      }
    }
    viewer.setInput(list);
  }
}

Fixed version (ground truth):
@Override protected void doLoad(){
  if (viewer != null) {
    String s=getPreferenceStore().getString(getPreferenceName());
    if (s != null && !"String_Node_Str".equals(s)) {
      for (      String tmp : readString(s)) {
        list.add(tmp);
      }
    }
    viewer.setInput(list);
  }
}
Program: 127633
Project: 127633
Buggy source:
protected void doStore(){
  String s=writeString(list);
  if (s != null) {
    getPreferenceStore().setValue(getPreferenceName(),s);
  }
}

Fixed version (ground truth):
@Override protected void doStore(){
  String s=writeString(list);
  if (s != null) {
    getPreferenceStore().setValue(getPreferenceName(),s);
  }
}
Program: 127634
Project: 127634
Buggy source:
protected void adjustForNumColumns(int numColumns){
  Control control=getLabelControl();
  ((GridData)control.getLayoutData()).horizontalSpan=numColumns;
  ((GridData)viewer.getTable().getLayoutData()).horizontalSpan=numColumns - 1;
}

Fixed version (ground truth):
@Override protected void adjustForNumColumns(int numColumns){
  Control control=getLabelControl();
  ((GridData)control.getLayoutData()).horizontalSpan=numColumns;
  ((GridData)viewer.getTable().getLayoutData()).horizontalSpan=numColumns - 1;
}
Program: 127639
Project: 127639
Buggy source:
protected void editItem(ISelection sel){
  IStructuredSelection selection=(IStructuredSelection)sel;
  String existing=(String)selection.getFirstElement();
  String value=getExistingInputObject(existing);
  if (value != null) {
    int indexOf=list.indexOf(existing);
    list.remove(existing);
    list.add(indexOf,value);
    viewer.refresh();
  }
}

Fixed version (ground truth):
protected void editItem(ISelection sel){
  IStructuredSelection selection=(IStructuredSelection)sel;
  String existing=(String)selection.getFirstElement();
  String value=getExistingInputObject(existing.replace("String_Node_Str","String_Node_Str"));
  if (value != null) {
    int indexOf=list.indexOf(existing);
    list.remove(existing);
    list.add(indexOf,value);
    viewer.refresh();
  }
}
Program: 127640
Project: 127640
Buggy source:
public static String addQuotesWithSpaceField(String fieldName,String dbType){
  if (fieldName == null) {
    fieldName="String_Node_Str";
  }
  if (fieldName.startsWith("String_Node_Str") && fieldName.endsWith("String_Node_Str")) {
    return fieldName;
  }
  boolean b=true;
  for (int i=0; i < fieldName.length(); i++) {
    char c=fieldName.charAt(i);
    b=b && c >= '0' && c <= '9';
  }
  EDatabaseTypeName name=EDatabaseTypeName.getTypeFromDbType(dbType);
  if (name.equals(EDatabaseTypeName.MYSQL) && fieldName.contains(JAVA_END_STRING)) {
    String newFieldName=TalendQuoteUtils.addQuotes(fieldName);
    return newFieldName;
  }
  boolean isCheck=!CorePlugin.getDefault().getPreferenceStore().getBoolean(ITalendCorePrefConstants.SQL_ADD_QUOTE);
  if (!b) {
    if (isCheck && isPSQLSimilar(name)) {
      return fieldName;
    }
  }
  String newFieldName=fieldName;
  String quote=getQuoteByDBType(name);
  if (!newFieldName.contains(quote)) {
    newFieldName=addQuotes(newFieldName,quote);
  }
  return newFieldName;
}

Fixed version (ground truth):
public static String addQuotesWithSpaceField(String fieldName,String dbType){
  if (fieldName == null) {
    fieldName="String_Node_Str";
  }
  if (fieldName.startsWith("String_Node_Str") && fieldName.endsWith("String_Node_Str")) {
    return fieldName;
  }
  boolean b=true;
  for (int i=0; i < fieldName.length(); i++) {
    char c=fieldName.charAt(i);
    b=b && c >= '0' && c <= '9';
  }
  EDatabaseTypeName name=EDatabaseTypeName.getTypeFromDbType(dbType);
  if (name.equals(EDatabaseTypeName.MYSQL) && fieldName.contains(JAVA_END_STRING)) {
    String newFieldName="String_Node_Str" + fieldName + "String_Node_Str";
    return newFieldName;
  }
  boolean isCheck=!CorePlugin.getDefault().getPreferenceStore().getBoolean(ITalendCorePrefConstants.SQL_ADD_QUOTE);
  if (!b) {
    if (isCheck && isPSQLSimilar(name)) {
      return fieldName;
    }
  }
  String newFieldName=fieldName;
  String quote=getQuoteByDBType(name);
  if (!newFieldName.contains(quote)) {
    newFieldName=addQuotes(newFieldName,quote);
  }
  return newFieldName;
}
Program: 127643
Project: 127643
Buggy source:
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}

Fixed version (ground truth):
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
 else {
      node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metaColumn));
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}
Program: 127647
Project: 127647
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean valid=false;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      valid=true;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return valid;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean visitChildren=false;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      visitChildren=false;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return visitChildren;
}
Program: 127648
Project: 127648
Buggy source:
private void updateXmlTreeViewer(){
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (ex1.getGraphicalObject() != null) {
      Item item=ex1.getGraphicalObject();
      if (!item.isDisposed() && metaColumn.equals(item.getData())) {
        node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metaColumn));
      }
 else {
        node.setColumn(null);
      }
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}

Fixed version (ground truth):
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}
Program: 127649
Project: 127649
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
  if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
    MetadataTable metadataTable=dialog.getMetadataTable();
    EList columns=metadataTable.getColumns();
    List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn column=(MetadataColumn)columns.get(i);
      inputList.add(column);
    }
    schemaViewer.setInput(inputList);
    schemaViewer.refresh();
    EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
    columnList.clear();
    columnList.addAll(inputList);
    updateXmlTreeViewer();
    redrawLinkers();
    checkFieldsValue();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
  if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
    MetadataTable metadataTable=dialog.getMetadataTable();
    EList columns=metadataTable.getColumns();
    List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn column=(MetadataColumn)columns.get(i);
      inputList.add(column);
    }
    schemaViewer.setInput(inputList);
    schemaViewer.refresh();
    EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
    columnList.clear();
    columnList.addAll(inputList);
    updateXmlTreeViewer(inputList);
    redrawLinkers();
    checkFieldsValue();
  }
}
Program: 127650
Project: 127650
Buggy source:
@Override protected void addUtilsButtonListeners(){
  schemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
      if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          inputList.add(column);
        }
        schemaViewer.setInput(inputList);
        schemaViewer.refresh();
        EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
        columnList.clear();
        columnList.addAll(inputList);
        updateXmlTreeViewer();
        redrawLinkers();
        checkFieldsValue();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addUtilsButtonListeners(){
  schemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
      if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          inputList.add(column);
        }
        schemaViewer.setInput(inputList);
        schemaViewer.refresh();
        EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
        columnList.clear();
        columnList.addAll(inputList);
        updateXmlTreeViewer(inputList);
        redrawLinkers();
        checkFieldsValue();
      }
    }
  }
);
}
Program: 127651
Project: 127651
Buggy source:
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
public void init(final IWorkbench workbench,final IStructuredSelection selection2){
  this.selection=selection2;
}

Fixed version (ground truth):
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
@Override public void init(final IWorkbench workbench,final IStructuredSelection selection2){
  this.selection=selection2;
}
Program: 127652
Project: 127652
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    throw new InvocationTargetException(e);
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    throw new InvocationTargetException(e);
  }
}
Program: 127653
Project: 127653
Buggy source:
/** 
 * clone a new DB connection
 */
private void cloneBaseConnection(SalesforceSchemaConnection connection){
  temConnection=(SalesforceSchemaConnection)EcoreUtil.copy(connection);
  EList<Package> dataPackage=connection.getDataPackage();
  Collection<Package> newDataPackage=EcoreUtil.copyAll(dataPackage);
  ConnectionHelper.addPackages(newDataPackage,temConnection);
}

Fixed version (ground truth):
/** 
 * clone a new DB connection
 */
private void cloneBaseConnection(SalesforceSchemaConnection connection){
  temConnection=EcoreUtil.copy(connection);
  EList<Package> dataPackage=connection.getDataPackage();
  Collection<Package> newDataPackage=EcoreUtil.copyAll(dataPackage);
  ConnectionHelper.addPackages(newDataPackage,temConnection);
}
Program: 127655
Project: 127655
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean valid=false;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      valid=true;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return valid;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean visitChildren=true;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      visitChildren=false;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return visitChildren;
}
Program: 127656
Project: 127656
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
      return false;
    }
 else {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean valid=false;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      valid=true;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return valid;
}
Program: 127658
Project: 127658
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean valid=false;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      valid=true;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return valid;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean visitChildren=true;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      visitChildren=false;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return visitChildren;
}
Program: 127659
Project: 127659
Buggy source:
private void updateXmlTreeViewer(){
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (ex1.getGraphicalObject() != null) {
      Item item=ex1.getGraphicalObject();
      if (!item.isDisposed() && metaColumn.equals(item.getData())) {
        node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metaColumn));
      }
 else {
        node.setColumn(null);
      }
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}

Fixed version (ground truth):
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}
Program: 127660
Project: 127660
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
  if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
    MetadataTable metadataTable=dialog.getMetadataTable();
    EList columns=metadataTable.getColumns();
    List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn column=(MetadataColumn)columns.get(i);
      inputList.add(column);
    }
    schemaViewer.setInput(inputList);
    schemaViewer.refresh();
    EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
    columnList.clear();
    columnList.addAll(inputList);
    updateXmlTreeViewer();
    redrawLinkers();
    checkFieldsValue();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
  if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
    MetadataTable metadataTable=dialog.getMetadataTable();
    EList columns=metadataTable.getColumns();
    List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn column=(MetadataColumn)columns.get(i);
      inputList.add(column);
    }
    schemaViewer.setInput(inputList);
    schemaViewer.refresh();
    EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
    columnList.clear();
    columnList.addAll(inputList);
    updateXmlTreeViewer(inputList);
    redrawLinkers();
    checkFieldsValue();
  }
}
Program: 127661
Project: 127661
Buggy source:
@Override protected void addUtilsButtonListeners(){
  schemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
      if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          inputList.add(column);
        }
        schemaViewer.setInput(inputList);
        schemaViewer.refresh();
        EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
        columnList.clear();
        columnList.addAll(inputList);
        updateXmlTreeViewer();
        redrawLinkers();
        checkFieldsValue();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addUtilsButtonListeners(){
  schemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
      if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          inputList.add(column);
        }
        schemaViewer.setInput(inputList);
        schemaViewer.refresh();
        EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
        columnList.clear();
        columnList.addAll(inputList);
        updateXmlTreeViewer(inputList);
        redrawLinkers();
        checkFieldsValue();
      }
    }
  }
);
}
Program: 127662
Project: 127662
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
      return false;
    }
 else {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean valid=false;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      valid=true;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return valid;
}
Program: 127663
Project: 127663
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setLabel(String newLabel){
  String oldLabel=label;
  label=newLabel;
  if (!StringUtils.isEmpty(newLabel)) {
    setName(newLabel);
  }
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,ConnectionPackage.ABSTRACT_METADATA_OBJECT__LABEL,oldLabel,label));
  }
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public void setLabel(String newLabel){
  String oldLabel=label;
  label=newLabel;
  String COLUMN_NAME_PATTERN="String_Node_Str";
  if (!StringUtils.isEmpty(newLabel) && name != null ? Pattern.matches(COLUMN_NAME_PATTERN,name) : true) {
    setName(newLabel);
  }
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,ConnectionPackage.ABSTRACT_METADATA_OBJECT__LABEL,oldLabel,label));
  }
}
Program: 127666
Project: 127666
Buggy source:
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}

Fixed version (ground truth):
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
 else {
      node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metaColumn));
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}
Program: 127667
Project: 127667
Buggy source:
@Override public IMetadataTable getMetadataTable(String metaName){
  return null;
}

Fixed version (ground truth):
@Override public IMetadataTable getMetadataTable(String metaName){
  for (int i=0; i < metadataList.size(); i++) {
    String tableName=metadataList.get(i).getTableName();
    if (tableName != null && tableName.equals(metaName)) {
      return metadataList.get(i);
    }
  }
  return null;
}
Program: 127668
Project: 127668
Buggy source:
@Override public IExternalData getExternalData(){
  return null;
}

Fixed version (ground truth):
@Override public IExternalData getExternalData(){
  if (externalNode != null) {
    return externalNode.getExternalData();
  }
  return null;
}
Program: 127669
Project: 127669
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
      return false;
    }
 else {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  boolean valid=false;
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      valid=true;
      if (viewer instanceof RepoViewCommonViewer) {
        runnables.add(new Runnable(){
          @Override public void run(){
            refreshTopLevelNode(repoNode);
          }
        }
);
      }
    }
  }
  return valid;
}
Program: 127670
Project: 127670
Buggy source:
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}

Fixed version (ground truth):
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
 else {
      node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metaColumn));
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}
Program: 127673
Project: 127673
Buggy source:
private void updateXmlTreeViewer(){
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (ex1.getGraphicalObject() != null) {
      Item item=ex1.getGraphicalObject();
      if (!item.isDisposed() && metaColumn.equals(item.getData())) {
        node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metaColumn));
      }
 else {
        node.setColumn(null);
      }
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}

Fixed version (ground truth):
private void updateXmlTreeViewer(List<MetadataColumn> metaColumns){
  List<String> cloumnNames=new ArrayList<String>();
  for (  MetadataColumn column : metaColumns) {
    cloumnNames.add(column.getName());
  }
  LinksManager<Item,Object,Tree,Object> linkManager=linker.getLinkManager();
  List<LinkDescriptor<Item,Object,Tree,Object>> links=linkManager.getLinks();
  for (int i=0; i < links.size(); i++) {
    LinkDescriptor<Item,Object,Tree,Object> linkDescriptor=links.get(i);
    IExtremityLink<Item,Object> ex1=linkDescriptor.getExtremity1();
    IExtremityLink<Tree,Object> ex2=linkDescriptor.getExtremity2();
    MetadataColumn metaColumn=(MetadataColumn)ex1.getDataItem();
    FOXTreeNode node=(FOXTreeNode)ex2.getDataItem();
    if (!cloumnNames.contains(metaColumn.getName())) {
      node.setColumn(null);
    }
    node.setDataType(metaColumn.getTalendType());
  }
  xmlViewer.refresh();
  updateConnection();
}
Program: 127674
Project: 127674
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
  if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
    MetadataTable metadataTable=dialog.getMetadataTable();
    EList columns=metadataTable.getColumns();
    List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn column=(MetadataColumn)columns.get(i);
      inputList.add(column);
    }
    schemaViewer.setInput(inputList);
    schemaViewer.refresh();
    EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
    columnList.clear();
    columnList.addAll(inputList);
    updateXmlTreeViewer();
    redrawLinkers();
    checkFieldsValue();
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
  if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
    MetadataTable metadataTable=dialog.getMetadataTable();
    EList columns=metadataTable.getColumns();
    List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
    for (int i=0; i < columns.size(); i++) {
      MetadataColumn column=(MetadataColumn)columns.get(i);
      inputList.add(column);
    }
    schemaViewer.setInput(inputList);
    schemaViewer.refresh();
    EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
    columnList.clear();
    columnList.addAll(inputList);
    updateXmlTreeViewer(inputList);
    redrawLinkers();
    checkFieldsValue();
  }
}
Program: 127675
Project: 127675
Buggy source:
@Override protected void addUtilsButtonListeners(){
  schemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
      if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          inputList.add(column);
        }
        schemaViewer.setInput(inputList);
        schemaViewer.refresh();
        EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
        columnList.clear();
        columnList.addAll(inputList);
        updateXmlTreeViewer();
        redrawLinkers();
        checkFieldsValue();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addUtilsButtonListeners(){
  schemaButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      XmlFileSchemaDialog dialog=new XmlFileSchemaDialog(mainSashFormComposite.getShell(),XmlFileOutputStep2Form.this);
      if (dialog != null && dialog.open() == XmlFileSchemaDialog.OK) {
        MetadataTable metadataTable=dialog.getMetadataTable();
        EList columns=metadataTable.getColumns();
        List<MetadataColumn> inputList=new ArrayList<MetadataColumn>();
        for (int i=0; i < columns.size(); i++) {
          MetadataColumn column=(MetadataColumn)columns.get(i);
          inputList.add(column);
        }
        schemaViewer.setInput(inputList);
        schemaViewer.refresh();
        EList columnList=ConnectionHelper.getTables(getConnection()).toArray(new MetadataTable[0])[0].getColumns();
        columnList.clear();
        columnList.addAll(inputList);
        updateXmlTreeViewer(inputList);
        redrawLinkers();
        checkFieldsValue();
      }
    }
  }
);
}
Program: 127676
Project: 127676
Buggy source:
@Override public IMetadataTable getMetadataTable(String metaName){
  return null;
}

Fixed version (ground truth):
@Override public IMetadataTable getMetadataTable(String metaName){
  for (int i=0; i < metadataList.size(); i++) {
    String tableName=metadataList.get(i).getTableName();
    if (tableName != null && tableName.equals(metaName)) {
      return metadataList.get(i);
    }
  }
  return null;
}
Program: 127677
Project: 127677
Buggy source:
@Override public IExternalData getExternalData(){
  return null;
}

Fixed version (ground truth):
@Override public IExternalData getExternalData(){
  if (externalNode != null) {
    return externalNode.getExternalData();
  }
  return null;
}
Program: 127679
Project: 127679
Buggy source:
private boolean validResourcePath(IResourceDelta delta,IPath topLevelNodeWorkspaceRelativePath,boolean refMerged){
  if (ingoreResource(delta)) {
    return false;
  }
  IResourceDelta[] affectedChildren=delta.getAffectedChildren();
  IResource res=delta.getResource();
  IPath path=delta.getFullPath();
  boolean noChild=(affectedChildren == null || (affectedChildren.length == 0));
  if (path != null && noChild && (FileConstants.PROPERTIES_EXTENSION.equals(path.getFileExtension()) || (res instanceof IContainer))) {
    if (isMatchedPath(topLevelNodeWorkspaceRelativePath,path)) {
      return true;
    }
 else     if (refMerged) {
      if (res != null) {
        path=res.getProjectRelativePath();
      }
 else {
        path=path.removeFirstSegments(1);
      }
      IPath relativePath=topLevelNodeWorkspaceRelativePath.removeFirstSegments(1);
      if (isMatchedPath(relativePath,path)) {
        return true;
      }
    }
  }
  if (affectedChildren != null) {
    for (    IResourceDelta child : affectedChildren) {
      if (validResourcePath(child,topLevelNodeWorkspaceRelativePath,refMerged)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean validResourcePath(IResourceDelta delta,IPath topLevelNodeWorkspaceRelativePath,boolean refMerged){
  if (ingoreResource(delta)) {
    return false;
  }
  IResourceDelta[] affectedChildren=delta.getAffectedChildren();
  IResource res=delta.getResource();
  IPath path=delta.getFullPath();
  boolean noChild=(affectedChildren == null || (affectedChildren.length == 0));
  if (!noChild && affectedChildren != null && affectedChildren.length == 1 && FilesUtils.isSVNFolder(affectedChildren[0].getResource())) {
    noChild=true;
  }
  if (path != null && noChild && (FileConstants.PROPERTIES_EXTENSION.equals(path.getFileExtension()) || (res instanceof IContainer))) {
    if (isMatchedPath(topLevelNodeWorkspaceRelativePath,path)) {
      return true;
    }
 else     if (refMerged) {
      if (res != null) {
        path=res.getProjectRelativePath();
      }
 else {
        path=path.removeFirstSegments(1);
      }
      IPath relativePath=topLevelNodeWorkspaceRelativePath.removeFirstSegments(1);
      if (isMatchedPath(relativePath,path)) {
        return true;
      }
    }
  }
  if (affectedChildren != null) {
    for (    IResourceDelta child : affectedChildren) {
      if (validResourcePath(child,topLevelNodeWorkspaceRelativePath,refMerged)) {
        return true;
      }
    }
  }
  return false;
}