nus-yam/ex-repair huggingface dataset:
Program: 123897
Project: 123897
Buggy source:
/** 
 * DOC YeXiaowei Comment method "createSalesforceSchemaWizard".
 * @param selection
 * @param forceReadOnly
 */
public void createSalesforceSchemasWizard(RepositoryNode node,final boolean forceReadOnly){
  SalesforceSchemaConnection connection=null;
  MetadataTable metadataTable=null;
  boolean creation=false;
  if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
    ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    String tableLabel=(String)node.getProperties(EProperties.LABEL);
    SalesforceSchemaConnectionItem item=null;
    if (nodeType == ERepositoryObjectType.METADATA_SALESFORCE_MODULE) {
      item=(SalesforceSchemaConnectionItem)node.getObject().getProperty().getItem();
      connection=(SalesforceSchemaConnection)item.getConnection();
      metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
      String nextId=ProxyRepositoryFactory.getInstance().getNextId();
      metadataTable.setId(nextId);
      metadataTable.setLabel(getStringIndexed(metadataTable.getLabel()));
      creation=false;
    }
 else {
      return;
    }
    initContextMode(item);
    SalesforceSchemasWizard salesforceSchemasWizard=new SalesforceSchemasWizard(PlatformUI.getWorkbench(),creation,node.getObject(),metadataTable,getExistingNames(),forceReadOnly,null,null,node.getProperties(EProperties.LABEL).toString());
    WizardDialog wizardDialog=new WizardDialog(Display.getCurrent().getActiveShell(),salesforceSchemasWizard);
    handleWizard(node,wizardDialog);
  }
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "createSalesforceSchemaWizard".
 * @param selection
 * @param forceReadOnly
 */
public void createSalesforceSchemasWizard(RepositoryNode node,final boolean forceReadOnly){
  SalesforceSchemaConnection connection=null;
  MetadataTable metadataTable=null;
  boolean creation=false;
  if (node.getType() == ENodeType.REPOSITORY_ELEMENT) {
    ERepositoryObjectType nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
    String tableLabel=(String)node.getProperties(EProperties.LABEL);
    SalesforceSchemaConnectionItem item=null;
    if (nodeType == ERepositoryObjectType.METADATA_SALESFORCE_MODULE) {
      item=(SalesforceSchemaConnectionItem)node.getObject().getProperty().getItem();
      connection=(SalesforceSchemaConnection)item.getConnection();
      metadataTable=TableHelper.findByLabel(connection,tableLabel);
      creation=false;
    }
 else {
      return;
    }
    initContextMode(item);
    if (metadataTable.eContainer() instanceof SalesforceModuleUnit) {
      SalesforceModuleUnit unit=(SalesforceModuleUnit)metadataTable.eContainer();
      connection.setModuleName(unit.getModuleName());
    }
    SalesforceSchemasWizard salesforceSchemasWizard=new SalesforceSchemasWizard(PlatformUI.getWorkbench(),creation,node.getObject(),metadataTable,getExistingNames(),forceReadOnly,null,null,node.getProperties(EProperties.LABEL).toString());
    WizardDialog wizardDialog=new WizardDialog(Display.getCurrent().getActiveShell(),salesforceSchemasWizard);
    handleWizard(node,wizardDialog);
  }
}
Program: 123900
Project: 123900
Buggy source:
public Collection<AbstractComponentsProvider> getProviders(){
  loadComponentsProvidersFromExtension();
  return providers;
}

Fixed version (ground truth):
public ArrayList<AbstractComponentsProvider> getProviders(){
  loadComponentsProvidersFromExtension();
  return providers;
}
Program: 123901
Project: 123901
Buggy source:
private static List<String> getColumnList(IElement element,String context){
  List<String> columnList=new ArrayList<String>();
  IMetadataTable table=null;
  if (element instanceof INode) {
    table=((INode)element).getMetadataFromConnector(context);
    if (table == null) {
      if (((INode)element).getMetadataList().size() > 0) {
        table=((INode)element).getMetadataList().get(0);
      }
    }
  }
 else   if (element instanceof IConnection) {
    table=((IConnection)element).getMetadataTable();
  }
  if (table != null) {
    for (    IMetadataColumn column : table.getListColumns()) {
      String label=column.getLabel();
      if (element instanceof INode && ((INode)element).getComponent().getName().endsWith("String_Node_Str")) {
        if (label.length() > 1) {
          String labelSub=label.substring(1);
          if (labelSub != null && KeywordsValidator.isKeyword(labelSub)) {
            label=labelSub;
          }
        }
      }
      columnList.add(label);
    }
  }
  return columnList;
}

Fixed version (ground truth):
private static List<String> getColumnList(IElement element,String context){
  List<String> columnList=new ArrayList<String>();
  IMetadataTable table=null;
  if (element instanceof INode) {
    table=((INode)element).getMetadataFromConnector(context);
    if (table == null) {
      if (((INode)element).getMetadataList().size() > 0) {
        table=((INode)element).getMetadataList().get(0);
      }
    }
  }
 else   if (element instanceof IConnection) {
    table=((IConnection)element).getMetadataTable();
  }
  if (table != null) {
    for (    IMetadataColumn column : table.getListColumns()) {
      String label=column.getLabel();
      columnList.add(label);
    }
  }
  return columnList;
}
Program: 123902
Project: 123902
Buggy source:
private void deleteNoUseTable(){
  connection=(DatabaseConnection)SQLBuilderRepositoryNodeManager.getItem(SQLBuilderRepositoryNodeManager.getRoot(nodeInEditor)).getConnection();
  if (SQLBuilderRepositoryNodeManager.tList instanceof List) {
    if (SQLBuilderRepositoryNodeManager.tList.size() == 0) {
      SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
    }
  }
 else {
    SQLBuilderRepositoryNodeManager.tList=new ArrayList<MetadataTable>();
    SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
  }
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}

Fixed version (ground truth):
private void deleteNoUseTable(){
  connection=(DatabaseConnection)SQLBuilderRepositoryNodeManager.getItem(SQLBuilderRepositoryNodeManager.getRoot(nodeInEditor)).getConnection();
  if (SQLBuilderRepositoryNodeManager.tList instanceof List) {
    if (SQLBuilderRepositoryNodeManager.tList.size() == 0) {
      SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
    }
  }
 else {
    SQLBuilderRepositoryNodeManager.tList=new ArrayList<MetadataTable>();
    SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
  }
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  if (node == null) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}
Program: 123903
Project: 123903
Buggy source:
/** 
 * Creates tab folder.
 */
private void createTabFolder(){
  if (tabFolder == null || tabFolder.isDisposed()) {
    clearParent();
    tabFolder=new CTabFolder(this,SWT.NULL | SWT.BORDER);
    tabFolder.setSimple(false);
    tabFolder.setToolTipText(Messages.getString("String_Node_Str"));
    this.layout();
    this.redraw();
  }
}

Fixed version (ground truth):
/** 
 * Creates tab folder.
 */
private void createTabFolder(){
  if (tabFolder == null || tabFolder.isDisposed()) {
    clearParent();
    tabFolder=new CTabFolder(this,SWT.NULL | SWT.BORDER | SWT.CLOSE);
    tabFolder.setSimple(false);
    tabFolder.setToolTipText(Messages.getString("String_Node_Str"));
    this.layout();
    this.redraw();
  }
}
Program: 123905
Project: 123905
Buggy source:
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
  }
  return split[0] + "String_Node_Str" + split[1].trim();
}

Fixed version (ground truth):
private String addQuoteForSpecialChar(String expression){
  int lastIndex=expression.lastIndexOf("String_Node_Str");
  if (lastIndex > 0) {
    String first=expression.substring(0,lastIndex).trim();
    String second=expression.substring(lastIndex + 1,expression.length()).trim();
    String exp=MetadataToolHelper.validateValue(second);
    if (!exp.equals(second)) {
      second="String_Node_Str" + second + "String_Node_Str";
    }
    return first.trim() + "String_Node_Str" + second.trim();
  }
 else {
    return expression;
  }
}
Program: 123906
Project: 123906
Buggy source:
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length == 2) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
    return split[0] + "String_Node_Str" + split[1].trim();
  }
 else {
    return expression;
  }
}

Fixed version (ground truth):
private String addQuoteForSpecialChar(String expression){
  int lastIndex=expression.lastIndexOf("String_Node_Str");
  if (lastIndex > 0) {
    String first=expression.substring(0,lastIndex).trim();
    String second=expression.substring(lastIndex + 1,expression.length()).trim();
    String exp=MetadataToolHelper.validateValue(second);
    if (!exp.equals(second)) {
      second="String_Node_Str" + second + "String_Node_Str";
    }
    return first.trim() + "String_Node_Str" + second.trim();
  }
 else {
    return expression;
  }
}
Program: 123908
Project: 123908
Buggy source:
private void processColumnNameChanged(final TreeNode treeNode){
  if (!treeNode.getOutgoingConnections().isEmpty() || !treeNode.getLookupOutgoingConnections().isEmpty()) {
    new AsynchronousThreading(20,false,mapperUI.getTabFolderEditors().getDisplay(),new Runnable(){
      public void run(){
        boolean propagate=MessageDialog.openQuestion(mapperUI.getTabFolderEditors().getShell(),"String_Node_Str","String_Node_Str");
        XmlMapUtil.updateXPathAndExpression(copyOfMapData,treeNode,treeNode.getName(),XmlMapUtil.getXPathLength(treeNode.getXpath()),propagate);
      }
    }
).start();
  }
}

Fixed version (ground truth):
private void processColumnNameChanged(final TreeNode treeNode){
  XmlMapUtil.updateXPathAndExpression(copyOfMapData,treeNode,treeNode.getName(),XmlMapUtil.getXPathLength(treeNode.getXpath()),true);
  if (treeNode instanceof OutputTreeNode) {
    getMapperUI().getTabFolderEditors().getOutputTreeSchemaEditor().refresh();
  }
 else {
    getMapperUI().getTabFolderEditors().getInputTreeSchemaEditor().refresh();
  }
}
Program: 123909
Project: 123909
Buggy source:
/** 
 * qzhang Comment method "setXMLMAPPING".
 */
protected void setXMLMAPPING(){
  if (getConnection() != null) {
    for (    IElementParameter parameter : node.getElementParameters()) {
      if (parameter.getFieldType() == EParameterFieldType.TABLE && parameter.getRepositoryValue() != null && parameter.getRepositoryValue().equals("String_Node_Str")) {
        List<Map<String,Object>> value2=(List<Map<String,Object>>)parameter.getValue();
        RepositoryToComponentProperty.getTableXMLMappingValue(getConnection(),value2,newOutputMetadata);
        parameter.setRepositoryValueUsed(true);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "setXMLMAPPING".
 */
protected void setXMLMAPPING(){
  if (getConnection() != null) {
    for (    IElementParameter parameter : node.getElementParameters()) {
      if (parameter.getFieldType() == EParameterFieldType.TABLE && parameter.getRepositoryValue() != null && parameter.getRepositoryValue().equals("String_Node_Str")) {
        List<Map<String,Object>> value2=(List<Map<String,Object>>)parameter.getValue();
        RepositoryToComponentProperty.getTableXMLMappingValue(getConnection(),value2,newOutputMetadata);
        IElementParameter elementParameter=node.getElementParameter(EParameterName.PROPERTY_TYPE.getName());
        parameter.setRepositoryValueUsed(true);
        if (getConnection() instanceof MDMConnection) {
          if (elementParameter != null && EmfComponent.BUILTIN.equals(elementParameter.getValue())) {
            parameter.setRepositoryValueUsed(false);
          }
        }
      }
    }
  }
}
Program: 123910
Project: 123910
Buggy source:
/** 
 * DOC wzhang Comment method "getConnection".
 * @return
 */
private Connection getConnection(){
  if (this.elem == null) {
    return null;
  }
  if (elem instanceof Node) {
    String propertyValue=(String)(((Node)elem).getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName()));
    IRepositoryViewObject lastVersion=UpdateRepositoryUtils.getRepositoryObjectById(propertyValue);
    if (lastVersion != null) {
      final Item item=lastVersion.getProperty().getItem();
      if (item != null && item instanceof ConnectionItem) {
        Connection repositoryConn=((ConnectionItem)item).getConnection();
        return repositoryConn;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC wzhang Comment method "getConnection".
 * @return
 */
private Connection getConnection(){
  if (this.elem == null) {
    return null;
  }
  if (elem instanceof Node) {
    IElementParameter elementParameter=((Node)elem).getElementParameter(EParameterName.PROPERTY_TYPE.getName());
    if (elementParameter != null && !EmfComponent.BUILTIN.equals(elementParameter.getValue())) {
      String propertyValue=(String)(((Node)elem).getPropertyValue(EParameterName.REPOSITORY_PROPERTY_TYPE.getName()));
      IRepositoryViewObject lastVersion=UpdateRepositoryUtils.getRepositoryObjectById(propertyValue);
      if (lastVersion != null) {
        final Item item=lastVersion.getProperty().getItem();
        if (item != null && item instanceof ConnectionItem) {
          Connection repositoryConn=((ConnectionItem)item).getConnection();
          return repositoryConn;
        }
      }
    }
  }
  return null;
}
Program: 123912
Project: 123912
Buggy source:
private void processColumnNameChanged(final TreeNode treeNode){
  if (!treeNode.getOutgoingConnections().isEmpty() || !treeNode.getLookupOutgoingConnections().isEmpty()) {
    new AsynchronousThreading(20,false,mapperUI.getTabFolderEditors().getDisplay(),new Runnable(){
      public void run(){
        boolean propagate=MessageDialog.openQuestion(mapperUI.getTabFolderEditors().getShell(),"String_Node_Str","String_Node_Str");
        XmlMapUtil.updateXPathAndExpression(copyOfMapData,treeNode,treeNode.getName(),XmlMapUtil.getXPathLength(treeNode.getXpath()),propagate);
      }
    }
).start();
  }
}

Fixed version (ground truth):
private void processColumnNameChanged(final TreeNode treeNode){
  XmlMapUtil.updateXPathAndExpression(copyOfMapData,treeNode,treeNode.getName(),XmlMapUtil.getXPathLength(treeNode.getXpath()),true);
  if (treeNode instanceof OutputTreeNode) {
    getMapperUI().getTabFolderEditors().getOutputTreeSchemaEditor().refresh();
  }
 else {
    getMapperUI().getTabFolderEditors().getInputTreeSchemaEditor().refresh();
  }
}
Program: 123913
Project: 123913
Buggy source:
private void deleteNoUseTable(){
  DatabaseConnection connection=(DatabaseConnection)SQLBuilderRepositoryNodeManager.getItem(SQLBuilderRepositoryNodeManager.getRoot(nodeInEditor)).getConnection();
  if (SQLBuilderRepositoryNodeManager.tList instanceof List) {
    if (SQLBuilderRepositoryNodeManager.tList.size() == 0) {
      SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
    }
  }
 else {
    SQLBuilderRepositoryNodeManager.tList=new ArrayList<MetadataTable>();
    SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
  }
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}

Fixed version (ground truth):
private void deleteNoUseTable(){
  DatabaseConnection connection=(DatabaseConnection)SQLBuilderRepositoryNodeManager.getItem(SQLBuilderRepositoryNodeManager.getRoot(nodeInEditor)).getConnection();
  if (SQLBuilderRepositoryNodeManager.tList instanceof List) {
    if (SQLBuilderRepositoryNodeManager.tList.size() == 0) {
      SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
    }
  }
 else {
    SQLBuilderRepositoryNodeManager.tList=new ArrayList<MetadataTable>();
    SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
  }
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  if (node == null) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}
Program: 123914
Project: 123914
Buggy source:
/** 
 * Creates tab folder.
 */
private void createTabFolder(){
  if (tabFolder == null || tabFolder.isDisposed()) {
    clearParent();
    tabFolder=new CTabFolder(this,SWT.NULL | SWT.BORDER);
    tabFolder.setSimple(false);
    tabFolder.setToolTipText(Messages.getString("String_Node_Str"));
    this.layout();
    this.redraw();
  }
}

Fixed version (ground truth):
/** 
 * Creates tab folder.
 */
private void createTabFolder(){
  if (tabFolder == null || tabFolder.isDisposed()) {
    clearParent();
    tabFolder=new CTabFolder(this,SWT.NULL | SWT.BORDER | SWT.CLOSE);
    tabFolder.setSimple(false);
    tabFolder.setToolTipText(Messages.getString("String_Node_Str"));
    this.layout();
    this.redraw();
  }
}
Program: 123918
Project: 123918
Buggy source:
public Collection<AbstractComponentsProvider> getProviders(){
  loadComponentsProvidersFromExtension();
  return providers;
}

Fixed version (ground truth):
public ArrayList<AbstractComponentsProvider> getProviders(){
  loadComponentsProvidersFromExtension();
  return providers;
}
Program: 123919
Project: 123919
Buggy source:
private static List<String> getColumnList(IElement element,String context){
  List<String> columnList=new ArrayList<String>();
  IMetadataTable table=null;
  if (element instanceof INode) {
    table=((INode)element).getMetadataFromConnector(context);
    if (table == null) {
      if (((INode)element).getMetadataList().size() > 0) {
        table=((INode)element).getMetadataList().get(0);
      }
    }
  }
 else   if (element instanceof IConnection) {
    table=((IConnection)element).getMetadataTable();
  }
  if (table != null) {
    for (    IMetadataColumn column : table.getListColumns()) {
      String label=column.getLabel();
      if (element instanceof INode && ((INode)element).getComponent().getName().endsWith("String_Node_Str")) {
        if (label.length() > 1) {
          String labelSub=label.substring(1);
          if (labelSub != null && KeywordsValidator.isKeyword(labelSub)) {
            label=labelSub;
          }
        }
      }
      columnList.add(label);
    }
  }
  return columnList;
}

Fixed version (ground truth):
private static List<String> getColumnList(IElement element,String context){
  List<String> columnList=new ArrayList<String>();
  IMetadataTable table=null;
  if (element instanceof INode) {
    table=((INode)element).getMetadataFromConnector(context);
    if (table == null) {
      if (((INode)element).getMetadataList().size() > 0) {
        table=((INode)element).getMetadataList().get(0);
      }
    }
  }
 else   if (element instanceof IConnection) {
    table=((IConnection)element).getMetadataTable();
  }
  if (table != null) {
    for (    IMetadataColumn column : table.getListColumns()) {
      String label=column.getLabel();
      columnList.add(label);
    }
  }
  return columnList;
}
Program: 123920
Project: 123920
Buggy source:
public void checkLoopProblems(AbstractInOutTree abstractTree){
  if (treeAndProblems.get(abstractTree) != null) {
    treeAndProblems.get(abstractTree).clear();
  }
  List<? extends TreeNode> nodes=null;
  if (abstractTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)abstractTree).getNodes();
  }
 else   if (abstractTree instanceof OutputXmlTree) {
    nodes=((OutputXmlTree)abstractTree).getNodes();
  }
  if (nodes != null) {
    checkTreeNodesProblem(abstractTree,nodes);
  }
  if (treeAndProblems.get(abstractTree) == null || treeAndProblems.get(abstractTree).isEmpty()) {
    treeAndProblems.remove(abstractTree);
  }
}

Fixed version (ground truth):
public void checkLoopProblems(AbstractInOutTree abstractTree){
  if (treeAndProblems.get(abstractTree) != null) {
    treeAndProblems.get(abstractTree).clear();
  }
  isMultipleDocType=false;
  List<? extends TreeNode> nodes=null;
  if (abstractTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)abstractTree).getNodes();
  }
 else   if (abstractTree instanceof OutputXmlTree) {
    nodes=((OutputXmlTree)abstractTree).getNodes();
  }
  if (nodes != null) {
    checkTreeNodesProblem(abstractTree,nodes);
  }
  if (treeAndProblems.get(abstractTree) == null || treeAndProblems.get(abstractTree).isEmpty()) {
    treeAndProblems.remove(abstractTree);
  }
}
Program: 123921
Project: 123921
Buggy source:
public List<Problem> checkProblems(){
  treeAndProblems.clear();
  final XmlMapData copyOfMapData=mapperManager.getCopyOfMapData();
  if (copyOfMapData != null) {
    for (    InputXmlTree inputTree : copyOfMapData.getInputTrees()) {
      checkTreeNodesProblem(inputTree,inputTree.getNodes());
    }
    for (    OutputXmlTree outputTree : copyOfMapData.getOutputTrees()) {
      checkTreeNodesProblem(outputTree,outputTree.getNodes());
    }
  }
  return getProblems();
}

Fixed version (ground truth):
public List<Problem> checkProblems(){
  treeAndProblems.clear();
  final XmlMapData copyOfMapData=mapperManager.getCopyOfMapData();
  if (copyOfMapData != null) {
    for (    InputXmlTree inputTree : copyOfMapData.getInputTrees()) {
      isMultipleDocType=false;
      checkTreeNodesProblem(inputTree,inputTree.getNodes());
    }
    for (    OutputXmlTree outputTree : copyOfMapData.getOutputTrees()) {
      isMultipleDocType=false;
      checkTreeNodesProblem(outputTree,outputTree.getNodes());
    }
  }
  return getProblems();
}
Program: 123922
Project: 123922
Buggy source:
private void checkTreeNodesProblem(AbstractInOutTree abstractTree,List<? extends TreeNode> treeNodes){
  for (  TreeNode treeNode : treeNodes) {
    if (XmlMapUtil.DOCUMENT.equals(treeNode.getType())) {
      if (!hasDocumentLoop(treeNode)) {
        String message=ERROR_MESSAGE_START + treeNode.getXpath();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
      }
    }
  }
}

Fixed version (ground truth):
private void checkTreeNodesProblem(AbstractInOutTree abstractTree,List<? extends TreeNode> treeNodes){
  for (  TreeNode treeNode : treeNodes) {
    if (XmlMapUtil.DOCUMENT.equals(treeNode.getType())) {
      if (!hasDocumentLoop(treeNode)) {
        String message=ERROR_MESSAGE_START + treeNode.getXpath();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
      }
      if (!isMultipleDocType) {
        isMultipleDocType=true;
      }
 else {
        String message=ERROR_MESSAGE_MULTIPLE_DOC_TYPE + treeNode.getXpath();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
      }
    }
  }
}
Program: 123923
Project: 123923
Buggy source:
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1]);
    if (!exp.equals(split[1])) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
  }
  return split[0] + "String_Node_Str" + split[1].trim();
}

Fixed version (ground truth):
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
  }
  return split[0] + "String_Node_Str" + split[1].trim();
}
Program: 123924
Project: 123924
Buggy source:
private Document extractContentAsDocument(SOAPHeader header) throws ParserConfigurationException, TransformerException {
  Document document;
  DocumentBuilderFactory factory=new com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl();
  factory.setNamespaceAware(true);
  DocumentBuilder builder=factory.newDocumentBuilder();
  document=builder.newDocument();
  Element element;
  Element headerRootElem=document.createElement("String_Node_Str");
  Iterator childElements=header.getChildElements();
  org.w3c.dom.Node domNode=null;
  while (childElements.hasNext()) {
    domNode=(org.w3c.dom.Node)childElements.next();
    element=(Element)document.importNode(domNode,true);
    headerRootElem.appendChild(element);
  }
  document.appendChild(headerRootElem);
  return document;
}

Fixed version (ground truth):
/** 
 * invoke soap and return the response document
 */
public Document extractContentAsDocument(String version,String destination,String soapAction,String soapMessage) throws SOAPException, TransformerException, ParserConfigurationException, FileNotFoundException {
  MessageFactory messageFactory=null;
  if (version.equals(SOAP12)) {
    messageFactory=MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
  }
 else {
    messageFactory=MessageFactory.newInstance();
  }
  SOAPMessage message=messageFactory.createMessage();
  MimeHeaders mimeHeaders=message.getMimeHeaders();
  mimeHeaders.setHeader("String_Node_Str",soapAction);
  SOAPPart soapPart=message.getSOAPPart();
  ByteArrayInputStream stream=new ByteArrayInputStream(soapMessage.getBytes());
  StreamSource preppedMsgSrc=new StreamSource(stream);
  soapPart.setContent(preppedMsgSrc);
  message.saveChanges();
  SOAPMessage reply=connection.call(message,destination);
  SOAPPart reSoapPart=reply.getSOAPPart();
  reSoapPart.getNamespaceURI();
  SOAPEnvelope reEnvelope=reSoapPart.getEnvelope();
  Document document;
  DocumentBuilderFactory factory=new com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl();
  factory.setNamespaceAware(true);
  DocumentBuilder builder=factory.newDocumentBuilder();
  document=builder.newDocument();
  Element element;
  Element envelopeRootElem=document.createElement(reEnvelope.getNodeName());
  if (reEnvelope.getNamespaceURI() != null && reEnvelope.getPrefix() != null) {
    envelopeRootElem.setAttribute("String_Node_Str" + reEnvelope.getPrefix(),reEnvelope.getNamespaceURI());
  }
  Iterator childElements=reEnvelope.getChildElements();
  org.w3c.dom.Node domNode=null;
  while (childElements.hasNext()) {
    domNode=(org.w3c.dom.Node)childElements.next();
    element=(Element)document.importNode(domNode,true);
    envelopeRootElem.appendChild(element);
  }
  document.appendChild(envelopeRootElem);
  return document;
}
Program: 123926
Project: 123926
Buggy source:
/** 
 * qzhang Comment method "setXMLMAPPING".
 */
protected void setXMLMAPPING(){
  if (getConnection() != null) {
    for (    IElementParameter parameter : node.getElementParameters()) {
      if (parameter.getFieldType() == EParameterFieldType.TABLE && parameter.getRepositoryValue() != null && parameter.getRepositoryValue().equals("String_Node_Str")) {
        List<Map<String,Object>> value2=(List<Map<String,Object>>)parameter.getValue();
        RepositoryToComponentProperty.getTableXMLMappingValue(getConnection(),value2,newOutputMetadata);
        parameter.setRepositoryValueUsed(true);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * qzhang Comment method "setXMLMAPPING".
 */
protected void setXMLMAPPING(){
  if (getConnection() != null) {
    for (    IElementParameter parameter : node.getElementParameters()) {
      if (parameter.getFieldType() == EParameterFieldType.TABLE && parameter.getRepositoryValue() != null && parameter.getRepositoryValue().equals("String_Node_Str")) {
        List<Map<String,Object>> value2=(List<Map<String,Object>>)parameter.getValue();
        RepositoryToComponentProperty.getTableXMLMappingValue(getConnection(),value2,newOutputMetadata);
        IElementParameter elementParameter=node.getElementParameter(EParameterName.PROPERTY_TYPE.getName());
        parameter.setRepositoryValueUsed(true);
        if (getConnection() instanceof MDMConnection) {
          if (elementParameter != null && EmfComponent.BUILTIN.equals(elementParameter.getValue())) {
            parameter.setRepositoryValueUsed(false);
          }
        }
      }
    }
  }
}
Program: 123927
Project: 123927
Buggy source:
public void checkLoopProblems(AbstractInOutTree abstractTree){
  if (treeAndProblems.get(abstractTree) != null) {
    treeAndProblems.get(abstractTree).clear();
  }
  List<? extends TreeNode> nodes=null;
  if (abstractTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)abstractTree).getNodes();
  }
 else   if (abstractTree instanceof OutputXmlTree) {
    nodes=((OutputXmlTree)abstractTree).getNodes();
  }
  if (nodes != null) {
    checkTreeNodesProblem(abstractTree,nodes);
  }
  if (treeAndProblems.get(abstractTree) == null || treeAndProblems.get(abstractTree).isEmpty()) {
    treeAndProblems.remove(abstractTree);
  }
}

Fixed version (ground truth):
public void checkLoopProblems(AbstractInOutTree abstractTree){
  if (treeAndProblems.get(abstractTree) != null) {
    treeAndProblems.get(abstractTree).clear();
  }
  isMultipleDocType=false;
  List<? extends TreeNode> nodes=null;
  if (abstractTree instanceof InputXmlTree) {
    nodes=((InputXmlTree)abstractTree).getNodes();
  }
 else   if (abstractTree instanceof OutputXmlTree) {
    nodes=((OutputXmlTree)abstractTree).getNodes();
  }
  if (nodes != null) {
    checkTreeNodesProblem(abstractTree,nodes);
  }
  if (treeAndProblems.get(abstractTree) == null || treeAndProblems.get(abstractTree).isEmpty()) {
    treeAndProblems.remove(abstractTree);
  }
}
Program: 123928
Project: 123928
Buggy source:
public List<Problem> checkProblems(){
  treeAndProblems.clear();
  final XmlMapData copyOfMapData=mapperManager.getCopyOfMapData();
  if (copyOfMapData != null) {
    for (    InputXmlTree inputTree : copyOfMapData.getInputTrees()) {
      checkTreeNodesProblem(inputTree,inputTree.getNodes());
    }
    for (    OutputXmlTree outputTree : copyOfMapData.getOutputTrees()) {
      checkTreeNodesProblem(outputTree,outputTree.getNodes());
    }
  }
  return getProblems();
}

Fixed version (ground truth):
public List<Problem> checkProblems(){
  treeAndProblems.clear();
  final XmlMapData copyOfMapData=mapperManager.getCopyOfMapData();
  if (copyOfMapData != null) {
    for (    InputXmlTree inputTree : copyOfMapData.getInputTrees()) {
      isMultipleDocType=false;
      checkTreeNodesProblem(inputTree,inputTree.getNodes());
    }
    for (    OutputXmlTree outputTree : copyOfMapData.getOutputTrees()) {
      isMultipleDocType=false;
      checkTreeNodesProblem(outputTree,outputTree.getNodes());
    }
  }
  return getProblems();
}
Program: 123929
Project: 123929
Buggy source:
private void checkTreeNodesProblem(AbstractInOutTree abstractTree,List<? extends TreeNode> treeNodes){
  for (  TreeNode treeNode : treeNodes) {
    if (XmlMapUtil.DOCUMENT.equals(treeNode.getType())) {
      if (!hasDocumentLoop(treeNode)) {
        String message=ERROR_MESSAGE_START + treeNode.getXpath();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
      }
    }
  }
}

Fixed version (ground truth):
private void checkTreeNodesProblem(AbstractInOutTree abstractTree,List<? extends TreeNode> treeNodes){
  for (  TreeNode treeNode : treeNodes) {
    if (XmlMapUtil.DOCUMENT.equals(treeNode.getType())) {
      if (!hasDocumentLoop(treeNode)) {
        String message=ERROR_MESSAGE_START + treeNode.getXpath();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
      }
      if (!isMultipleDocType) {
        isMultipleDocType=true;
      }
 else {
        String message=ERROR_MESSAGE_MULTIPLE_DOC_TYPE + treeNode.getXpath();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
      }
    }
  }
}
Program: 123930
Project: 123930
Buggy source:
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
  }
  return split[0] + "String_Node_Str" + split[1].trim();
}

Fixed version (ground truth):
private String addQuoteForSpecialChar(String expression){
  String[] split=expression.split("String_Node_Str");
  if (split.length > 1) {
    String exp=MetadataToolHelper.validateValue(split[1].trim());
    if (!exp.equals(split[1].trim())) {
      split[1]="String_Node_Str" + split[1].trim() + "String_Node_Str";
    }
    return split[0] + "String_Node_Str" + split[1].trim();
  }
 else {
    return expression;
  }
}
Program: 123933
Project: 123933
Buggy source:
private void initCurrnentModel(){
  currnentModel=new MapperSettingModel();
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null && parameter.getValue() != null && parameter.getValue() instanceof Boolean) {
    currnentModel.setDieOnError((Boolean)parameter.getValue());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null && parameter.getValue() != null) {
    currnentModel.setTempDataDir(String.valueOf(parameter.getValue()));
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null && parameter.getValue() != null) {
    currnentModel.setRowBufferSize(String.valueOf(parameter.getValue()));
  }
  boolean parallel=false;
  IElementParameter paraEle=manager.getAbstractMapComponent().getElementParameter(LOOKUP_IN_PARALLEL);
  if (paraEle != null) {
    parallel=(Boolean)paraEle.getValue();
  }
  currnentModel.setLookInParallel(parallel);
}

Fixed version (ground truth):
private void initCurrnentModel(){
  currentModel=new MapperSettingModel();
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null && parameter.getValue() != null && parameter.getValue() instanceof Boolean) {
    currentModel.setDieOnError((Boolean)parameter.getValue());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null && parameter.getValue() != null) {
    currentModel.setTempDataDir(String.valueOf(parameter.getValue()));
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null && parameter.getValue() != null) {
    currentModel.setRowBufferSize(String.valueOf(parameter.getValue()));
  }
  boolean parallel=false;
  IElementParameter paraEle=component.getElementParameter(LOOKUP_IN_PARALLEL);
  if (paraEle != null) {
    parallel=(Boolean)paraEle.getValue();
  }
  currentModel.setLookInParallel(parallel);
}
Program: 123934
Project: 123934
Buggy source:
public int getChangeNumOfSettings(){
  return currnentModel.hasDifferNumWith(defaultModel);
}

Fixed version (ground truth):
public int getChangeNumOfSettings(){
  return currentModel.hasDifferNumWith(defaultModel);
}
Program: 123935
Project: 123935
Buggy source:
private void initOriginalModel(){
  if (originalModel == null) {
    try {
      originalModel=currnentModel.clone();
    }
 catch (    CloneNotSupportedException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private void initOriginalModel(){
  if (originalModel == null) {
    try {
      originalModel=currentModel.clone();
    }
 catch (    CloneNotSupportedException e) {
      ExceptionHandler.process(e);
    }
  }
}
Program: 123936
Project: 123936
Buggy source:
public void saveCurrentSettings(){
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null) {
    parameter.setValue(currnentModel.isDieOnError());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null) {
    parameter.setValue(currnentModel.getTempDataDir());
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null) {
    parameter.setValue(currnentModel.getRowBufferSize());
  }
  parameter=component.getElementParameter(LOOKUP_IN_PARALLEL);
  if (parameter != null) {
    parameter.setValue(currnentModel.isLookInParallel());
  }
}

Fixed version (ground truth):
public void saveCurrentSettings(){
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null) {
    parameter.setValue(currentModel.isDieOnError());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null) {
    parameter.setValue(currentModel.getTempDataDir());
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null) {
    parameter.setValue(currentModel.getRowBufferSize());
  }
  parameter=component.getElementParameter(LOOKUP_IN_PARALLEL);
  if (parameter != null) {
    parameter.setValue(currentModel.isLookInParallel());
  }
}
Program: 123937
Project: 123937
Buggy source:
/** 
 * Getter for currnentModel.
 * @return the currnentModel
 */
public MapperSettingModel getCurrnentModel(){
  return this.currnentModel;
}

Fixed version (ground truth):
/** 
 * Getter for currnentModel.
 * @return the currnentModel
 */
public MapperSettingModel getCurrnentModel(){
  return this.currentModel;
}
Program: 123938
Project: 123938
Buggy source:
public boolean isMapperSettingChanged(){
  if (originalModel != null) {
    return !originalModel.equals(currnentModel);
  }
 else   if (currnentModel != null) {
    return !currnentModel.equals(originalModel);
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
public boolean isMapperSettingChanged(){
  if (originalModel != null) {
    return !originalModel.equals(currentModel);
  }
 else   if (currentModel != null) {
    return !currentModel.equals(originalModel);
  }
 else {
    return true;
  }
}
Program: 123939
Project: 123939
Buggy source:
protected void okPressed(){
  if (directoryField.getText() != null && !directoryField.getText().startsWith(QUOTATION_MARK) && !directoryField.getText().endsWith(QUOTATION_MARK)) {
    directoryField.setText(TalendQuoteUtils.addQuotesIfNotExist(directoryField.getText()));
  }
  MapperSettingModel currnentModel=settingsManager.getCurrnentModel();
  currnentModel.setDieOnError(dieOnErrorButton.getSelection());
  currnentModel.setLookInParallel(lookupInParallelButton.getSelection());
  currnentModel.setTempDataDir(directoryField.getText());
  currnentModel.setRowBufferSize(sizeField.getText());
  if (dieOnErrorButton.getSelection()) {
    mapperManager.removeRejectOutput();
  }
 else {
    if (!mapperManager.hasRejectOutput(mapperManager.getOutputTables())) {
      mapperManager.addRejectOutput();
    }
  }
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  if (directoryField.getText() != null && StringUtils.trimToNull(directoryField.getText()) != null && (!directoryField.getText().startsWith(QUOTATION_MARK) || !directoryField.getText().endsWith(QUOTATION_MARK))) {
    directoryField.setText(TalendQuoteUtils.addQuotesIfNotExist(directoryField.getText()));
  }
  MapperSettingModel currentModel=settingsManager.getCurrnentModel();
  currentModel.setDieOnError(dieOnErrorButton.getSelection());
  currentModel.setLookInParallel(lookupInParallelButton.getSelection());
  currentModel.setTempDataDir(directoryField.getText());
  currentModel.setRowBufferSize(sizeField.getText());
  if (dieOnErrorButton.getSelection()) {
    mapperManager.removeRejectOutput();
  }
 else {
    if (!mapperManager.hasRejectOutput(mapperManager.getOutputTables())) {
      mapperManager.addRejectOutput();
    }
  }
  super.okPressed();
}
Program: 123941
Project: 123941
Buggy source:
private void initCurrnentModel(){
  currnentModel=new MapperSettingModel();
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null && parameter.getValue() != null && parameter.getValue() instanceof Boolean) {
    currnentModel.setDieOnError((Boolean)parameter.getValue());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null && parameter.getValue() != null) {
    currnentModel.setTempDataDir(String.valueOf(parameter.getValue()));
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null && parameter.getValue() != null) {
    currnentModel.setRowBufferSize(String.valueOf(parameter.getValue()));
  }
  boolean parallel=false;
  IElementParameter paraEle=manager.getAbstractMapComponent().getElementParameter(LOOKUP_IN_PARALLEL);
  if (paraEle != null) {
    parallel=(Boolean)paraEle.getValue();
  }
  currnentModel.setLookInParallel(parallel);
}

Fixed version (ground truth):
private void initCurrnentModel(){
  currentModel=new MapperSettingModel();
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null && parameter.getValue() != null && parameter.getValue() instanceof Boolean) {
    currentModel.setDieOnError((Boolean)parameter.getValue());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null && parameter.getValue() != null) {
    currentModel.setTempDataDir(String.valueOf(parameter.getValue()));
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null && parameter.getValue() != null) {
    currentModel.setRowBufferSize(String.valueOf(parameter.getValue()));
  }
  boolean parallel=false;
  IElementParameter paraEle=component.getElementParameter(LOOKUP_IN_PARALLEL);
  if (paraEle != null) {
    parallel=(Boolean)paraEle.getValue();
  }
  currentModel.setLookInParallel(parallel);
}
Program: 123942
Project: 123942
Buggy source:
public int getChangeNumOfSettings(){
  return currnentModel.hasDifferNumWith(defaultModel);
}

Fixed version (ground truth):
public int getChangeNumOfSettings(){
  return currentModel.hasDifferNumWith(defaultModel);
}
Program: 123943
Project: 123943
Buggy source:
private void initOriginalModel(){
  if (originalModel == null) {
    try {
      originalModel=currnentModel.clone();
    }
 catch (    CloneNotSupportedException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private void initOriginalModel(){
  if (originalModel == null) {
    try {
      originalModel=currentModel.clone();
    }
 catch (    CloneNotSupportedException e) {
      ExceptionHandler.process(e);
    }
  }
}
Program: 123944
Project: 123944
Buggy source:
public void saveCurrentSettings(){
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null) {
    parameter.setValue(currnentModel.isDieOnError());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null) {
    parameter.setValue(currnentModel.getTempDataDir());
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null) {
    parameter.setValue(currnentModel.getRowBufferSize());
  }
  parameter=component.getElementParameter(LOOKUP_IN_PARALLEL);
  if (parameter != null) {
    parameter.setValue(currnentModel.isLookInParallel());
  }
}

Fixed version (ground truth):
public void saveCurrentSettings(){
  AbstractMapComponent component=manager.getAbstractMapComponent();
  IElementParameter parameter=component.getElementParameter(DIE_ON_ERROR);
  if (parameter != null) {
    parameter.setValue(currentModel.isDieOnError());
  }
  parameter=component.getElementParameter(TEMPORARY_DATA_DIRECTORY);
  if (parameter != null) {
    parameter.setValue(currentModel.getTempDataDir());
  }
  parameter=component.getElementParameter(ROWS_BUFFER_SIZE);
  if (parameter != null) {
    parameter.setValue(currentModel.getRowBufferSize());
  }
  parameter=component.getElementParameter(LOOKUP_IN_PARALLEL);
  if (parameter != null) {
    parameter.setValue(currentModel.isLookInParallel());
  }
}
Program: 123945
Project: 123945
Buggy source:
/** 
 * Getter for currnentModel.
 * @return the currnentModel
 */
public MapperSettingModel getCurrnentModel(){
  return this.currnentModel;
}

Fixed version (ground truth):
/** 
 * Getter for currnentModel.
 * @return the currnentModel
 */
public MapperSettingModel getCurrnentModel(){
  return this.currentModel;
}
Program: 123946
Project: 123946
Buggy source:
public boolean isMapperSettingChanged(){
  if (originalModel != null) {
    return !originalModel.equals(currnentModel);
  }
 else   if (currnentModel != null) {
    return !currnentModel.equals(originalModel);
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
public boolean isMapperSettingChanged(){
  if (originalModel != null) {
    return !originalModel.equals(currentModel);
  }
 else   if (currentModel != null) {
    return !currentModel.equals(originalModel);
  }
 else {
    return true;
  }
}
Program: 123947
Project: 123947
Buggy source:
private void init(){
  MapperSettingModel currnentModel=settingsManager.getCurrnentModel();
  dieOnErrorButton.setSelection(currnentModel.isDieOnError());
  lookupInParallelButton.setSelection(currnentModel.isLookInParallel());
  directoryField.setText(StringUtils.trimToEmpty(currnentModel.getTempDataDir()));
  sizeField.setText(StringUtils.trimToEmpty(currnentModel.getRowBufferSize()));
}

Fixed version (ground truth):
private void init(){
  MapperSettingModel currentModel=settingsManager.getCurrnentModel();
  dieOnErrorButton.setSelection(currentModel.isDieOnError());
  lookupInParallelButton.setSelection(currentModel.isLookInParallel());
  directoryField.setText(StringUtils.trimToEmpty(currentModel.getTempDataDir()));
  sizeField.setText(StringUtils.trimToEmpty(currentModel.getRowBufferSize()));
}