nus-yam/ex-repair huggingface dataset:
Program: 123207
Project: 123207
Buggy source:
public void shellClosed(ShellEvent e){
  if (mapperManager.isDataChanged() && !mapperManager.getUiManager().isCloseWithoutPrompt()) {
    boolean closeWindow=MessageDialog.openConfirm(mapperShellFinal,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!closeWindow) {
      e.doit=false;
    }
 else {
      mapperManager.getAbstractMapComponent().setExternalData(mapperManager.getOriginalExternalData());
      mapperManager.getUiManager().prepareClosing(SWT.CANCEL);
    }
  }
}

Fixed version (ground truth):
public void shellClosed(ShellEvent e){
  UIManager uiManager=mapperManager.getUiManager();
  if (uiManager.getMapperResponse() == SWT.NONE) {
    for (    DataMapTableView dataMapTableView : uiManager.getInputsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    for (    DataMapTableView dataMapTableView : uiManager.getOutputsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    for (    DataMapTableView dataMapTableView : uiManager.getVarsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    uiManager.setMapperResponse(SWT.CANCEL);
    uiManager.prepareClosing(uiManager.getMapperResponse());
  }
  if (mapperManager.isDataChanged() && !mapperManager.getUiManager().isCloseWithoutPrompt()) {
    boolean closeWindow=MessageDialog.openConfirm(mapperShellFinal,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!closeWindow) {
      e.doit=false;
    }
 else {
      mapperManager.getAbstractMapComponent().setExternalData(mapperManager.getOriginalExternalData());
      mapperManager.getUiManager().prepareClosing(SWT.CANCEL);
    }
  }
}
Program: 123211
Project: 123211
Buggy source:
public void shellClosed(ShellEvent e){
  if (mapperManager.isDataChanged() && !mapperManager.getUiManager().isCloseWithoutPrompt()) {
    boolean closeWindow=MessageDialog.openConfirm(mapperShellFinal,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!closeWindow) {
      e.doit=false;
    }
 else {
      mapperManager.getAbstractMapComponent().setExternalData(mapperManager.getOriginalExternalData());
      mapperManager.getUiManager().prepareClosing(SWT.CANCEL);
    }
  }
}

Fixed version (ground truth):
public void shellClosed(ShellEvent e){
  UIManager uiManager=mapperManager.getUiManager();
  if (uiManager.getMapperResponse() == SWT.NONE) {
    for (    DataMapTableView dataMapTableView : uiManager.getInputsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    for (    DataMapTableView dataMapTableView : uiManager.getOutputsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    for (    DataMapTableView dataMapTableView : uiManager.getVarsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    uiManager.setMapperResponse(SWT.CANCEL);
    uiManager.prepareClosing(uiManager.getMapperResponse());
  }
  if (mapperManager.isDataChanged() && !mapperManager.getUiManager().isCloseWithoutPrompt()) {
    boolean closeWindow=MessageDialog.openConfirm(mapperShellFinal,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!closeWindow) {
      e.doit=false;
    }
 else {
      mapperManager.getAbstractMapComponent().setExternalData(mapperManager.getOriginalExternalData());
      mapperManager.getUiManager().prepareClosing(SWT.CANCEL);
    }
  }
}
Program: 123215
Project: 123215
Buggy source:
@Override public void propertyChanged(Object source,int propId){
  if (getEditor(2).isDirty()) {
    getProcess().setProcessModified(true);
    getProcess().setNeedRegenerateCode(true);
  }
}

Fixed version (ground truth):
@Override public void propertyChanged(Object source,int propId){
  if (source instanceof IEditorPart && ((IEditorPart)source).isDirty()) {
    getProcess().setProcessModified(true);
    getProcess().setNeedRegenerateCode(true);
  }
}
Program: 123216
Project: 123216
Buggy source:
public void shellClosed(ShellEvent e){
  if (mapperManager.isDataChanged() && !mapperManager.getUiManager().isCloseWithoutPrompt()) {
    boolean closeWindow=MessageDialog.openConfirm(mapperShellFinal,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!closeWindow) {
      e.doit=false;
    }
 else {
      mapperManager.getAbstractMapComponent().setExternalData(mapperManager.getOriginalExternalData());
      mapperManager.getUiManager().prepareClosing(SWT.CANCEL);
    }
  }
}

Fixed version (ground truth):
public void shellClosed(ShellEvent e){
  UIManager uiManager=mapperManager.getUiManager();
  if (uiManager.getMapperResponse() == SWT.NONE) {
    for (    DataMapTableView dataMapTableView : uiManager.getInputsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    for (    DataMapTableView dataMapTableView : uiManager.getOutputsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    for (    DataMapTableView dataMapTableView : uiManager.getVarsTablesView()) {
      dataMapTableView.notifyFocusLost();
    }
    uiManager.setMapperResponse(SWT.CANCEL);
    uiManager.prepareClosing(uiManager.getMapperResponse());
  }
  if (mapperManager.isDataChanged() && !mapperManager.getUiManager().isCloseWithoutPrompt()) {
    boolean closeWindow=MessageDialog.openConfirm(mapperShellFinal,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!closeWindow) {
      e.doit=false;
    }
 else {
      mapperManager.getAbstractMapComponent().setExternalData(mapperManager.getOriginalExternalData());
      mapperManager.getUiManager().prepareClosing(SWT.CANCEL);
    }
  }
}
Program: 123218
Project: 123218
Buggy source:
/** 
 * qzhang Comment method "setProblemsView".
 * @param process
 */
private void setContextsView(IProcess2 process){
  IRunProcessService service=DesignerPlugin.getDefault().getRunProcessService();
  service.setActiveProcess(process,false);
  Contexts.switchToCurContextsView();
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "setProblemsView".
 * @param process
 */
private void setContextsView(IProcess2 process){
  IRunProcessService service=DesignerPlugin.getDefault().getRunProcessService();
  service.setActiveProcess(process,true);
  Contexts.switchToCurContextsView();
}
Program: 123220
Project: 123220
Buggy source:
/** 
 * qzhang Comment method "setProblemsView".
 * @param process
 */
private void setContextsView(IProcess2 process){
  IRunProcessService service=DesignerPlugin.getDefault().getRunProcessService();
  service.setActiveProcess(process,false);
  Contexts.switchToCurContextsView();
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "setProblemsView".
 * @param process
 */
private void setContextsView(IProcess2 process){
  IRunProcessService service=DesignerPlugin.getDefault().getRunProcessService();
  service.setActiveProcess(process,true);
  Contexts.switchToCurContextsView();
}
Program: 123222
Project: 123222
Buggy source:
/** 
 * yzhang ChangeOutputConnectionOrderCommand constructor comment.
 */
public ChangeOutputConnectionOrderCommand(INode multipleOutputNode,List<IConnection> outputConnections){
  this.multipleOutputNode=multipleOutputNode;
  this.connectionInNewOrder=outputConnections;
  this.connectionInOldOrder=(List<IConnection>)multipleOutputNode.getOutgoingConnections();
  if (connectionInNewOrder.size() != connectionInOldOrder.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setLabel(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * yzhang ChangeOutputConnectionOrderCommand constructor comment.
 */
public ChangeOutputConnectionOrderCommand(INode multipleOutputNode,List<IConnection> outputConnections){
  this.multipleOutputNode=multipleOutputNode;
  this.connectionInNewOrder=outputConnections;
  connectionInOldOrderClone.addAll(multipleOutputNode.getOutgoingConnections());
  this.connectionInOldOrder=connectionInOldOrderClone;
  if (connectionInNewOrder.size() != connectionInOldOrder.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setLabel(Messages.getString("String_Node_Str"));
}
Program: 123224
Project: 123224
Buggy source:
/** 
 * bug fix : items are not selected in database repository mode if the repository node is refresh and a new instance of the repository node is created we need to compare ids to select this nodes
 */
private void selectItems(TreeItem[] treeItems){
  CheckboxTreeViewer exportItemsTreeViewer=getExportItemsTreeViewer();
  for (  TreeItem treeItem : treeItems) {
    if (treeItem.getData() != null && treeItem.getData() instanceof RepositoryNode) {
      RepositoryNode repositoryNode=(RepositoryNode)treeItem.getData();
      for (      RepositoryNode repositoryNode2 : repositoryNodes) {
        if (repositoryNode.getId().equals(repositoryNode2.getId()))         exportItemsTreeViewer.setChecked(repositoryNode,true);
      }
    }
    selectItems(treeItem.getItems());
  }
}

Fixed version (ground truth):
/** 
 * bug fix : items are not selected in database repository mode if the repository node is refresh and a new instance of the repository node is created we need to compare ids to select this nodes
 */
private void selectItems(TreeItem[] treeItems){
  CheckboxTreeViewer exportItemsTreeViewer=getExportItemsTreeViewer();
  for (  TreeItem treeItem : treeItems) {
    if (treeItem.getData() != null && treeItem.getData() instanceof RepositoryNode) {
      RepositoryNode repositoryNode=(RepositoryNode)treeItem.getData();
      for (      RepositoryNode repositoryNode2 : repositoryNodes) {
        if (repositoryNode.getId().equals(repositoryNode2.getId())) {
          exportItemsTreeViewer.setChecked(repositoryNode,true);
        }
      }
    }
    selectItems(treeItem.getItems());
  }
}
Program: 123225
Project: 123225
Buggy source:
private void checkSelection(){
  if (jobScriptExportWizardPage == null) {
    return;
  }
  if (this.getCheckNodes().length == 0) {
    StringBuffer buff=new StringBuffer();
    buff.append(Messages.getString("String_Node_Str"));
    jobScriptExportWizardPage.setErrorMessage(buff.toString());
    jobScriptExportWizardPage.setPageComplete(false);
  }
 else {
    jobScriptExportWizardPage.setErrorMessage(null);
    jobScriptExportWizardPage.setPageComplete(true);
  }
}

Fixed version (ground truth):
protected void checkSelection(){
  if (jobScriptExportWizardPage == null) {
    return;
  }
  if (this.getCheckNodes().length == 0) {
    StringBuffer buff=new StringBuffer();
    buff.append(Messages.getString("String_Node_Str"));
    jobScriptExportWizardPage.setErrorMessage(buff.toString());
    jobScriptExportWizardPage.setPageComplete(false);
  }
 else {
    jobScriptExportWizardPage.setErrorMessage(null);
    jobScriptExportWizardPage.setPageComplete(true);
  }
}
Program: 123226
Project: 123226
Buggy source:
public RepositoryNode[] getCheckNodes(){
  List<RepositoryNode> ret=new ArrayList<RepositoryNode>();
  CheckboxTreeViewer exportItemsTreeViewer=getExportItemsTreeViewer();
  for (int i=0; i < exportItemsTreeViewer.getCheckedElements().length; i++) {
    RepositoryNode node=(RepositoryNode)exportItemsTreeViewer.getCheckedElements()[i];
    if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
      ret.add(node);
    }
  }
  return (RepositoryNode[])ret.toArray(new RepositoryNode[0]);
}

Fixed version (ground truth):
public RepositoryNode[] getCheckNodes(){
  List<RepositoryNode> ret=new ArrayList<RepositoryNode>();
  CheckboxTreeViewer exportItemsTreeViewer=getExportItemsTreeViewer();
  for (int i=0; i < exportItemsTreeViewer.getCheckedElements().length; i++) {
    RepositoryNode node=(RepositoryNode)exportItemsTreeViewer.getCheckedElements()[i];
    if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
      ret.add(node);
    }
  }
  return ret.toArray(new RepositoryNode[0]);
}
Program: 123227
Project: 123227
Buggy source:
/** 
 * yzhang ChangeOutputConnectionOrderCommand constructor comment.
 */
public ChangeOutputConnectionOrderCommand(INode multipleOutputNode,List<IConnection> outputConnections){
  this.multipleOutputNode=multipleOutputNode;
  this.connectionInNewOrder=outputConnections;
  this.connectionInOldOrder=(List<IConnection>)multipleOutputNode.getOutgoingConnections();
  if (connectionInNewOrder.size() != connectionInOldOrder.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setLabel(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * yzhang ChangeOutputConnectionOrderCommand constructor comment.
 */
public ChangeOutputConnectionOrderCommand(INode multipleOutputNode,List<IConnection> outputConnections){
  this.multipleOutputNode=multipleOutputNode;
  this.connectionInNewOrder=outputConnections;
  connectionInOldOrderClone.addAll(multipleOutputNode.getOutgoingConnections());
  this.connectionInOldOrder=connectionInOldOrderClone;
  if (connectionInNewOrder.size() != connectionInOldOrder.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setLabel(Messages.getString("String_Node_Str"));
}
Program: 123228
Project: 123228
Buggy source:
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(89);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(139);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}

Fixed version (ground truth):
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(119);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(139);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}
Program: 123229
Project: 123229
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  initializeDialogUnits(composite);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.heightHint=240;
  data.widthHint=260;
  composite.setLayoutData(data);
  createTable(composite);
  return composite;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  initializeDialogUnits(composite);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.heightHint=240;
  data.widthHint=290;
  composite.setLayoutData(data);
  createTable(composite);
  return composite;
}
Program: 123230
Project: 123230
Buggy source:
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(120);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(108);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}

Fixed version (ground truth):
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(119);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(139);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}
Program: 123231
Project: 123231
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  initializeDialogUnits(composite);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.heightHint=240;
  data.widthHint=260;
  composite.setLayoutData(data);
  createTable(composite);
  return composite;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  initializeDialogUnits(composite);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.heightHint=240;
  data.widthHint=290;
  composite.setLayoutData(data);
  createTable(composite);
  return composite;
}
Program: 123232
Project: 123232
Buggy source:
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(89);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(139);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}

Fixed version (ground truth):
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(119);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(139);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}
Program: 123233
Project: 123233
Buggy source:
@Override protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  initializeDialogUnits(composite);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.heightHint=240;
  data.widthHint=260;
  composite.setLayoutData(data);
  createTable(composite);
  return composite;
}

Fixed version (ground truth):
@Override protected Control createDialogArea(Composite parent){
  Composite composite=(Composite)super.createDialogArea(parent);
  initializeDialogUnits(composite);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.heightHint=240;
  data.widthHint=290;
  composite.setLayoutData(data);
  createTable(composite);
  return composite;
}
Program: 123234
Project: 123234
Buggy source:
private void checkSelection(){
  if (jobScriptExportWizardPage == null) {
    return;
  }
  if (this.getCheckNodes().length == 0) {
    StringBuffer buff=new StringBuffer();
    buff.append(Messages.getString("String_Node_Str"));
    jobScriptExportWizardPage.setErrorMessage(buff.toString());
    jobScriptExportWizardPage.setPageComplete(false);
  }
 else {
    jobScriptExportWizardPage.setErrorMessage(null);
    jobScriptExportWizardPage.setPageComplete(true);
  }
}

Fixed version (ground truth):
protected void checkSelection(){
  if (jobScriptExportWizardPage == null) {
    return;
  }
  if (this.getCheckNodes().length == 0) {
    StringBuffer buff=new StringBuffer();
    buff.append(Messages.getString("String_Node_Str"));
    jobScriptExportWizardPage.setErrorMessage(buff.toString());
    jobScriptExportWizardPage.setPageComplete(false);
  }
 else {
    jobScriptExportWizardPage.setErrorMessage(null);
    jobScriptExportWizardPage.setPageComplete(true);
  }
}
Program: 123235
Project: 123235
Buggy source:
private void checkSelection(){
  if (jobScriptExportWizardPage == null) {
    return;
  }
  if (this.getCheckNodes().length == 0) {
    StringBuffer buff=new StringBuffer();
    buff.append(Messages.getString("String_Node_Str"));
    jobScriptExportWizardPage.setErrorMessage(buff.toString());
    jobScriptExportWizardPage.setPageComplete(false);
  }
 else {
    jobScriptExportWizardPage.setErrorMessage(null);
    jobScriptExportWizardPage.setPageComplete(true);
  }
}

Fixed version (ground truth):
protected void checkSelection(){
  if (jobScriptExportWizardPage == null) {
    return;
  }
  if (this.getCheckNodes().length == 0) {
    StringBuffer buff=new StringBuffer();
    buff.append(Messages.getString("String_Node_Str"));
    jobScriptExportWizardPage.setErrorMessage(buff.toString());
    jobScriptExportWizardPage.setPageComplete(false);
  }
 else {
    jobScriptExportWizardPage.setErrorMessage(null);
    jobScriptExportWizardPage.setPageComplete(true);
  }
}
Program: 123237
Project: 123237
Buggy source:
/** 
 * yzhang ChangeOutputConnectionOrderCommand constructor comment.
 */
public ChangeOutputConnectionOrderCommand(INode multipleOutputNode,List<IConnection> outputConnections){
  this.multipleOutputNode=multipleOutputNode;
  this.connectionInNewOrder=outputConnections;
  this.connectionInOldOrder=(List<IConnection>)multipleOutputNode.getOutgoingConnections();
  if (connectionInNewOrder.size() != connectionInOldOrder.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setLabel(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * yzhang ChangeOutputConnectionOrderCommand constructor comment.
 */
public ChangeOutputConnectionOrderCommand(INode multipleOutputNode,List<IConnection> outputConnections){
  this.multipleOutputNode=multipleOutputNode;
  this.connectionInNewOrder=outputConnections;
  connectionInOldOrderClone.addAll((List<IConnection>)multipleOutputNode.getOutgoingConnections());
  this.connectionInOldOrder=connectionInOldOrderClone;
  if (connectionInNewOrder.size() != connectionInOldOrder.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.setLabel(Messages.getString("String_Node_Str"));
}
Program: 123238
Project: 123238
Buggy source:
public void notifyChanged(Notification notification){
  int type=notification.getEventType();
  int featureId=notification.getFeatureID(XmlmapPackage.class);
switch (type) {
case Notification.SET:
switch (featureId) {
case XmlmapPackage.VAR_NODE__EXPRESSION:
      ((VarNodeFigure)getFigure()).getExpression().setText(((VarNode)getModel()).getExpression());
    break;
case XmlmapPackage.VAR_NODE__NULLABLE:
  boolean newBoolean=notification.getNewBooleanValue();
ImageFigure checkImage=((VarNodeFigure)getFigure()).getVariable().getCheckImage();
if (newBoolean) {
checkImage.setImage(ImageProvider.getImage(EImage.CHECKED_ICON));
}
 else if (!newBoolean) {
checkImage.setImage(ImageProvider.getImage(EImage.UNCHECKED_ICON));
}
break;
case XmlmapPackage.VAR_NODE__NAME:
((VarNodeFigure)getFigure()).getVariable().getVariableLabel().setText(((VarNode)getModel()).getName());
break;
case XmlmapPackage.VAR_NODE__TYPE:
((VarNodeFigure)getFigure()).updateVarNodeType();
break;
default :
}
case Notification.ADD:
switch (featureId) {
case XmlmapPackage.VAR_NODE__INCOMING_CONNECTIONS:
refreshTargetConnections();
break;
case XmlmapPackage.VAR_NODE__OUTGOING_CONNECTIONS:
case XmlmapPackage.VAR_NODE__FILTER_OUT_GOING_CONNECTIONS:
refreshSourceConnections();
break;
}
case Notification.REMOVE:
switch (featureId) {
case XmlmapPackage.VAR_NODE__INCOMING_CONNECTIONS:
refreshTargetConnections();
break;
case XmlmapPackage.VAR_NODE__OUTGOING_CONNECTIONS:
case XmlmapPackage.VAR_NODE__FILTER_OUT_GOING_CONNECTIONS:
refreshSourceConnections();
break;
}
}
}

Fixed version (ground truth):
public void notifyChanged(Notification notification){
  int type=notification.getEventType();
  int featureId=notification.getFeatureID(XmlmapPackage.class);
switch (type) {
case Notification.SET:
switch (featureId) {
case XmlmapPackage.VAR_NODE__EXPRESSION:
      ((VarNodeFigure)getFigure()).getExpression().setText(((VarNode)getModel()).getExpression());
    break;
case XmlmapPackage.VAR_NODE__NULLABLE:
  boolean newBoolean=notification.getNewBooleanValue();
ImageFigure checkImage=((VarNodeFigure)getFigure()).getVariable().getCheckImage();
if (newBoolean) {
checkImage.setImage(ImageProvider.getImage(EImage.CHECKED_ICON));
}
 else if (!newBoolean) {
checkImage.setImage(ImageProvider.getImage(EImage.UNCHECKED_ICON));
}
break;
case XmlmapPackage.VAR_NODE__NAME:
((VarNodeFigure)getFigure()).getVariable().getVariableLabel().setText(((VarNode)getModel()).getName());
break;
case XmlmapPackage.VAR_NODE__TYPE:
((VarNodeFigure)getFigure()).updateVarNodeType();
break;
default :
}
case Notification.ADD:
switch (featureId) {
case XmlmapPackage.VAR_NODE__INCOMING_CONNECTIONS:
refreshTargetConnections();
break;
case XmlmapPackage.VAR_NODE__OUTGOING_CONNECTIONS:
case XmlmapPackage.VAR_NODE__FILTER_OUT_GOING_CONNECTIONS:
refreshSourceConnections();
break;
}
case Notification.REMOVE:
case Notification.REMOVE_MANY:
switch (featureId) {
case XmlmapPackage.VAR_NODE__INCOMING_CONNECTIONS:
refreshTargetConnections();
break;
case XmlmapPackage.VAR_NODE__OUTGOING_CONNECTIONS:
case XmlmapPackage.VAR_NODE__FILTER_OUT_GOING_CONNECTIONS:
refreshSourceConnections();
break;
}
}
}
Program: 123239
Project: 123239
Buggy source:
public void refreshStyledTextEditor(AbstractNode node){
  if (node == null) {
    mapperUI.getTabFolderEditors().getStyledTextHandler().setTextWithoutNotifyListeners("String_Node_Str");
    mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEnabled(false);
    mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEditable(false);
    return;
  }
  if (node instanceof TreeNode) {
    if (!((TreeNode)node).getChildren().isEmpty()) {
      mapperUI.getTabFolderEditors().getStyledTextHandler().setTextWithoutNotifyListeners("String_Node_Str");
      mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEnabled(false);
      mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEditable(false);
      return;
    }
  }
  String expression=node.getExpression();
  if (expression == null) {
    expression="String_Node_Str";
  }
  mapperUI.getTabFolderEditors().getStyledTextHandler().setTextWithoutNotifyListeners(expression);
  mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEnabled(true);
  mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEditable(true);
  mapperUI.getTabFolderEditors().getStyledTextHandler().setSelectedNode(node);
}

Fixed version (ground truth):
public void refreshStyledTextEditor(AbstractNodePart nodePart){
  if (nodePart == null) {
    mapperUI.getTabFolderEditors().getStyledTextHandler().setTextWithoutNotifyListeners("String_Node_Str");
    mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEnabled(false);
    mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEditable(false);
    return;
  }
  AbstractNode node=(AbstractNode)nodePart.getModel();
  if (node instanceof TreeNode) {
    if (!((TreeNode)node).getChildren().isEmpty()) {
      mapperUI.getTabFolderEditors().getStyledTextHandler().setTextWithoutNotifyListeners("String_Node_Str");
      mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEnabled(false);
      mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEditable(false);
      return;
    }
  }
  String expression=node.getExpression();
  if (expression == null) {
    expression="String_Node_Str";
  }
  mapperUI.getTabFolderEditors().getStyledTextHandler().setTextWithoutNotifyListeners(expression);
  mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEnabled(true);
  mapperUI.getTabFolderEditors().getStyledTextHandler().getStyledText().setEditable(true);
  mapperUI.getTabFolderEditors().getStyledTextHandler().setSelectedNodePart(nodePart);
}
Program: 123241
Project: 123241
Buggy source:
private void updateCellExpression(){
  if (selectedNode != null && styledText != null && !styledText.getText().equals(selectedNode.getExpression())) {
    selectedNode.setExpression(styledText.getText());
  }
}

Fixed version (ground truth):
private void updateCellExpression(){
  if (selectedNode != null && styledText != null && !styledText.getText().equals(selectedNode.getExpression())) {
    DirectEditCommand command=new DirectEditCommand(selectedNodePart,selectedNode,DirectEditType.EXPRESSION,styledText.getText());
    ((XmlMapGraphicViewer)selectedNodePart.getViewer()).getEditDomain().getCommandStack().execute(command);
  }
}
Program: 123243
Project: 123243
Buggy source:
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(120);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(108);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}

Fixed version (ground truth):
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(89);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(139);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}
Program: 123245
Project: 123245
Buggy source:
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(120);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(108);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}

Fixed version (ground truth):
/** 
 * DOC hcw Comment method "createTableViewer".
 * @param parent
 */
private void createTable(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  table=new Table(composite,SWT.BORDER);
  GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
  table.setLayoutData(gd);
  table.setLinesVisible(true);
  table.setHeaderVisible(true);
  TableColumn nameColumn=new TableColumn(table,SWT.NONE);
  nameColumn.setWidth(89);
  nameColumn.setText(Messages.getString("String_Node_Str"));
  TableColumn defaultColumn=new TableColumn(table,SWT.NONE);
  defaultColumn.setWidth(139);
  defaultColumn.setText(Messages.getString("String_Node_Str"));
  editors=new ArrayList<TableEditor>();
}
Program: 123247
Project: 123247
Buggy source:
public CreateDocChildrenCommand(TransferedObject objects,OutputTreeNodeEditPart targetEditPart,OutputTreeNode createdNode,MapperManager manager){
  this.objects=objects;
  this.targetEditPart=targetEditPart;
  this.createdNode=createdNode;
  this.manager=manager;
  this.xmlMapData=manager.getCopyOfMapData();
}

Fixed version (ground truth):
public CreateDocChildrenCommand(TransferedObject objects,OutputTreeNodeEditPart targetEditPart,CreateNodeConnectionRequest rq,MapperManager manager){
  this.objects=objects;
  this.targetEditPart=targetEditPart;
  this.rq=rq;
  this.manager=manager;
  this.xmlMapData=manager.getCopyOfMapData();
}
Program: 123249
Project: 123249
Buggy source:
private void createInputMetadataColumn(String sourceTreeName,String targetTreeName,String sourceNodeName,String targetNodeName,int index){
  IMetadataTable metadataTarget=null;
  List<IODataComponent> inputs=manager.getMapperComponent().getIODataComponents().getInputs();
  for (  IODataComponent incoming : inputs) {
    if (targetTreeName != null && targetTreeName.equals(incoming.getConnection().getName())) {
      metadataTarget=incoming.getTable();
    }
  }
  if (metadataTarget != null && sourceTreeName != null) {
    IMetadataColumn columnSource=getSourceColumn(sourceTreeName,sourceNodeName);
    if (columnSource != null) {
      IMetadataColumn createNewColumn=new MetadataColumn(columnSource);
      createNewColumn.setLabel(targetNodeName);
      if (index != -1) {
        metadataTarget.getListColumns().add(index,createNewColumn);
      }
 else {
        metadataTarget.getListColumns().add(createNewColumn);
      }
      manager.getMapperUI().getTabFolderEditors().getInputMetaEditorView().getTableViewerCreator().refresh();
    }
  }
}

Fixed version (ground truth):
private void createInputMetadataColumn(String sourceTreeName,String targetTreeName,TreeNode sourceNode,String targetNodeName,int index){
  String sourceNodeName=sourceNode.getName();
  IMetadataTable metadataTarget=null;
  List<IODataComponent> inputs=manager.getMapperComponent().getIODataComponents().getInputs();
  for (  IODataComponent incoming : inputs) {
    if (targetTreeName != null && targetTreeName.equals(incoming.getConnection().getName())) {
      metadataTarget=incoming.getTable();
    }
  }
  if (metadataTarget != null) {
    IMetadataColumn columnSource=null;
    if (sourceTreeName != null) {
      columnSource=getSourceColumn(sourceTreeName,sourceNodeName);
    }
    creatMeatadataColumn(columnSource,targetNodeName,sourceNode,metadataTarget,index);
  }
}
Program: 123250
Project: 123250
Buggy source:
public InsertNewColumnCommand(TransferedObject objects,EditPart targetEditPart,AbstractNode createdNode,MapperManager manager,DropType dropType){
  this.objects=objects;
  this.targetEditPart=targetEditPart;
  this.createdNode=createdNode;
  this.manager=manager;
  this.xmlMapData=manager.getCopyOfMapData();
  this.dropType=dropType;
}

Fixed version (ground truth):
public InsertNewColumnCommand(TransferedObject objects,EditPart targetEditPart,CreateNodeConnectionRequest rq,MapperManager manager,DropType dropType){
  this.objects=objects;
  this.targetEditPart=targetEditPart;
  this.rq=rq;
  this.manager=manager;
  this.xmlMapData=manager.getCopyOfMapData();
  this.dropType=dropType;
}
Program: 123252
Project: 123252
Buggy source:
private void createOutputMetadataColumn(String sourceTreeName,String targetTreeName,String sourceNodeName,String targetNodeName,int index){
  IMetadataTable metadataTarget=null;
  List<IMetadataTable> metadataTargets=manager.getMapperComponent().getMetadataList();
  if (metadataTargets != null) {
    for (    IMetadataTable target : metadataTargets) {
      if (target.getTableName().equals(targetTreeName)) {
        metadataTarget=target;
      }
    }
  }
  if (metadataTarget != null && sourceTreeName != null) {
    IMetadataColumn columnSource=getSourceColumn(sourceTreeName,sourceNodeName);
    if (columnSource != null) {
      IMetadataColumn createNewColumn=new MetadataColumn(columnSource);
      createNewColumn.setLabel(targetNodeName);
      if (index != -1) {
        metadataTarget.getListColumns().add(index,createNewColumn);
      }
 else {
        metadataTarget.getListColumns().add(createNewColumn);
      }
      manager.getMapperUI().getTabFolderEditors().getOutputMetaEditorView().getTableViewerCreator().refresh();
    }
  }
}

Fixed version (ground truth):
private void createOutputMetadataColumn(String sourceTreeName,String targetTreeName,AbstractNode sourceNode,String targetNodeName,int index){
  String sourceNodeName=sourceNode.getName();
  IMetadataTable metadataTarget=null;
  List<IMetadataTable> metadataTargets=manager.getMapperComponent().getMetadataList();
  if (metadataTargets != null) {
    for (    IMetadataTable target : metadataTargets) {
      if (target.getTableName().equals(targetTreeName)) {
        metadataTarget=target;
      }
    }
  }
  if (metadataTarget != null) {
    IMetadataColumn columnSource=null;
    if (sourceTreeName != null) {
      columnSource=getSourceColumn(sourceTreeName,sourceNodeName);
    }
    creatMeatadataColumn(columnSource,targetNodeName,sourceNode,metadataTarget,index);
  }
}
Program: 123253
Project: 123253
Buggy source:
@Override public AbstractNode getNewObject(){
  if (getFactory() instanceof NewNodeCreationFactory) {
    return ((NewNodeCreationFactory)getFactory()).getNewObject();
  }
  return null;
}

Fixed version (ground truth):
public AbstractNode getNewObject(){
  if (getFactory() instanceof NewNodeCreationFactory) {
    AbstractNode newObject=((NewNodeCreationFactory)getFactory()).getNewObject();
    newObjects.add(newObject);
    return newObject;
  }
  return null;
}
Program: 123254
Project: 123254
Buggy source:
public AbstractNode getNewObject(){
  if (newObject == null && dropType != null) {
switch (dropType) {
case DROP_OUTPUT_DOC_CHILD:
      OutputTreeNode outputNode=XmlmapFactory.eINSTANCE.createOutputTreeNode();
    outputNode.setNodeType(nodeType);
  newObject=outputNode;
break;
case DROP_INSERT_INPUT:
newObject=XmlmapFactory.eINSTANCE.createTreeNode();
break;
case DROP_INSERT_OUTPUT:
newObject=XmlmapFactory.eINSTANCE.createOutputTreeNode();
break;
case DROP_INSERT_VAR:
newObject=XmlmapFactory.eINSTANCE.createVarNode();
break;
default :
break;
}
}
return newObject;
}

Fixed version (ground truth):
public AbstractNode getNewObject(){
  if (dropType != null) {
switch (dropType) {
case DROP_OUTPUT_DOC_CHILD:
      OutputTreeNode outputNode=XmlmapFactory.eINSTANCE.createOutputTreeNode();
    outputNode.setNodeType(nodeType);
  return outputNode;
case DROP_INSERT_INPUT:
return XmlmapFactory.eINSTANCE.createTreeNode();
case DROP_INSERT_OUTPUT:
return XmlmapFactory.eINSTANCE.createOutputTreeNode();
case DROP_INSERT_VAR:
return XmlmapFactory.eINSTANCE.createVarNode();
default :
break;
}
}
return null;
}
Program: 123256
Project: 123256
Buggy source:
public void focusLost(FocusEvent e){
  if (projectText.getText() == "String_Node_Str") {
    projectText.setText(DEFAULT_PROJECT_NAME);
    projectText.setBackground(GREY_COLOR);
  }
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
  if (projectText.getText() == "String_Node_Str") {
    projectText.setText(DEFAULT_PROJECT_NAME);
    projectText.setBackground(GREY_COLOR);
  }
}
Program: 123257
Project: 123257
Buggy source:
public void focusGained(FocusEvent e){
  if (projectText.getText().equals(DEFAULT_PROJECT_NAME)) {
    projectText.setBackground(null);
    projectText.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void focusGained(FocusEvent e){
  if (projectText.getText().equals(DEFAULT_PROJECT_NAME)) {
    projectText.setBackground(null);
    projectText.setText("String_Node_Str");
  }
}
Program: 123261
Project: 123261
Buggy source:
@Override public void showTargetFeedback(Request request){
  if (request instanceof CreateNodeConnectionRequest) {
    CreateNodeConnectionRequest rq=(CreateNodeConnectionRequest)request;
    AbstractGraphicalEditPart targetEditPart=(AbstractGraphicalEditPart)rq.getTargetEditPart();
    if (rq.getNewObjectType() != null && targetEditPart != null) {
      Object model=targetEditPart.getModel();
switch (rq.getNewObjectType()) {
case DROP_INSERT_OUTPUT:
case DROP_INSERT_VAR:
        if (model instanceof OutputTreeNode || model instanceof VarNode) {
          IFigure targetFigure=targetEditPart.getFigure();
          if (targetFigure != null) {
            if (indicator == null) {
              indicator=new InsertionIndicator();
            }
            Rectangle copy=targetFigure.getBounds().getCopy();
            Rectangle bounds=new Rectangle();
            bounds.x=copy.x - 5;
            bounds.y=copy.y - 5;
            bounds.width=copy.width + 10;
            bounds.height=10;
            indicator.setBounds(bounds);
            getFeedbackLayer().add(indicator);
          }
        }
      break;
  }
}
}
}

Fixed version (ground truth):
@Override public void showTargetFeedback(Request request){
  if (request instanceof CreateNodeConnectionRequest) {
    CreateNodeConnectionRequest rq=(CreateNodeConnectionRequest)request;
    AbstractGraphicalEditPart targetEditPart=(AbstractGraphicalEditPart)rq.getTargetEditPart();
    if (rq.getNewObjectType() != null && targetEditPart != null) {
      Object model=targetEditPart.getModel();
switch (rq.getNewObjectType()) {
case DROP_INSERT_OUTPUT:
case DROP_INSERT_VAR:
        if (model instanceof OutputTreeNode || model instanceof VarNode) {
          IFigure targetFigure=targetEditPart.getFigure();
          if (targetFigure != null) {
            if (indicator == null) {
              indicator=new InsertionIndicator();
            }
            Rectangle copy=targetFigure.getBounds().getCopy();
            Rectangle bounds=new Rectangle();
            bounds.x=copy.x - 5;
            bounds.y=copy.y - 5;
            bounds.width=copy.width + 10;
            bounds.height=10;
            indicator.setBounds(bounds);
            getFeedbackLayer().add(indicator);
          }
        }
 else {
          if (indicator != null && getFeedbackLayer() != null && indicator.getParent() == getFeedbackLayer()) {
            getFeedbackLayer().remove(indicator);
          }
        }
      break;
  }
}
}
}
Program: 123263
Project: 123263
Buggy source:
private String handleQuery(String query){
  if (query != null) {
    if (!query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else     if (isPostgres() && query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else {
      if (query.trim().endsWith("String_Node_Str")) {
        query=query.substring(0,query.lastIndexOf("String_Node_Str"));
      }
    }
  }
  return query;
}

Fixed version (ground truth):
private String handleQuery(String query){
  if (query != null) {
    if (!query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else     if (query.trim().endsWith("String_Node_Str")) {
      query=query + "String_Node_Str";
    }
 else {
      if (query.trim().endsWith("String_Node_Str")) {
        query=query.substring(0,query.lastIndexOf("String_Node_Str"));
      }
    }
  }
  return query;
}
Program: 123264
Project: 123264
Buggy source:
private List<String> getContextList(DbMapComponent component){
  List<String> contextList=new ArrayList<String>();
  IProcess process=component.getProcess();
  IContext context=process.getContextManager().getDefaultContext();
  List<IContextParameter> paraList=context.getContextParameterList();
  for (  IContextParameter para : paraList) {
    contextList.add(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + para.getName());
  }
  return contextList;
}

Fixed version (ground truth):
protected List<String> getContextList(DbMapComponent component){
  List<String> contextList=new ArrayList<String>();
  IProcess process=component.getProcess();
  IContext context=process.getContextManager().getDefaultContext();
  List<IContextParameter> paraList=context.getContextParameterList();
  for (  IContextParameter para : paraList) {
    contextList.add(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + para.getName());
  }
  return contextList;
}
Program: 123268
Project: 123268
Buggy source:
private List<String> getConnectionContextList(DbMapComponent component){
  List<String> contextList=new ArrayList<String>();
  List<IConnection> inputConnections=(List<IConnection>)component.getIncomingConnections();
  List<Map<String,String>> itemNameList=null;
  for (  IConnection iconn : inputConnections) {
    String connName=iconn.getName();
    if (!ContextParameterUtils.containContextVariables(connName)) {
      continue;
    }
    MapExpressionParser mapParser1=new MapExpressionParser("String_Node_Str");
    itemNameList=mapParser1.parseInTableEntryLocations(connName);
    if (itemNameList == null) {
      return contextList;
    }
    IMetadataTable metadataTable=iconn.getMetadataTable();
    for (    Map<String,String> itemNamemap : itemNameList) {
      Set<Entry<String,String>> set=itemNamemap.entrySet();
      Iterator<Entry<String,String>> ite=set.iterator();
      while (ite.hasNext()) {
        Entry<String,String> entry=ite.next();
        String tableValue=entry.getKey();
        String schemaValue=entry.getValue();
        if (metadataTable != null && tableValue.equals(metadataTable.getLabel())) {
          if (!contextList.contains(schemaValue)) {
            contextList.add(schemaValue);
          }
        }
      }
    }
  }
  return contextList;
}

Fixed version (ground truth):
protected List<String> getConnectionContextList(DbMapComponent component){
  List<String> contextList=new ArrayList<String>();
  List<IConnection> inputConnections=(List<IConnection>)component.getIncomingConnections();
  List<Map<String,String>> itemNameList=null;
  for (  IConnection iconn : inputConnections) {
    String connName=iconn.getName();
    if (!ContextParameterUtils.containContextVariables(connName)) {
      continue;
    }
    MapExpressionParser mapParser1=new MapExpressionParser("String_Node_Str");
    itemNameList=mapParser1.parseInTableEntryLocations(connName);
    if (itemNameList == null) {
      return contextList;
    }
    IMetadataTable metadataTable=iconn.getMetadataTable();
    for (    Map<String,String> itemNamemap : itemNameList) {
      Set<Entry<String,String>> set=itemNamemap.entrySet();
      Iterator<Entry<String,String>> ite=set.iterator();
      while (ite.hasNext()) {
        Entry<String,String> entry=ite.next();
        String tableValue=entry.getKey();
        String schemaValue=entry.getValue();
        if (metadataTable != null && tableValue.equals(metadataTable.getLabel())) {
          if (!contextList.contains(schemaValue)) {
            contextList.add(schemaValue);
          }
        }
      }
    }
  }
  return contextList;
}