nus-yam/ex-repair huggingface dataset:
Program: 123333
Project: 123333
Buggy source:
@Override public void run(){
  TreeNode model=(TreeNode)nodePart.getModel();
  AbstractInOutTree abstractTree=null;
  TreeNode docRoot=null;
  if (model instanceof OutputTreeNode) {
    OutputTreeNode outputNode=(OutputTreeNode)model;
    docRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(outputNode);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
      XmlMapUtil.cleanSubGroup(outputNode);
      List<TreeNode> newLoopUpGroups=new ArrayList<TreeNode>();
      findUpGroupNode(newLoopUpGroups,outputNode);
      XmlMapUtil.cleanSubGroup(docRoot,newLoopUpGroups);
      if (!newLoopUpGroups.isEmpty()) {
        TreeNode rootGroup=newLoopUpGroups.get(newLoopUpGroups.size() - 1);
        upsetGroup(outputNode,rootGroup);
      }
      if (docRoot.eContainer() instanceof AbstractInOutTree) {
        abstractTree=(AbstractInOutTree)docRoot.eContainer();
      }
    }
  }
 else   if (model instanceof TreeNode) {
    docRoot=XmlMapUtil.getTreeNodeRoot(model);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
    }
    if (docRoot.eContainer() instanceof AbstractInOutTree) {
      abstractTree=(AbstractInOutTree)docRoot.eContainer();
    }
  }
  model.setLoop(true);
  XmlMapUtil.clearMainNode(docRoot);
  XmlMapUtil.upsetMainNode(model);
  if (abstractTree != null) {
    mapperManager.getProblemsAnalyser().checkLoopProblems(abstractTree);
    mapperManager.getMapperUI().updateStatusBar();
  }
}

Fixed version (ground truth):
@Override public void run(){
  TreeNode model=(TreeNode)nodePart.getModel();
  AbstractInOutTree abstractTree=null;
  TreeNode docRoot=null;
  if (model instanceof OutputTreeNode) {
    OutputTreeNode outputNode=(OutputTreeNode)model;
    docRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(outputNode);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
      XmlMapUtil.cleanSubGroup(outputNode);
      List<TreeNode> newLoopUpGroups=new ArrayList<TreeNode>();
      findUpGroupNode(newLoopUpGroups,outputNode);
      XmlMapUtil.cleanSubGroup(docRoot,newLoopUpGroups);
      if (!newLoopUpGroups.isEmpty()) {
        TreeNode rootGroup=newLoopUpGroups.get(newLoopUpGroups.size() - 1);
        upsetGroup(outputNode,rootGroup);
      }
      if (docRoot.eContainer() instanceof AbstractInOutTree) {
        abstractTree=(AbstractInOutTree)docRoot.eContainer();
      }
    }
  }
 else   if (model instanceof TreeNode) {
    docRoot=XmlMapUtil.getTreeNodeRoot(model);
    if (docRoot != null) {
      cleanSubLoop(docRoot);
    }
    if (docRoot.eContainer() instanceof AbstractInOutTree) {
      abstractTree=(AbstractInOutTree)docRoot.eContainer();
    }
  }
  model.setLoop(true);
  XmlMapUtil.clearMainNode(docRoot);
  XmlMapUtil.upsetMainNode(model);
  if (abstractTree != null) {
    mapperManager.getProblemsAnalyser().checkProblems(abstractTree);
    mapperManager.getMapperUI().updateStatusBar();
  }
}
Program: 123336
Project: 123336
Buggy source:
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();
}

Fixed version (ground truth):
public void checkProblems(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: 123337
Project: 123337
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));
      }
      if (!isMultipleDocType) {
        isMultipleDocType=true;
      }
 else {
        String message=ERROR_MESSAGE_MULTIPLE_DOC_TYPE + treeNode.getXpath();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
      }
    }
  }
}

Fixed version (ground truth):
private void checkTreeNodesProblem(AbstractInOutTree abstractTree,List<? extends TreeNode> treeNodes){
  boolean multiDocChecked=false;
  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       if (!multiDocChecked) {
        String message=ERROR_MESSAGE_MULTIPLE_DOC_TYPE + abstractTree.getName();
        addProblem(abstractTree,new Problem(null,message,ProblemStatus.ERROR));
        multiDocChecked=true;
      }
    }
  }
}
Program: 123338
Project: 123338
Buggy source:
public String getErrorMessage(){
  String errorMessage=ERROR_MESSAGE_START;
  final List<Problem> problems=getProblems();
  if (problems.isEmpty()) {
    return null;
  }
 else {
    for (    Problem problem : problems) {
      final String description=problem.getDescription();
      if (description != null) {
        errorMessage=errorMessage + description.substring(ERROR_MESSAGE_START.length(),description.length()) + "String_Node_Str";
      }
    }
  }
  return errorMessage.substring(0,errorMessage.length() - 1);
}

Fixed version (ground truth):
public String getErrorMessage(){
  String errorMessage1=ERROR_MESSAGE_START;
  String errorMessage2=ERROR_MESSAGE_MULTIPLE_DOC_TYPE;
  String message=null;
  final List<Problem> problems=getProblems();
  if (problems.isEmpty()) {
    return null;
  }
 else {
    for (    Problem problem : problems) {
      final String description=problem.getDescription();
      if (description != null) {
        if (description.contains(ERROR_MESSAGE_START)) {
          errorMessage1=errorMessage1 + description.substring(ERROR_MESSAGE_START.length(),description.length()) + "String_Node_Str";
        }
 else         if (description.contains(ERROR_MESSAGE_MULTIPLE_DOC_TYPE)) {
          errorMessage2=errorMessage2 + description.substring(ERROR_MESSAGE_MULTIPLE_DOC_TYPE.length(),description.length()) + "String_Node_Str";
        }
      }
    }
  }
  if (!errorMessage1.equals(ERROR_MESSAGE_START)) {
    errorMessage1=errorMessage1.substring(0,errorMessage1.length() - 1);
    message=errorMessage1;
  }
  if (!errorMessage2.equals(ERROR_MESSAGE_MULTIPLE_DOC_TYPE)) {
    errorMessage2=errorMessage2.substring(0,errorMessage2.length() - 1);
    if (message != null) {
      message=message + "String_Node_Str" + errorMessage2;
    }
 else {
      message=errorMessage2;
    }
  }
  return message == null ? "String_Node_Str" : message;
}
Program: 123339
Project: 123339
Buggy source:
private String addQuoteForSpecialChar(String expression,DbMapComponent component){
  List<String> specialList=new ArrayList<String>();
  Map<String,List<String>> map=new HashMap<String,List<String>>();
  List<IConnection> inputConnections=(List<IConnection>)component.getIncomingConnections();
  if (inputConnections == null) {
    return expression;
  }
  for (  IConnection iconn : inputConnections) {
    IMetadataTable metadataTable=iconn.getMetadataTable();
    List<IMetadataColumn> lColumn=metadataTable.getListColumns();
    for (    IMetadataColumn co : lColumn) {
      String columnLabel=co.getLabel();
      String exp=MetadataToolHelper.validateValueNoLengthLimit(columnLabel);
      if (!exp.equals(columnLabel)) {
        specialList.add(columnLabel);
      }
    }
  }
  for (  String specialColumn : specialList) {
    if (expression.contains(specialColumn)) {
      if (map.get(expression) == null) {
        List<String> list=new ArrayList<String>();
        list.add(specialColumn);
        map.put(expression,list);
      }
 else {
        List<String> list=map.get(expression);
        list.add(specialColumn);
      }
    }
  }
  if (map.size() > 0) {
    List<String> list=map.get(expression);
    for (int i=0; i < list.size() - 1; i++) {
      String first=list.get(i);
      String second=list.get(i + 1);
      String temp;
      if (first.length() > second.length()) {
        temp=first;
        first=second;
        second=temp;
      }
    }
    String specialColumn=list.get(list.size() - 1);
    if (expression.contains(specialColumn)) {
      int begin=expression.indexOf(specialColumn);
      int length=specialColumn.length();
      int allLength=expression.length();
      expression=expression.substring(0,begin) + "String_Node_Str" + expression.substring(begin,begin + length)+ "String_Node_Str"+ expression.substring(begin + length,allLength);
      return expression;
    }
  }
  return expression;
}

Fixed version (ground truth):
protected String addQuoteForSpecialChar(String expression,DbMapComponent component){
  return expression;
}
Program: 123341
Project: 123341
Buggy source:
@Override public void dispose(){
  super.dispose();
  IRepositoryView view=RepositoryManager.getRepositoryView();
  view.refresh();
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  IRepositoryView view=RepositoryManager.getRepositoryView();
  if (view != null) {
    view.refresh();
  }
}
Program: 123342
Project: 123342
Buggy source:
@Override public void dispose(){
  super.dispose();
  IRepositoryView view=RepositoryManager.getRepositoryView();
  view.refresh();
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  IRepositoryView view=RepositoryManager.getRepositoryView();
  if (view != null) {
    view.refresh();
  }
}
Program: 123343
Project: 123343
Buggy source:
@Override public void dispose(){
  super.dispose();
  IRepositoryView view=RepositoryManager.getRepositoryView();
  view.refresh();
}

Fixed version (ground truth):
@Override public void dispose(){
  super.dispose();
  IRepositoryView view=RepositoryManager.getRepositoryView();
  if (view != null) {
    view.refresh();
  }
}
Program: 123344
Project: 123344
Buggy source:
private void launch(){
  try {
    CsvArray csvArray=getMultiSchemaManager().getCsvArrayForMultiSchemaDelimited(fileField.getText(),multiSeparatorsText.getText(),encodingCombo.getText(),keyValuesText.getText(),multiSchemaManager.getSelectedColumnIndex());
    processor.setCsvArray(csvArray);
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        processor.execute2();
      }
    }
);
  }
 catch (  FileNotFoundException e) {
    ExceptionHandler.process(e);
  }
catch (  IOException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
private void launch(){
  try {
    String filePath=this.multiSchemaManager.getOriginalValue(this.getConnection().getFilePath());
    CsvArray csvArray=getMultiSchemaManager().getCsvArrayForMultiSchemaDelimited(filePath,multiSeparatorsText.getText(),encodingCombo.getText(),keyValuesText.getText(),multiSchemaManager.getSelectedColumnIndex());
    processor.setCsvArray(csvArray);
    Display.getDefault().asyncExec(new Runnable(){
      public void run(){
        processor.execute2();
      }
    }
);
  }
 catch (  FileNotFoundException e) {
    ExceptionHandler.process(e);
  }
catch (  IOException e) {
    ExceptionHandler.process(e);
  }
}
Program: 123345
Project: 123345
Buggy source:
private String addQuoteForSpecialChar(String expression,DbMapComponent component){
  List<String> specialList=new ArrayList<String>();
  Map<String,List<String>> map=new HashMap<String,List<String>>();
  List<IConnection> inputConnections=(List<IConnection>)component.getIncomingConnections();
  if (inputConnections == null) {
    return expression;
  }
  for (  IConnection iconn : inputConnections) {
    IMetadataTable metadataTable=iconn.getMetadataTable();
    List<IMetadataColumn> lColumn=metadataTable.getListColumns();
    for (    IMetadataColumn co : lColumn) {
      String columnLabel=co.getLabel();
      String exp=MetadataToolHelper.validateValueNoLengthLimit(columnLabel);
      if (!exp.equals(columnLabel)) {
        specialList.add(columnLabel);
      }
    }
  }
  for (  String specialColumn : specialList) {
    if (expression.contains(specialColumn)) {
      if (map.get(expression) == null) {
        List<String> list=new ArrayList<String>();
        list.add(specialColumn);
        map.put(expression,list);
      }
 else {
        List<String> list=map.get(expression);
        list.add(specialColumn);
      }
    }
  }
  if (map.size() > 0) {
    List<String> list=map.get(expression);
    for (int i=0; i < list.size() - 1; i++) {
      String first=list.get(i);
      String second=list.get(i + 1);
      String temp;
      if (first.length() > second.length()) {
        temp=first;
        first=second;
        second=temp;
      }
    }
    String specialColumn=list.get(list.size() - 1);
    if (expression.contains(specialColumn)) {
      int begin=expression.indexOf(specialColumn);
      int length=specialColumn.length();
      int allLength=expression.length();
      expression=expression.substring(0,begin) + "String_Node_Str" + expression.substring(begin,begin + length)+ "String_Node_Str"+ expression.substring(begin + length,allLength);
      return expression;
    }
  }
  return expression;
}

Fixed version (ground truth):
protected String addQuoteForSpecialChar(String expression,DbMapComponent component){
  return expression;
}
Program: 123347
Project: 123347
Buggy source:
/** 
 * DOC amaumont Comment method "hasOrRenameData".
 * @param oldName
 * @param newName can be null if <code>renameAction</code> is false
 * @param renameAction true to rename in all expressions, false to get boolean if present in one of the expressions
 * @return
 */
protected boolean hasOrRenameData(String oldName,String newName,boolean renameAction){
  if (oldName == null || newName == null && renameAction) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> tables=new ArrayList<ExternalDbMapTable>(externalData.getInputTables());
    tables.addAll(externalData.getOutputTables());
    if (externalData.getVarsTables() != null) {
      tables.addAll(externalData.getVarsTables());
    }
    for (    ExternalDbMapTable table : tables) {
      List<ExternalDbMapEntry> metadataTableEntries=table.getMetadataTableEntries();
      if (metadataTableEntries != null) {
        for (        ExternalDbMapEntry entry : metadataTableEntries) {
          if (hasOrRenameEntry(entry,oldName,newName,renameAction)) {
            return true;
          }
        }
      }
      if (table.getCustomConditionsEntries() != null) {
        for (        ExternalDbMapEntry entry : table.getCustomConditionsEntries()) {
          if (hasOrRenameEntry(entry,oldName,newName,renameAction)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "hasOrRenameData".
 * @param oldName
 * @param newName can be null if <code>renameAction</code> is false
 * @param renameAction true to rename in all expressions, false to get boolean if present in one of the expressions
 * @return
 */
@Override protected boolean hasOrRenameData(String oldName,String newName,boolean renameAction){
  if (oldName == null || newName == null && renameAction) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> tables=new ArrayList<ExternalDbMapTable>(externalData.getInputTables());
    tables.addAll(externalData.getOutputTables());
    if (externalData.getVarsTables() != null) {
      tables.addAll(externalData.getVarsTables());
    }
    for (    ExternalDbMapTable table : tables) {
      List<ExternalDbMapEntry> metadataTableEntries=table.getMetadataTableEntries();
      if (metadataTableEntries != null) {
        for (        ExternalDbMapEntry entry : metadataTableEntries) {
          if (hasOrRenameEntry(entry,oldName,newName,renameAction)) {
            return true;
          }
        }
      }
      if (table.getCustomConditionsEntries() != null) {
        for (        ExternalDbMapEntry entry : table.getCustomConditionsEntries()) {
          if (hasOrRenameEntry(entry,oldName,newName,renameAction)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
Program: 123348
Project: 123348
Buggy source:
protected void renameMetadataColumnName(String conectionName,String oldColumnName,String newColumnName){
  if (conectionName == null || oldColumnName == null || newColumnName == null) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> tables=new ArrayList<ExternalDbMapTable>(externalData.getInputTables());
    tables.addAll(externalData.getOutputTables());
    ExternalDbMapTable tableFound=null;
    for (    ExternalDbMapTable table : tables) {
      if (table.getName().equals(conectionName)) {
        List<ExternalDbMapEntry> metadataTableEntries=table.getMetadataTableEntries();
        for (        ExternalDbMapEntry entry : metadataTableEntries) {
          if (entry.getName().equals(oldColumnName)) {
            entry.setName(newColumnName);
            tableFound=table;
            break;
          }
        }
        break;
      }
    }
    if (tableFound != null && externalData.getInputTables().indexOf(tableFound) != -1) {
      TableEntryLocation oldLocation=new TableEntryLocation(conectionName,oldColumnName);
      TableEntryLocation newLocation=new TableEntryLocation(conectionName,newColumnName);
      replaceLocationsInAllExpressions(oldLocation,newLocation,false);
    }
  }
}

Fixed version (ground truth):
@Override protected void renameMetadataColumnName(String conectionName,String oldColumnName,String newColumnName){
  if (conectionName == null || oldColumnName == null || newColumnName == null) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> tables=new ArrayList<ExternalDbMapTable>(externalData.getInputTables());
    tables.addAll(externalData.getOutputTables());
    ExternalDbMapTable tableFound=null;
    for (    ExternalDbMapTable table : tables) {
      if (table.getName().equals(conectionName)) {
        List<ExternalDbMapEntry> metadataTableEntries=table.getMetadataTableEntries();
        for (        ExternalDbMapEntry entry : metadataTableEntries) {
          if (entry.getName().equals(oldColumnName)) {
            entry.setName(newColumnName);
            tableFound=table;
            break;
          }
        }
        break;
      }
    }
    if (tableFound != null && externalData.getInputTables().indexOf(tableFound) != -1) {
      TableEntryLocation oldLocation=new TableEntryLocation(conectionName,oldColumnName);
      TableEntryLocation newLocation=new TableEntryLocation(conectionName,newColumnName);
      replaceLocationsInAllExpressions(oldLocation,newLocation,false);
    }
  }
}
Program: 123349
Project: 123349
Buggy source:
public void setMetadataList(List<IMetadataTable> metadataTablesOut){
  this.metadataListOut=metadataTablesOut;
}

Fixed version (ground truth):
@Override public void setMetadataList(List<IMetadataTable> metadataTablesOut){
  this.metadataListOut=metadataTablesOut;
}
Program: 123350
Project: 123350
Buggy source:
public IExternalData getExternalData(){
  if (this.externalData == null) {
    this.externalData=new ExternalDbMapData();
  }
  return this.externalData;
}

Fixed version (ground truth):
@Override public IExternalData getExternalData(){
  if (this.externalData == null) {
    this.externalData=new ExternalDbMapData();
  }
  return this.externalData;
}
Program: 123351
Project: 123351
Buggy source:
public List<IMetadataTable> getMetadataList(){
  return this.metadataListOut;
}

Fixed version (ground truth):
@Override public List<IMetadataTable> getMetadataList(){
  return this.metadataListOut;
}
Program: 123352
Project: 123352
Buggy source:
public void renameInputConnection(String oldConnectionName,String newConnectionName){
  if (oldConnectionName == null || newConnectionName == null) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> inputTables=externalData.getInputTables();
    for (    ExternalDbMapTable table : inputTables) {
      if (table.getTableName() != null && (table.getTableName().equals(oldConnectionName) || table.getName().equals(oldConnectionName))) {
        table.setTableName(newConnectionName);
        table.setName(newConnectionName);
        TableEntryLocation oldLocation=new TableEntryLocation(oldConnectionName,null);
        TableEntryLocation newLocation=new TableEntryLocation(newConnectionName,null);
        replaceLocationsInAllExpressions(oldLocation,newLocation,true);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void renameInputConnection(String oldConnectionName,String newConnectionName){
  if (oldConnectionName == null || newConnectionName == null) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> inputTables=externalData.getInputTables();
    for (    ExternalDbMapTable table : inputTables) {
      if (table.getTableName() != null && (table.getTableName().equals(oldConnectionName) || table.getName().equals(oldConnectionName))) {
        table.setTableName(newConnectionName);
        table.setName(newConnectionName);
        TableEntryLocation oldLocation=new TableEntryLocation(oldConnectionName,null);
        TableEntryLocation newLocation=new TableEntryLocation(newConnectionName,null);
        replaceLocationsInAllExpressions(oldLocation,newLocation,true);
      }
    }
  }
}
Program: 123353
Project: 123353
Buggy source:
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new PostgresGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str") || value.contains("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}

Fixed version (ground truth):
public DbGenerationManager getGenerationManager(){
  if (generationManager == null) {
    IElementParameter elementParameter=getElementParameter("String_Node_Str");
    String value=(String)elementParameter.getValue();
    if (value.contains("String_Node_Str")) {
      generationManager=new TeradataGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new OracleGenerationManager();
    }
 else     if (value.contains("String_Node_Str")) {
      generationManager=new MysqlGenerationManager();
    }
 else     if (value.contains("String_Node_Str") || value.contains("String_Node_Str")) {
      generationManager=new PostgresGenerationManager();
    }
 else     if (value.startsWith("String_Node_Str") && value.endsWith("String_Node_Str")) {
      generationManager=new GenericDbGenerationManager();
    }
 else {
      throw new IllegalArgumentException(Messages.getString("String_Node_Str") + value);
    }
  }
  return generationManager;
}
Program: 123354
Project: 123354
Buggy source:
public IExternalData getTMapExternalData(){
  return null;
}

Fixed version (ground truth):
@Override public IExternalData getTMapExternalData(){
  return null;
}
Program: 123355
Project: 123355
Buggy source:
public IComponentDocumentation getComponentDocumentation(String componentName,String tempFolderPath){
  DbMapComponentDocumentation componentDocumentation=new DbMapComponentDocumentation();
  componentDocumentation.setComponentName(componentName);
  componentDocumentation.setTempFolderPath(tempFolderPath);
  componentDocumentation.setExternalData(this.getExternalData());
  componentDocumentation.setPreviewPicPath(HTMLDocUtils.getPreviewPicPath(this));
  return componentDocumentation;
}

Fixed version (ground truth):
@Override public IComponentDocumentation getComponentDocumentation(String componentName,String tempFolderPath){
  DbMapComponentDocumentation componentDocumentation=new DbMapComponentDocumentation();
  componentDocumentation.setComponentName(componentName);
  componentDocumentation.setTempFolderPath(tempFolderPath);
  componentDocumentation.setExternalData(this.getExternalData());
  componentDocumentation.setPreviewPicPath(HTMLDocUtils.getPreviewPicPath(this));
  return componentDocumentation;
}
Program: 123356
Project: 123356
Buggy source:
public void setExternalData(IExternalData externalData){
  this.externalData=(ExternalDbMapData)externalData;
}

Fixed version (ground truth):
@Override public void setExternalData(IExternalData externalData){
  this.externalData=(ExternalDbMapData)externalData;
}
Program: 123357
Project: 123357
Buggy source:
/** 
 * DOC amaumont Comment method "refreshMapperConnectorData".
 */
public void restoreMapperModelFromInternalData(){
  mapperMain.loadModelFromInternalData();
  metadataListOut=mapperMain.getMetadataListOut();
  externalData=mapperMain.buildExternalData();
  sortOutputsConnectionsLikeVisualOrder();
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "refreshMapperConnectorData".
 */
@Override public void restoreMapperModelFromInternalData(){
  mapperMain.loadModelFromInternalData();
  metadataListOut=mapperMain.getMetadataListOut();
  externalData=mapperMain.buildExternalData();
  sortOutputsConnectionsLikeVisualOrder();
}
Program: 123358
Project: 123358
Buggy source:
public void initialize(){
  super.initialize();
  initMapperMain(false);
  mapperMain.loadInitialParamters();
}

Fixed version (ground truth):
@Override public void initialize(){
  super.initialize();
  initMapperMain(false);
  mapperMain.loadInitialParamters();
}
Program: 123359
Project: 123359
Buggy source:
public void renameOutputConnection(String oldName,String newName){
  if (oldName == null || newName == null) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> outputTables=externalData.getOutputTables();
    for (    ExternalDbMapTable table : outputTables) {
      if (table.getTableName() != null && table.getTableName().equals(oldName)) {
        table.setTableName(newName);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void renameOutputConnection(String oldName,String newName){
  if (oldName == null || newName == null) {
    throw new NullPointerException();
  }
  if (externalData != null) {
    List<ExternalDbMapTable> outputTables=externalData.getOutputTables();
    for (    ExternalDbMapTable table : outputTables) {
      if (table.getTableName() != null && table.getTableName().equals(oldName)) {
        table.setTableName(newName);
      }
    }
  }
}
Program: 123360
Project: 123360
Buggy source:
public void replaceLocation(TableEntryLocation oldLocation,TableEntryLocation newLocation,ExternalDbMapEntry entry,DataMapExpressionParser dataMapExpressionParser,boolean tableRenamed){
  String currentExpression=entry.getExpression();
  if (currentExpression == null || currentExpression.length() == 0) {
    return;
  }
  TableEntryLocation[] tableEntryLocations=dataMapExpressionParser.parseTableEntryLocations(currentExpression);
  for (int i=0; i < tableEntryLocations.length; i++) {
    TableEntryLocation currentLocation=tableEntryLocations[i];
    if (tableRenamed && oldLocation.tableName.equals(currentLocation.tableName)) {
      oldLocation.columnName=currentLocation.columnName;
      newLocation.columnName=currentLocation.columnName;
    }
    if (currentLocation.equals(oldLocation)) {
      currentExpression=dataMapExpressionParser.replaceLocation(currentExpression,currentLocation,newLocation);
    }
  }
  entry.setExpression(currentExpression);
}

Fixed version (ground truth):
public void replaceLocation(TableEntryLocation oldLocation,TableEntryLocation newLocation,ExternalDbMapEntry entry,DataMapExpressionParser dataMapExpressionParser,boolean tableRenamed){
  String currentExpression=entry.getExpression();
  if (currentExpression == null || currentExpression.length() == 0) {
    return;
  }
  TableEntryLocation[] tableEntryLocations=dataMapExpressionParser.parseTableEntryLocations(currentExpression);
  for (  TableEntryLocation currentLocation : tableEntryLocations) {
    if (tableRenamed && oldLocation.tableName.equals(currentLocation.tableName)) {
      oldLocation.columnName=currentLocation.columnName;
      newLocation.columnName=currentLocation.columnName;
    }
    if (currentLocation.equals(oldLocation)) {
      currentExpression=dataMapExpressionParser.replaceLocation(currentExpression,currentLocation,newLocation);
    }
  }
  entry.setExpression(currentExpression);
}
Program: 123361
Project: 123361
Buggy source:
public int open(final Composite parent){
  return open(parent.getDisplay());
}

Fixed version (ground truth):
@Override public int open(final Composite parent){
  return open(parent.getDisplay());
}
Program: 123365
Project: 123365
Buggy source:
private void expandSomeNodes(RepositoryCheckBoxView view){
  if (view == null) {
    return;
  }
  final RepositoryNode root=view.getRoot();
  if (root instanceof IProjectRepositoryNode) {
    final IProjectRepositoryNode rootNode=(IProjectRepositoryNode)root;
    final TreeViewer viewer=view.getViewer();
    IRepositoryNode metadataConNode=rootNode.getMetadataNode();
    if (metadataConNode != null) {
      viewer.expandToLevel(metadataConNode,1);
    }
    IRepositoryNode codeNode=rootNode.getCodeNode();
    if (codeNode != null) {
      viewer.expandToLevel(codeNode,1);
    }
  }
}

Fixed version (ground truth):
private void expandSomeNodes(IProjectRepositoryNode root){
  if (root instanceof IProjectRepositoryNode) {
    final IProjectRepositoryNode rootNode=(IProjectRepositoryNode)root;
    IRepositoryNode metadataConNode=rootNode.getMetadataNode();
    if (metadataConNode != null) {
      treeViewer.expandToLevel(metadataConNode,1);
    }
    IRepositoryNode codeNode=rootNode.getCodeNode();
    if (codeNode != null) {
      treeViewer.expandToLevel(codeNode,1);
    }
  }
}
Program: 123367
Project: 123367
Buggy source:
private void expandSomeNodes(RepositoryCheckBoxView view){
  if (view == null) {
    return;
  }
  final RepositoryNode root=view.getRoot();
  if (root instanceof IProjectRepositoryNode) {
    final IProjectRepositoryNode rootNode=(IProjectRepositoryNode)root;
    final TreeViewer viewer=view.getViewer();
    IRepositoryNode metadataConNode=rootNode.getMetadataNode();
    if (metadataConNode != null) {
      viewer.expandToLevel(metadataConNode,1);
    }
    IRepositoryNode codeNode=rootNode.getCodeNode();
    if (codeNode != null) {
      viewer.expandToLevel(codeNode,1);
    }
  }
}

Fixed version (ground truth):
private void expandSomeNodes(IProjectRepositoryNode root){
  if (root instanceof IProjectRepositoryNode) {
    IRepositoryNode metadataConNode=root.getMetadataNode();
    if (metadataConNode != null) {
      treeViewer.expandToLevel(metadataConNode,1);
    }
    IRepositoryNode codeNode=root.getCodeNode();
    if (codeNode != null) {
      treeViewer.expandToLevel(codeNode,1);
    }
  }
}
Program: 123368
Project: 123368
Buggy source:
public void dispose(){
  getSite().setSelectionProvider(null);
  getSite().getWorkbenchWindow().getSelectionService().removeSelectionListener(this);
  super.dispose();
  if (isKeepPropertyLocked()) {
    return;
  }
  IProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
  try {
    Property property=repFactory.getUptodateProperty(repositoryEditorInput.getItem().getProperty());
    repositoryEditorInput.setItem(property.getItem());
    repFactory.unlock(repositoryEditorInput.getItem());
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  LoginException e) {
    ExceptionHandler.process(e);
  }
  RepositoryNode repositoryNode=repositoryEditorInput.getRepositoryNode();
  if (repositoryNode == null) {
    repositoryEditorInput.setRepositoryNode(null);
    repositoryNode=repositoryEditorInput.getRepositoryNode();
  }
  if (repositoryNode != null) {
    if (repFactory.getStatus(repositoryEditorInput.getItem()) == ERepositoryStatus.DELETED) {
      RepositoryManager.refreshDeletedNode(null);
    }
 else {
      RepositoryManager.refreshSavedNode(repositoryNode);
    }
  }
}

Fixed version (ground truth):
public void dispose(){
  getSite().setSelectionProvider(null);
  getSite().getWorkbenchWindow().getSelectionService().removeSelectionListener(this);
  super.dispose();
  if (isKeepPropertyLocked()) {
    return;
  }
  IProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
  try {
    Property property=repFactory.getUptodateProperty(repositoryEditorInput.getItem().getProperty());
    repositoryEditorInput.setItem(property.getItem());
    repFactory.unlock(repositoryEditorInput.getItem());
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
catch (  LoginException e) {
  }
  RepositoryNode repositoryNode=repositoryEditorInput.getRepositoryNode();
  if (repositoryNode == null) {
    repositoryEditorInput.setRepositoryNode(null);
    repositoryNode=repositoryEditorInput.getRepositoryNode();
  }
  if (repositoryNode != null) {
    RepositoryManager.refresh(ERepositoryObjectType.BUSINESS_PROCESS);
  }
}
Program: 123370
Project: 123370
Buggy source:
public void dragFinished(){
  refresh();
  LocalSelectionTransfer.getTransfer().setSelection(null);
  LocalSelectionTransfer.getTransfer().setSelectionSetTime(0);
}

Fixed version (ground truth):
public void dragFinished(){
  LocalSelectionTransfer.getTransfer().setSelection(null);
  LocalSelectionTransfer.getTransfer().setSelectionSetTime(0);
}
Program: 123371
Project: 123371
Buggy source:
/** 
 * only refresh the child of root node.
 */
public void refreshAllChildNodes(RepositoryNode rootNode){
  if (rootNode != null) {
    rootNode.setInitialized(false);
    if (!rootNode.getContentType().equals(ERepositoryObjectType.METADATA))     rootNode.getChildren().clear();
    if (rootNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)rootNode.getParent()).clearNodeAndProjectCash();
    }
    contentProvider.getChildren(rootNode);
    viewer.refresh(rootNode);
    final ProjectRepositoryNode root=(ProjectRepositoryNode)getRoot();
    if (!rootNode.getContentType().equals(ERepositoryObjectType.DOCUMENTATION)) {
      root.getRecBinNode().setInitialized(false);
      root.getRecBinNode().getChildren().clear();
      contentProvider.getChildren(root.getRecBinNode());
      viewer.refresh(root.getRecBinNode());
    }
  }
}

Fixed version (ground truth):
/** 
 * only refresh the child of root node.
 */
public void refreshAllChildNodes(RepositoryNode rootNode){
  if (rootNode != null) {
    rootNode.setInitialized(false);
    if (rootNode.getContentType() != null && !rootNode.getContentType().equals(ERepositoryObjectType.METADATA))     rootNode.getChildren().clear();
    if (rootNode.getParent() instanceof ProjectRepositoryNode) {
      ((ProjectRepositoryNode)rootNode.getParent()).clearNodeAndProjectCash();
    }
    contentProvider.getChildren(rootNode);
    viewer.refresh(rootNode);
    final ProjectRepositoryNode root=(ProjectRepositoryNode)getRoot();
    if (rootNode.getContentType() != null && !rootNode.getContentType().equals(ERepositoryObjectType.DOCUMENTATION)) {
      root.getRecBinNode().setInitialized(false);
      root.getRecBinNode().getChildren().clear();
      contentProvider.getChildren(root.getRecBinNode());
      viewer.refresh(root.getRecBinNode());
    }
  }
}
Program: 123372
Project: 123372
Buggy source:
public void refresh(ERepositoryObjectType type){
  if (type != null && !type.isSubItem()) {
    RepositoryNode rootNode=researchRootRepositoryNode(type);
    refreshAllChildNodes(rootNode);
  }
 else   if (type != null && (type == ERepositoryObjectType.METADATA_SAP_FUNCTION || type == ERepositoryObjectType.METADATA_SAP_IDOC)) {
    RepositoryNode rootNode=researchRootRepositoryNode(type);
    refreshAllChildNodes(rootNode);
  }
}

Fixed version (ground truth):
public void refresh(ERepositoryObjectType type){
  if (type != null && !type.isSubItem()) {
    RepositoryNode rootNode=researchRootRepositoryNode(type);
    refreshAllChildNodes(rootNode);
  }
 else   if (type != null && (type == ERepositoryObjectType.METADATA_SAP_FUNCTION || type == ERepositoryObjectType.METADATA_SAP_IDOC)) {
    RepositoryNode rootNode=researchRootRepositoryNode(type);
    refreshAllChildNodes(rootNode);
  }
  refreshContextByType(type);
}
Program: 123373
Project: 123373
Buggy source:
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  String username=usernameTextForConnect.getText().trim();
  String password=passwordTextForconnect.getText().trim();
  boolean success=false;
  try {
    success=RegisterManagement.getInstance().createUser(username,password,"String_Node_Str","String_Node_Str","String_Node_Str",isProxyEnable,proxyHost,proxyPort,proxyUser,proxyPassword);
  }
 catch (  BusinessException e1) {
    ExceptionHandler.process(e1);
  }
  if (success) {
    boolean isUserPassRight=true;
    if (PluginChecker.isExchangeSystemLoaded()) {
      IExchangeService service=(IExchangeService)GlobalServiceRegister.getDefault().getService(IExchangeService.class);
      String checkUserAndPass=service.checkUserAndPass(username,password);
      if (checkUserAndPass != null) {
        isUserPassRight=false;
        MessageDialog.openInformation(getShell(),Messages.getString("String_Node_Str"),checkUserAndPass);
      }
    }
    if (isUserPassRight) {
      IPreferenceStore prefStore=PlatformUI.getPreferenceStore();
      String connectionEmail=project.getAuthor().getLogin();
      prefStore.setValue(connectionEmail,"String_Node_Str" + "String_Node_Str" + username + "String_Node_Str"+ password);
      okPressed();
    }
  }
}
Program: 123375
Project: 123375
Buggy source:
public void partClosed(IWorkbenchPart part){
  if (part == AbstractMultiPageTalendEditor.this) {
    restorePropertyInformation();
    IProject currentProject;
    try {
      currentProject=ResourceModelUtils.getProject(ProjectManager.getInstance().getCurrentProject());
      String jobScriptVersion="String_Node_Str";
      if (getEditorInput() != null && getEditorInput() instanceof RepositoryEditorInput) {
        Item item=((RepositoryEditorInput)getEditorInput()).getItem();
        if (item != null) {
          Property property=item.getProperty();
          if (property != null) {
            jobScriptVersion="String_Node_Str" + property.getVersion();
          }
        }
      }
      IFile file=currentProject.getFolder("String_Node_Str").getFile(getEditorInput().getName() + jobScriptVersion + "String_Node_Str"+ "String_Node_Str");
      if (file.exists()) {
        file.delete(true,null);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
public void partClosed(IWorkbenchPart part){
  if (part == AbstractMultiPageTalendEditor.this) {
    restorePropertyInformation();
    IProject currentProject;
    try {
      currentProject=ResourceModelUtils.getProject(ProjectManager.getInstance().getCurrentProject());
      String jobScriptVersion="String_Node_Str";
      if (getEditorInput() != null && getEditorInput() instanceof RepositoryEditorInput) {
        Item item=((RepositoryEditorInput)getEditorInput()).getItem();
        if (item != null) {
          Property property=item.getProperty();
          if (property != null) {
            jobScriptVersion="String_Node_Str" + property.getVersion();
          }
        }
      }
      IFile file=currentProject.getFolder("String_Node_Str").getFile(getEditorInput().getName() + jobScriptVersion + "String_Node_Str"+ "String_Node_Str");
      if (file.exists()) {
        file.delete(true,null);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
    changeContextsViewStatus(true);
  }
}
Program: 123378
Project: 123378
Buggy source:
/** 
 * DOC amaumont Comment method "ckeckConstraintsAreEmpty".
 * @param ExternalDbMapTable
 * @return
 */
public boolean checkFiltersAreEmpty(ExternalDbMapTable outputTable){
  List<ExternalDbMapEntry> constraints=outputTable.getCustomConditionsEntries();
  int lstSize=constraints.size();
  boolean oneConstraintIsNotEmpty=false;
  for (int i=0; i < lstSize; i++) {
    String constraintExpression=((ExternalDbMapEntry)constraints.get(i)).getExpression();
    if (constraintExpression != null && constraintExpression.trim().length() > 0) {
      oneConstraintIsNotEmpty=true;
      break;
    }
  }
  return !oneConstraintIsNotEmpty;
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "ckeckConstraintsAreEmpty".
 * @param ExternalDbMapTable
 * @return
 */
public boolean checkFiltersAreEmpty(ExternalDbMapTable outputTable){
  List<ExternalDbMapEntry> constraints=outputTable.getCustomConditionsEntries();
  int lstSize=constraints.size();
  boolean oneConstraintIsNotEmpty=false;
  for (int i=0; i < lstSize; i++) {
    String constraintExpression=(constraints.get(i)).getExpression();
    if (constraintExpression != null && constraintExpression.trim().length() > 0) {
      oneConstraintIsNotEmpty=true;
      break;
    }
  }
  return !oneConstraintIsNotEmpty;
}
Program: 123380
Project: 123380
Buggy source:
protected String getSpecialRightJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.RIGHT_OUTER_JOIN_ORACLE) {
    return JOIN;
  }
  return DbMapSqlConstants.EMPTY;
}

Fixed version (ground truth):
@Override protected String getSpecialRightJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.RIGHT_OUTER_JOIN_ORACLE) {
    return JOIN;
  }
  return DbMapSqlConstants.EMPTY;
}
Program: 123381
Project: 123381
Buggy source:
protected String getSpecialLeftJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.LEFT_OUTER_JOIN_ORACLE) {
    return JOIN + DbMapSqlConstants.SPACE;
  }
  return DbMapSqlConstants.EMPTY;
}

Fixed version (ground truth):
@Override protected String getSpecialLeftJoin(ExternalDbMapTable table){
  if (language.getJoin(table.getJoinType()) == OracleLanguage.ORACLEJOIN.LEFT_OUTER_JOIN_ORACLE) {
    return JOIN + DbMapSqlConstants.SPACE;
  }
  return DbMapSqlConstants.EMPTY;
}
Program: 123384
Project: 123384
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    throw new InvocationTargetException(e);
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IPath destinationPath=null;
  String contentType="String_Node_Str";
  if (rNode != null && rNode.getType().equals(ENodeType.SIMPLE_FOLDER)) {
    destinationPath=RepositoryNodeUtilities.getPath(rNode);
    contentType=rNode.getContentType().name();
  }
  repositoryUtil.setErrors(false);
  repositoryUtil.clear();
  repositoryUtil.importItemRecords(manager,itemRecords,monitor,overwrite,destinationPath,contentType);
  if (repositoryUtil.hasErrors()) {
    throw new InvocationTargetException(new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str")));
  }
}
Program: 123386
Project: 123386
Buggy source:
private CellStyle getPreCellStyle(){
  if (isAbsY && keepCellFormat) {
    if (preCell == null) {
      return null;
    }
 else {
      CellStyle preCellStyle=preCell.getCellStyle();
      CellStyle targetCellStyle=wb.createCellStyle();
      targetCellStyle.cloneStyleFrom(preCellStyle);
      return targetCellStyle;
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private CellStyle getPreCellStyle(){
  if (isAbsY && keepCellFormat) {
    CellStyle preCellStyle=null;
    if (preCell == null) {
      preCellStyle=preSheet.getColumnStyle(curCell.getColumnIndex());
    }
 else {
      preCellStyle=preCell.getCellStyle();
    }
    CellStyle targetCellStyle=wb.createCellStyle();
    targetCellStyle.cloneStyleFrom(preCellStyle);
    return targetCellStyle;
  }
 else {
    return null;
  }
}