nus-yam/ex-repair huggingface dataset:
Program: 130012
Project: 130012
Buggy source:
private void updateTable(Property property){
  if (property == null) {
    return;
  }
  Connection connection=null;
  Item item=property.getItem();
  if (item instanceof ConnectionItem) {
    ConnectionItem cItem=(ConnectionItem)item;
    connection=cItem.getConnection();
  }
  if (connection == null) {
    return;
  }
  Set tables=null;
  if (table.eContainer() instanceof SAPFunctionUnit) {
    SAPFunctionUnit funUnit=(SAPFunctionUnit)table.eContainer();
    tables=ConnectionHelper.getTables(connection,funUnit);
  }
 else {
    tables=ConnectionHelper.getTables(connection);
  }
  if (tables != null) {
    Iterator iterator=tables.iterator();
    while (iterator.hasNext()) {
      Object obj=iterator.next();
      if (obj instanceof org.talend.core.model.metadata.builder.connection.MetadataTable) {
        org.talend.core.model.metadata.builder.connection.MetadataTable repObj=(org.talend.core.model.metadata.builder.connection.MetadataTable)obj;
        if (table != null && table.getLabel() != null && table.getLabel().equals(repObj.getLabel()) && table.eContainer().equals(repObj.eContainer())) {
          table=repObj;
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
private void updateTable(Property property){
  if (property == null) {
    return;
  }
  Connection connection=null;
  Item item=property.getItem();
  if (item instanceof ConnectionItem) {
    ConnectionItem cItem=(ConnectionItem)item;
    connection=cItem.getConnection();
  }
  if (connection == null) {
    return;
  }
  Set tables=null;
  if (table.eContainer() instanceof SAPFunctionUnit) {
    SAPFunctionUnit funUnit=(SAPFunctionUnit)table.eContainer();
    tables=ConnectionHelper.getTables(connection,funUnit);
  }
 else {
    tables=ConnectionHelper.getTables(connection);
  }
  if (tables != null) {
    Iterator iterator=tables.iterator();
    while (iterator.hasNext()) {
      Object obj=iterator.next();
      if (obj instanceof org.talend.core.model.metadata.builder.connection.MetadataTable) {
        org.talend.core.model.metadata.builder.connection.MetadataTable repObj=(org.talend.core.model.metadata.builder.connection.MetadataTable)obj;
        boolean sameParent=false;
        if (table.eContainer() instanceof ModelElement && repObj.eContainer() instanceof ModelElement) {
          ModelElement tableP=(ModelElement)table.eContainer();
          ModelElement repObjP=(ModelElement)repObj.eContainer();
          if (tableP.getName() != null && tableP.getName().equals(repObjP.getName())) {
            sameParent=true;
          }
        }
        if (table != null && table.getLabel() != null && table.getLabel().equals(repObj.getLabel()) && sameParent) {
          table=repObj;
          break;
        }
      }
    }
  }
}
Program: 130016
Project: 130016
Buggy source:
public DocumentLookupCache(String matchingMode){
  if ("String_Node_Str".equals(matchingMode)) {
    cache=new UniqueLookupCache();
  }
 else   if ("String_Node_Str".equals(matchingMode)) {
    cache=new FirstLookupCache();
  }
 else   if ("String_Node_Str".equals(matchingMode)) {
    cache=new AllMatchLookupCache();
  }
}

Fixed version (ground truth):
public DocumentLookupCache(String matchingMode){
  if ("String_Node_Str".equals(matchingMode)) {
    cache=new UniqueLookupCache();
  }
 else   if ("String_Node_Str".equals(matchingMode)) {
    cache=new FirstLookupCache();
  }
 else   if ("String_Node_Str".equals(matchingMode) || "String_Node_Str".equals(matchingMode)) {
    cache=new AllMatchLookupCache();
  }
}
Program: 130017
Project: 130017
Buggy source:
private TableNode transferTableToTableNode(MetadataTable tableItem,TableNode parentNode){
  TableNode existTableNode=null;
  if (tableItem instanceof TdTable) {
    TdTable td=(TdTable)tableItem;
    existTableNode=new TableNode();
    existTableNode.setType(TableNode.TABLE);
    existTableNode.setValue(td.getLabel());
    existTableNode.setItemType(td.getTableType());
    existTableNode.setTable(td);
    existTableNode.setParent(parentNode);
    parentNode.addChild(existTableNode);
  }
 else   if (tableItem instanceof TdView) {
    TdView tv=(TdView)tableItem;
    existTableNode=new TableNode();
    existTableNode.setType(TableNode.TABLE);
    existTableNode.setValue(tv.getLabel());
    existTableNode.setItemType(tv.getTableType());
    existTableNode.setView(tv);
    existTableNode.setParent(parentNode);
    parentNode.addChild(existTableNode);
  }
  return existTableNode;
}

Fixed version (ground truth):
private TableNode transferTableToTableNode(MetadataTable tableItem,TableNode parentNode){
  TableNode existTableNode=null;
  if (tableItem instanceof TdTable) {
    TdTable td=(TdTable)tableItem;
    existTableNode=new TableNode();
    existTableNode.setType(TableNode.TABLE);
    existTableNode.setValue(td.getLabel());
    existTableNode.setItemType(td.getTableType());
    existTableNode.setTable(td);
    if (parentNode != null) {
      existTableNode.setParent(parentNode);
      parentNode.addChild(existTableNode);
    }
  }
 else   if (tableItem instanceof TdView) {
    TdView tv=(TdView)tableItem;
    existTableNode=new TableNode();
    existTableNode.setType(TableNode.TABLE);
    existTableNode.setValue(tv.getLabel());
    existTableNode.setItemType(tv.getTableType());
    existTableNode.setView(tv);
    if (parentNode != null) {
      existTableNode.setParent(parentNode);
      parentNode.addChild(existTableNode);
    }
  }
  return existTableNode;
}
Program: 130019
Project: 130019
Buggy source:
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
}

Fixed version (ground truth):
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(metadataconnection.getDbType());
  if (isAccess) {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,getConnection().getName(),getConnection(),tables);
  }
 else {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
  }
}
Program: 130020
Project: 130020
Buggy source:
/** 
 * DOC amaumont Comment method "init".
 * @param tree
 * @param tables
 * @param backgroundRefresher
 */
public void init(Tree tree,Table[] tables,IBackgroundRefresher backgroundRefresher){
  this.display=tree.getDisplay();
  this.backgroundRefresher=backgroundRefresher;
  for (  Table table : tables) {
    new LinkableTable(this,backgroundRefresher,table,(BgDrawableComposite)this,false);
  }
  new LinkableTree(this,backgroundRefresher,tree,(BgDrawableComposite)this,true);
  this.tables=Arrays.asList(tables);
  this.tree=tree;
}

Fixed version (ground truth):
public void init(Tree tree,Table[] tables,IControlsLinker controlsLinker,IBackgroundRefresher backgroundRefresher){
  this.display=tree.getDisplay();
  this.backgroundRefresher=backgroundRefresher;
  for (  Table table : tables) {
    new LinkableTable(controlsLinker,backgroundRefresher,table,(BgDrawableComposite)this,false);
  }
  linkableTree=new LinkableTree(controlsLinker,backgroundRefresher,tree,(BgDrawableComposite)this,true);
  this.tables=Arrays.asList(tables);
  this.tree=tree;
}
Program: 130021
Project: 130021
Buggy source:
@Override protected void addFields(){
  mainSashFormComposite=new SashForm(this,SWT.HORIZONTAL | SWT.SMOOTH);
  mainSashFormComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  mainSashFormComposite.setBackgroundMode(SWT.INHERIT_FORCE);
  addSchemaViewer(mainSashFormComposite,300,100);
  addXmlFileViewer(mainSashFormComposite,400,100);
  mainSashFormComposite.setWeights(new int[]{40,60});
  linker=new XmlFileSchema2TreeLinker(mainSashFormComposite);
  linker.setForm(this);
  linker.init(schemaViewer.getTable(),xmlViewer);
}

Fixed version (ground truth):
@Override protected void addFields(){
  mainSashFormComposite=new SashForm(this,SWT.HORIZONTAL | SWT.SMOOTH);
  mainSashFormComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  mainSashFormComposite.setBackgroundMode(SWT.INHERIT_FORCE);
  addSchemaViewer(mainSashFormComposite,300,100);
  addXmlFileViewer(mainSashFormComposite,400,100);
  mainSashFormComposite.setWeights(new int[]{40,60});
  linker=new XmlFileSchema2TreeLinker(mainSashFormComposite);
  linker.setForm(this);
  linker.init(schemaViewer.getTable(),xmlViewer);
  XmlTree2SchemaLinker oppositeLinker=new XmlTree2SchemaLinker(mainSashFormComposite);
  oppositeLinker.setConnection(getConnection());
  oppositeLinker.setDelegateLinker(linker);
  oppositeLinker.init(xmlViewer,schemaViewer);
}
Program: 130022
Project: 130022
Buggy source:
public void redrawLinkers(){
  int maxColumnsNumber=CoreRuntimePlugin.getInstance().getPreferenceStore().getInt(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML);
  if (schemaViewer.getTable().getItems().length <= maxColumnsNumber + 1) {
    linker.removeAllLinks();
    TreeItem root=xmlViewer.getTree().getItem(0);
    TableItem[] tableItems=schemaViewer.getTable().getItems();
    initLinker(root,tableItems);
    if (linker.linkSize() == 0) {
      linker.updateLinksStyleAndControlsSelection(xmlViewer.getTree(),true);
    }
  }
}

Fixed version (ground truth):
public void redrawLinkers(){
  int maxColumnsNumber=CoreRuntimePlugin.getInstance().getPreferenceStore().getInt(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML);
  if (schemaViewer.getTable().getItems().length <= maxColumnsNumber + 1) {
    linker.removeAllLinks();
    TreeItem root=xmlViewer.getTree().getItem(0);
    TableItem[] tableItems=schemaViewer.getTable().getItems();
    initLinker(root,tableItems);
    linker.updateLinksStyleAndControlsSelection(xmlViewer.getTree(),true);
  }
}
Program: 130023
Project: 130023
Buggy source:
public void onXPathValueChanged(Widget widget){
  linksManager.removeLinksFromDataItem2(widget.getData());
  createLinks();
}

Fixed version (ground truth):
public void onXPathValueChanged(Widget widget){
  if (widget != null) {
    linksManager.removeLinksFromDataItem2(widget.getData());
  }
  createLinks();
}
Program: 130026
Project: 130026
Buggy source:
@Override protected String getBeanString(org.talend.core.model.metadata.builder.connection.MetadataColumn bean){
  return bean.getName();
}

Fixed version (ground truth):
@Override protected String getBeanString(org.talend.core.model.metadata.builder.connection.MetadataColumn bean){
  return bean.getLabel();
}
Program: 130028
Project: 130028
Buggy source:
/** 
 * This method is to override the rule list.
 * @param dbType SupportDBUrlType.dbkey
 * @param catalog
 * @param schema
 * @param table
 * @param ruleParam
 */
public void overrideRuleList(String dbType,String catalog,String schema,String table,IElementParameter ruleParam);

Fixed version (ground truth):
/** 
 * This method is to override the rule list.
 * @param dbType (value = SupportDBUrlType.dbkey)
 * @param catalog
 * @param schema
 * @param table
 * @param ruleParam
 */
public void overrideRuleList(IElementParameter dbType,IElementParameter catalog,IElementParameter schema,IElementParameter table,IElementParameter ruleParam);
Program: 130029
Project: 130029
Buggy source:
/** 
 * DOC amaumont Comment method "init".
 * @param tree
 * @param tables
 * @param backgroundRefresher
 */
public void init(Tree tree,Table[] tables,IBackgroundRefresher backgroundRefresher){
  this.display=tree.getDisplay();
  this.backgroundRefresher=backgroundRefresher;
  for (  Table table : tables) {
    new LinkableTable(this,backgroundRefresher,table,(BgDrawableComposite)this,false);
  }
  new LinkableTree(this,backgroundRefresher,tree,(BgDrawableComposite)this,true);
  this.tables=Arrays.asList(tables);
  this.tree=tree;
}

Fixed version (ground truth):
public void init(Tree tree,Table[] tables,IControlsLinker controlsLinker,IBackgroundRefresher backgroundRefresher){
  this.display=tree.getDisplay();
  this.backgroundRefresher=backgroundRefresher;
  for (  Table table : tables) {
    new LinkableTable(controlsLinker,backgroundRefresher,table,(BgDrawableComposite)this,false);
  }
  linkableTree=new LinkableTree(controlsLinker,backgroundRefresher,tree,(BgDrawableComposite)this,true);
  this.tables=Arrays.asList(tables);
  this.tree=tree;
}
Program: 130030
Project: 130030
Buggy source:
@Override protected void addFields(){
  mainSashFormComposite=new SashForm(this,SWT.HORIZONTAL | SWT.SMOOTH);
  mainSashFormComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  mainSashFormComposite.setBackgroundMode(SWT.INHERIT_FORCE);
  addSchemaViewer(mainSashFormComposite,300,100);
  addXmlFileViewer(mainSashFormComposite,400,100);
  mainSashFormComposite.setWeights(new int[]{40,60});
  linker=new XmlFileSchema2TreeLinker(mainSashFormComposite);
  linker.setForm(this);
  linker.init(schemaViewer.getTable(),xmlViewer);
}

Fixed version (ground truth):
@Override protected void addFields(){
  mainSashFormComposite=new SashForm(this,SWT.HORIZONTAL | SWT.SMOOTH);
  mainSashFormComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
  mainSashFormComposite.setBackgroundMode(SWT.INHERIT_FORCE);
  addSchemaViewer(mainSashFormComposite,300,100);
  addXmlFileViewer(mainSashFormComposite,400,100);
  mainSashFormComposite.setWeights(new int[]{40,60});
  linker=new XmlFileSchema2TreeLinker(mainSashFormComposite);
  linker.setForm(this);
  linker.init(schemaViewer.getTable(),xmlViewer);
  XmlTree2SchemaLinker oppositeLinker=new XmlTree2SchemaLinker(mainSashFormComposite);
  oppositeLinker.setConnection(getConnection());
  oppositeLinker.setDelegateLinker(linker);
  oppositeLinker.init(xmlViewer,schemaViewer);
}
Program: 130031
Project: 130031
Buggy source:
public void redrawLinkers(){
  int maxColumnsNumber=CoreRuntimePlugin.getInstance().getPreferenceStore().getInt(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML);
  if (schemaViewer.getTable().getItems().length <= maxColumnsNumber + 1) {
    linker.removeAllLinks();
    TreeItem root=xmlViewer.getTree().getItem(0);
    TableItem[] tableItems=schemaViewer.getTable().getItems();
    initLinker(root,tableItems);
    if (linker.linkSize() == 0) {
      linker.updateLinksStyleAndControlsSelection(xmlViewer.getTree(),true);
    }
  }
}

Fixed version (ground truth):
public void redrawLinkers(){
  int maxColumnsNumber=CoreRuntimePlugin.getInstance().getPreferenceStore().getInt(ITalendCorePrefConstants.MAXIMUM_AMOUNT_OF_COLUMNS_FOR_XML);
  if (schemaViewer.getTable().getItems().length <= maxColumnsNumber + 1) {
    linker.removeAllLinks();
    TreeItem root=xmlViewer.getTree().getItem(0);
    TableItem[] tableItems=schemaViewer.getTable().getItems();
    initLinker(root,tableItems);
    linker.updateLinksStyleAndControlsSelection(xmlViewer.getTree(),true);
  }
}
Program: 130032
Project: 130032
Buggy source:
public void onXPathValueChanged(Widget widget){
  linksManager.removeLinksFromDataItem2(widget.getData());
  createLinks();
}

Fixed version (ground truth):
public void onXPathValueChanged(Widget widget){
  if (widget != null) {
    linksManager.removeLinksFromDataItem2(widget.getData());
  }
  createLinks();
}
Program: 130033
Project: 130033
Buggy source:
private void updateTable(Property property){
  if (property == null) {
    return;
  }
  Connection connection=null;
  Item item=property.getItem();
  if (item instanceof ConnectionItem) {
    ConnectionItem cItem=(ConnectionItem)item;
    connection=cItem.getConnection();
  }
  if (connection == null) {
    return;
  }
  Set tables=null;
  if (table.eContainer() instanceof SAPFunctionUnit) {
    SAPFunctionUnit funUnit=(SAPFunctionUnit)table.eContainer();
    tables=ConnectionHelper.getTables(connection,funUnit);
  }
 else {
    tables=ConnectionHelper.getTables(connection);
  }
  if (tables != null) {
    Iterator iterator=tables.iterator();
    while (iterator.hasNext()) {
      Object obj=iterator.next();
      if (obj instanceof org.talend.core.model.metadata.builder.connection.MetadataTable) {
        org.talend.core.model.metadata.builder.connection.MetadataTable repObj=(org.talend.core.model.metadata.builder.connection.MetadataTable)obj;
        if (table != null && table.getLabel() != null && table.getLabel().equals(repObj.getLabel()) && table.eContainer().equals(repObj.eContainer())) {
          table=repObj;
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
private void updateTable(Property property){
  if (property == null) {
    return;
  }
  Connection connection=null;
  Item item=property.getItem();
  if (item instanceof ConnectionItem) {
    ConnectionItem cItem=(ConnectionItem)item;
    connection=cItem.getConnection();
  }
  if (connection == null) {
    return;
  }
  Set tables=null;
  if (table.eContainer() instanceof SAPFunctionUnit) {
    SAPFunctionUnit funUnit=(SAPFunctionUnit)table.eContainer();
    tables=ConnectionHelper.getTables(connection,funUnit);
  }
 else {
    tables=ConnectionHelper.getTables(connection);
  }
  if (tables != null) {
    Iterator iterator=tables.iterator();
    while (iterator.hasNext()) {
      Object obj=iterator.next();
      if (obj instanceof org.talend.core.model.metadata.builder.connection.MetadataTable) {
        org.talend.core.model.metadata.builder.connection.MetadataTable repObj=(org.talend.core.model.metadata.builder.connection.MetadataTable)obj;
        boolean sameParent=false;
        if (table.eContainer() instanceof ModelElement && repObj.eContainer() instanceof ModelElement) {
          ModelElement tableP=(ModelElement)table.eContainer();
          ModelElement repObjP=(ModelElement)repObj.eContainer();
          if (tableP.getName() != null && tableP.getName().equals(repObjP.getName())) {
            sameParent=true;
          }
        }
        if (table != null && table.getLabel() != null && table.getLabel().equals(repObj.getLabel()) && sameParent) {
          table=repObj;
          break;
        }
      }
    }
  }
}
Program: 130036
Project: 130036
Buggy source:
public void renameFolder(ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path.lastSegment().equalsIgnoreCase(label)) {
    return;
  }
  this.repositoryFactoryFromProvider.renameFolder(type,path,label);
  if (type == ERepositoryObjectType.PROCESS) {
    fireRepositoryPropertyChange(ERepositoryActionName.FOLDER_RENAME.getName(),path,label);
  }
  if (type == ERepositoryObjectType.JOBLET) {
    fireRepositoryPropertyChange(ERepositoryActionName.JOBLET_FOLDER_RENAME.getName(),path,label);
  }
  this.repositoryFactoryFromProvider.updateItemsPath(type,path.removeLastSegments(1).append(label));
}

Fixed version (ground truth):
public void renameFolder(ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  this.repositoryFactoryFromProvider.renameFolder(type,path,label);
  if (type == ERepositoryObjectType.PROCESS) {
    fireRepositoryPropertyChange(ERepositoryActionName.FOLDER_RENAME.getName(),path,label);
  }
  if (type == ERepositoryObjectType.JOBLET) {
    fireRepositoryPropertyChange(ERepositoryActionName.JOBLET_FOLDER_RENAME.getName(),path,label);
  }
  this.repositoryFactoryFromProvider.updateItemsPath(type,path.removeLastSegments(1).append(label));
}
Program: 130037
Project: 130037
Buggy source:
public void renameFolder(ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path.lastSegment().equalsIgnoreCase(label)) {
    return;
  }
  this.repositoryFactoryFromProvider.renameFolder(type,path,label);
  if (type == ERepositoryObjectType.PROCESS) {
    fireRepositoryPropertyChange(ERepositoryActionName.FOLDER_RENAME.getName(),path,label);
  }
  if (type == ERepositoryObjectType.JOBLET) {
    fireRepositoryPropertyChange(ERepositoryActionName.JOBLET_FOLDER_RENAME.getName(),path,label);
  }
  this.repositoryFactoryFromProvider.updateItemsPath(type,path.removeLastSegments(1).append(label));
}

Fixed version (ground truth):
public void renameFolder(ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  this.repositoryFactoryFromProvider.renameFolder(type,path,label);
  if (type == ERepositoryObjectType.PROCESS) {
    fireRepositoryPropertyChange(ERepositoryActionName.FOLDER_RENAME.getName(),path,label);
  }
  if (type == ERepositoryObjectType.JOBLET) {
    fireRepositoryPropertyChange(ERepositoryActionName.JOBLET_FOLDER_RENAME.getName(),path,label);
  }
  this.repositoryFactoryFromProvider.updateItemsPath(type,path.removeLastSegments(1).append(label));
}
Program: 130038
Project: 130038
Buggy source:
private Resource saveScreenshots(Item item){
  Resource itemResource=xmiResourceManager.getScreenshotResource(item);
  itemResource.getContents().clear();
  EMap screenshots=null;
  if (item instanceof ProcessItem) {
    screenshots=((ProcessItem)item).getProcess().getScreenshots();
    itemResource.getContents().addAll(screenshots);
  }
 else   if (item instanceof JobletProcessItem) {
    screenshots=((JobletProcessItem)item).getJobletProcess().getScreenshots();
    itemResource.getContents().addAll(screenshots);
  }
  return itemResource;
}

Fixed version (ground truth):
private Resource saveScreenshots(Item item){
  Resource itemResource=xmiResourceManager.getScreenshotResource(item);
  itemResource.getContents().clear();
  EMap screenshots=null;
  if (item instanceof ProcessItem) {
    screenshots=((ProcessItem)item).getProcess().getScreenshots();
    itemResource.getContents().addAll(EcoreUtil.copyAll(screenshots));
  }
 else   if (item instanceof JobletProcessItem) {
    screenshots=((JobletProcessItem)item).getJobletProcess().getScreenshots();
    itemResource.getContents().addAll(screenshots);
  }
  return itemResource;
}
Program: 130041
Project: 130041
Buggy source:
/** 
 * Extract last word of an expression, the last character must be a letter or a number.
 * @param currentExpr
 * @return
 */
public static String extractTagName(String currentExpr){
  String[] exprs=currentExpr.split("String_Node_Str");
  if (exprs.length > 0) {
    currentExpr=exprs[exprs.length - 1];
  }
  return currentExpr;
}

Fixed version (ground truth):
/** 
 * Extract last word of an expression, the last character must be a letter or a number.
 * @param currentExpr
 * @return
 */
public static String extractTagName(String currentExpr){
  String[] exprs=currentExpr.split("String_Node_Str");
  if (exprs.length > 0) {
    currentExpr=exprs[exprs.length - 1];
  }
  if (currentExpr.contains("String_Node_Str")) {
    currentExpr=currentExpr.split("String_Node_Str")[1];
  }
  return currentExpr;
}
Program: 130042
Project: 130042
Buggy source:
/** 
 * Extract last word of an expression, the last character must be a letter or a number.
 * @param currentExpr
 * @return
 */
public static String extractColumnName(String currentExpr){
  return currentExpr.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Extract last word of an expression, the last character must be a letter or a number.
 * @param currentExpr
 * @param fullSchemaTargetList
 * @return
 */
public static String extractColumnName(String currentExpr,List<SchemaTarget> fullSchemaTargetList){
  String columnName=currentExpr.replaceAll("String_Node_Str","String_Node_Str");
  UniqueStringGenerator<SchemaTarget> uniqueStringGenerator=new UniqueStringGenerator<SchemaTarget>(columnName,fullSchemaTargetList){
    @Override protected String getBeanString(    SchemaTarget bean){
      return bean.getTagName();
    }
  }
;
  columnName=uniqueStringGenerator.getUniqueString();
  return columnName;
}
Program: 130045
Project: 130045
Buggy source:
/** 
 * self definition:escape char ,for example -->'\\'
 */
public static String addEscapeChars(String padding_chars,char escapeChar){
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < padding_chars.length(); i++) {
    char c=padding_chars.charAt(i);
    if (!(Character.isLetterOrDigit(c) || c == '_')) {
      sb.append(escapeChar);
      sb.append(c);
    }
 else {
      sb.append(c);
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * self definition:escape char ,for example -->'\\'
 */
public static String addEscapeChars(String padding_chars,char escapeChar){
  StringBuffer sb=new StringBuffer();
  for (int i=0; i < padding_chars.length(); i++) {
    char c=padding_chars.charAt(i);
    if (!(Character.isLetterOrDigit(c) || c == '_' || Character.isWhitespace(c))) {
      sb.append(escapeChar);
      sb.append(c);
    }
 else {
      sb.append(c);
    }
  }
  return sb.toString();
}
Program: 130046
Project: 130046
Buggy source:
/** 
 * DOC YeXiaowei Comment method "isValid".
 * @param itemName
 * @param selectionInClipboard
 * @return null means valid, other means some error exist
 */
private String validJobName(String itemName,TreeSelection selectionInClipboard){
  IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
  IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
  if (itemName.length() == 0) {
    return Messages.getString("String_Node_Str");
  }
 else   if (!Pattern.matches(RepositoryConstants.getPattern(((RepositoryNode)selectionInClipboard.toArray()[0]).getObject().getRepositoryObjectType()),itemName)) {
    return Messages.getString("String_Node_Str");
  }
 else {
    try {
      Item testNewItem=createNewItem();
      if (testNewItem != null) {
        if (!repositoryFactory.isNameAvailable(testNewItem,itemName)) {
          return Messages.getString("String_Node_Str");
        }
      }
    }
 catch (    PersistenceException e) {
      return Messages.getString("String_Node_Str");
    }
    if (isKeyword(itemName)) {
      return Messages.getString("String_Node_Str");
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "isValid".
 * @param itemName
 * @param selectionInClipboard
 * @return null means valid, other means some error exist
 */
private String validJobName(String itemName,TreeSelection selectionInClipboard){
  if (!isValid(itemName)) {
    return Messages.getString("String_Node_Str");
  }
  IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
  IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
  if (itemName.length() == 0) {
    return Messages.getString("String_Node_Str");
  }
 else   if (!Pattern.matches(RepositoryConstants.getPattern(((RepositoryNode)selectionInClipboard.toArray()[0]).getObject().getRepositoryObjectType()),itemName)) {
    return Messages.getString("String_Node_Str");
  }
 else {
    try {
      Item testNewItem=createNewItem();
      if (testNewItem != null) {
        if (!repositoryFactory.isNameAvailable(testNewItem,itemName)) {
          return Messages.getString("String_Node_Str");
        }
      }
    }
 catch (    PersistenceException e) {
      return Messages.getString("String_Node_Str");
    }
    if (isKeyword(itemName)) {
      return Messages.getString("String_Node_Str");
    }
  }
  return null;
}
Program: 130047
Project: 130047
Buggy source:
public String isValid(String newText){
  return validJobName(newText,selectionInClipboard);
}

Fixed version (ground truth):
public static boolean isValid(String str){
  Pattern pattern=Pattern.compile("String_Node_Str");
  return pattern.matcher(str).matches();
}
Program: 130052
Project: 130052
Buggy source:
public static Object parse(String text,String javaType,String pattern){
  if ("String_Node_Str".equals(javaType)) {
    return text;
  }
  if (text == null || text.length() == 0) {
    boolean isPrimitiveType=primitiveType.contains(javaType);
    if (!isPrimitiveType) {
      return null;
    }
 else {
      text=primitiveTypeToDefaultValueMap.get(javaType);
    }
  }
 else {
    if ("String_Node_Str".equals(javaType)) {
      return ParserUtils.parseTo_Date(text,pattern);
    }
    if ("String_Node_Str".equals(javaType)) {
      return text.getBytes();
    }
  }
  try {
    Method method=ParserUtils.class.getMethod("String_Node_Str" + javaType,String.class);
    return method.invoke(null,text);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public static Object parse(String text,String javaType,String pattern){
  if ("String_Node_Str".equals(javaType) || "String_Node_Str".equals(javaType)) {
    return text;
  }
  if (text == null || text.length() == 0) {
    boolean isPrimitiveType=primitiveType.contains(javaType);
    if (!isPrimitiveType) {
      return null;
    }
 else {
      text=primitiveTypeToDefaultValueMap.get(javaType);
    }
  }
 else {
    if ("String_Node_Str".equals(javaType)) {
      return ParserUtils.parseTo_Date(text,pattern);
    }
    if ("String_Node_Str".equals(javaType)) {
      return text.getBytes();
    }
  }
  try {
    Method method=ParserUtils.class.getMethod("String_Node_Str" + javaType,String.class);
    return method.invoke(null,text);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 130054
Project: 130054
Buggy source:
public static boolean hasSameNameButDifferentCase(FileName fileName){
  return !fileName.getResourceLabel().equals(fileName.getLastVersionProperty().getLabel()) && fileName.getResourceLabel().equalsIgnoreCase(fileName.getLastVersionProperty().getLabel());
}

Fixed version (ground truth):
public static boolean hasSameNameButDifferentCase(FileName fileName){
  return !fileName.getResourceLabel().equals(fileName.getLastVersionProperty().getLabel().replace('#','$')) && fileName.getResourceLabel().equalsIgnoreCase(fileName.getLastVersionProperty().getLabel().replace('#','$'));
}
Program: 130055
Project: 130055
Buggy source:
public static boolean mustChangeLabel(FileName fileName){
  return !fileName.getResourceLabel().equals(fileName.getLastVersionProperty().getLabel());
}

Fixed version (ground truth):
public static boolean mustChangeLabel(FileName fileName){
  return !fileName.getResourceLabel().equals(fileName.getLastVersionProperty().getLabel().replace('#','$'));
}
Program: 130056
Project: 130056
Buggy source:
public static String getExpectedFileName(String label,String version){
  StringBuffer stringBuffer=new StringBuffer();
  stringBuffer.append(label);
  stringBuffer.append(ResourceFilenameHelper.SEPARATOR);
  stringBuffer.append(version);
  return stringBuffer.toString();
}

Fixed version (ground truth):
public static String getExpectedFileName(String label,String version){
  StringBuffer stringBuffer=new StringBuffer();
  stringBuffer.append(label.replace('#','$'));
  stringBuffer.append(ResourceFilenameHelper.SEPARATOR);
  stringBuffer.append(version);
  return stringBuffer.toString();
}
Program: 130057
Project: 130057
Buggy source:
public static String format_Date_Locale(java.util.Date date,String pattern,String locale){
  if (date != null) {
    return TalendDate.formatDateLocale(pattern,date,locale);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public static String format_Date_Locale(java.util.Date date,String pattern,String locale){
  if (date != null) {
    return TalendDate.formatDateLocale(pattern == null ? Constant.dateDefaultPattern : pattern,date,locale);
  }
 else {
    return null;
  }
}
Program: 130058
Project: 130058
Buggy source:
public static String format_Date(java.util.Date date,String pattern){
  if (date != null) {
    return TalendDate.formatDate(pattern,date);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public static String format_Date(java.util.Date date,String pattern){
  if (date != null) {
    return TalendDate.formatDate(pattern == null ? Constant.dateDefaultPattern : pattern,date);
  }
 else {
    return null;
  }
}
Program: 130060
Project: 130060
Buggy source:
private void initRootCombo(){
  List<ATreeNode> rootNodes=((XmlFileWizard)getPage().getWizard()).getRootNodes();
  if (rootNodes != null) {
    rootComboViewer.setInput(rootNodes);
    XMLFileNode selectedNode=getConnection().getRoot().get(0);
    String xmlPath=selectedNode.getXMLPath();
    if (xmlPath != null && xmlPath.length() > 0) {
      xmlPath=xmlPath.substring(xmlPath.lastIndexOf("String_Node_Str") + 1);
      for (int i=0; i < rootNodes.size(); i++) {
        ATreeNode node=rootNodes.get(i);
        if (xmlPath.equals(node.getValue())) {
          rootCombo.select(i);
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
private void initRootCombo(){
  List<ATreeNode> rootNodes=((XmlFileWizard)getPage().getWizard()).getRootNodes();
  if (rootNodes != null) {
    rootComboViewer.setInput(rootNodes);
    ATreeNode rootNode=getDefaultRootNode(rootNodes);
    rootCombo.select(rootNodes.indexOf(rootNode));
  }
}
Program: 130062
Project: 130062
Buggy source:
public void lock(Item item) throws PersistenceException, LoginException {
  if (getStatus(item).isPotentiallyEditable()) {
    this.repositoryFactoryFromProvider.lock(item);
    String str[]=new String[]{item.toString(),getRepositoryContext().getUser().toString()};
    log.debug(Messages.getString("String_Node_Str",str));
  }
}

Fixed version (ground truth):
public void lock(Item item) throws PersistenceException, LoginException {
  if (getStatus(item).isPotentiallyEditable()) {
    this.repositoryFactoryFromProvider.lock(item);
    if ((item instanceof JobletProcessItem || item instanceof ProcessItem) && getStatus(item) == ERepositoryStatus.LOCK_BY_USER) {
      String docId=item.getProperty().getId() + "String_Node_Str";
      IRepositoryViewObject repositoryViewObject=this.repositoryFactoryFromProvider.getLastVersion(projectManager.getCurrentProject(),docId);
      if (repositoryViewObject != null) {
        Property property=repositoryViewObject.getProperty();
        Item documentationItem=property.getItem();
        this.repositoryFactoryFromProvider.lock(documentationItem);
      }
    }
    String str[]=new String[]{item.toString(),getRepositoryContext().getUser().toString()};
    log.debug(Messages.getString("String_Node_Str",str));
  }
}
Program: 130063
Project: 130063
Buggy source:
public void unlock(Item obj) throws PersistenceException, LoginException {
  if (getStatus(obj) == ERepositoryStatus.LOCK_BY_USER || obj instanceof JobletDocumentationItem || obj instanceof JobDocumentationItem) {
    Date commitDate=obj.getState().getCommitDate();
    Date modificationDate=obj.getProperty().getModificationDate();
    if (modificationDate == null || commitDate == null || modificationDate.before(commitDate)) {
      this.repositoryFactoryFromProvider.unlock(obj);
      String str[]=new String[]{obj.toString(),getRepositoryContext().getUser().toString()};
      log.debug(Messages.getString("String_Node_Str",str));
    }
  }
}

Fixed version (ground truth):
public void unlock(Item obj) throws PersistenceException, LoginException {
  if (getStatus(obj) == ERepositoryStatus.LOCK_BY_USER || obj instanceof JobletDocumentationItem || obj instanceof JobDocumentationItem) {
    Date commitDate=obj.getState().getCommitDate();
    Date modificationDate=obj.getProperty().getModificationDate();
    if (modificationDate == null || commitDate == null || modificationDate.before(commitDate)) {
      this.repositoryFactoryFromProvider.unlock(obj);
      if (obj instanceof JobletProcessItem || obj instanceof ProcessItem) {
        String docId=obj.getProperty().getId() + "String_Node_Str";
        IRepositoryViewObject repositoryViewObject=this.repositoryFactoryFromProvider.getLastVersion(projectManager.getCurrentProject(),docId);
        if (repositoryViewObject != null) {
          Property property=repositoryViewObject.getProperty();
          Item documentationItem=property.getItem();
          this.repositoryFactoryFromProvider.unlock(documentationItem);
        }
      }
      String str[]=new String[]{obj.toString(),getRepositoryContext().getUser().toString()};
      log.debug(Messages.getString("String_Node_Str",str));
    }
  }
}
Program: 130064
Project: 130064
Buggy source:
/** 
 * Main Fields addControls.
 */
protected void addFieldsListeners(){
  serverCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setServer(serverCombo.getText());
      checkFieldsValue();
    }
  }
);
  fileField.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFilePath(PathUtils.getPortablePath(fileField.getText()));
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
  fileFormatCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
        if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
          if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
            getConnection().setRowSeparatorValue("String_Node_Str");
          }
 else {
            getConnection().setRowSeparatorValue("String_Node_Str");
          }
        }
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Main Fields addControls.
 */
protected void addFieldsListeners(){
  serverCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setServer(serverCombo.getText());
      checkFieldsValue();
    }
  }
);
  fileField.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFilePath(PathUtils.getPortablePath(fileField.getText()));
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
  fileFormatCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
        if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
          if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
            getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
          }
 else {
            getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
          }
        }
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
}
Program: 130065
Project: 130065
Buggy source:
public void modifyText(final ModifyEvent e){
  if (!isContextMode()) {
    getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
    if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
      if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
        getConnection().setRowSeparatorValue("String_Node_Str");
      }
 else {
        getConnection().setRowSeparatorValue("String_Node_Str");
      }
    }
    fileViewerText.setText(Messages.getString("String_Node_Str"));
    checkFilePathAndManageIt();
  }
}

Fixed version (ground truth):
public void modifyText(final ModifyEvent e){
  if (!isContextMode()) {
    getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
    if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
      if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
        getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
      }
 else {
        getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
      }
    }
    fileViewerText.setText(Messages.getString("String_Node_Str"));
    checkFilePathAndManageIt();
  }
}
Program: 130067
Project: 130067
Buggy source:
/** 
 * Main Fields addControls.
 */
protected void addFieldsListeners(){
  serverCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setServer(serverCombo.getText());
      checkFieldsValue();
    }
  }
);
  fileField.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFilePath(PathUtils.getPortablePath(fileField.getText()));
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
  fileFormatCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
        if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
          if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
            getConnection().setRowSeparatorValue("String_Node_Str");
          }
 else {
            getConnection().setRowSeparatorValue("String_Node_Str");
          }
        }
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Main Fields addControls.
 */
protected void addFieldsListeners(){
  serverCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      getConnection().setServer(serverCombo.getText());
      checkFieldsValue();
    }
  }
);
  fileField.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFilePath(PathUtils.getPortablePath(fileField.getText()));
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
  fileFormatCombo.addModifyListener(new ModifyListener(){
    public void modifyText(    final ModifyEvent e){
      if (!isContextMode()) {
        getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
        if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
          if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
            getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
          }
 else {
            getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
          }
        }
        fileViewerText.setText(Messages.getString("String_Node_Str"));
        checkFilePathAndManageIt();
      }
    }
  }
);
}
Program: 130068
Project: 130068
Buggy source:
public void modifyText(final ModifyEvent e){
  if (!isContextMode()) {
    getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
    if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
      if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
        getConnection().setRowSeparatorValue("String_Node_Str");
      }
 else {
        getConnection().setRowSeparatorValue("String_Node_Str");
      }
    }
    fileViewerText.setText(Messages.getString("String_Node_Str"));
    checkFilePathAndManageIt();
  }
}

Fixed version (ground truth):
public void modifyText(final ModifyEvent e){
  if (!isContextMode()) {
    getConnection().setFormat(FileFormat.getByName(fileFormatCombo.getText()));
    if (getConnection().getRowSeparatorType() == RowSeparator.STANDART_EOL_LITERAL) {
      if (getConnection().getFormat().toString().equals(FileFormat.MAC_LITERAL.getName())) {
        getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
      }
 else {
        getConnection().setRowSeparatorValue(TalendQuoteUtils.addQuotes("String_Node_Str"));
      }
    }
    fileViewerText.setText(Messages.getString("String_Node_Str"));
    checkFilePathAndManageIt();
  }
}
Program: 130069
Project: 130069
Buggy source:
public void updateConnection(){
  ConnectionHelper.getTables(getConnection());
  EList root=getConnection().getRoot();
  EList loop=getConnection().getLoop();
  EList group=getConnection().getGroup();
  root.clear();
  loop.clear();
  group.clear();
  List<FOXTreeNode> node=(List<FOXTreeNode>)xmlViewer.getInput();
  FOXTreeNode foxTreeNode=node.get(0);
  if (foxTreeNode != null) {
    initNodeOrder(foxTreeNode);
    tableLoader((Element)foxTreeNode,"String_Node_Str",root,foxTreeNode.getDefaultValue());
    Element loopNode=(Element)TreeUtil.getLoopNode(foxTreeNode);
    if (loopNode != null) {
      String path=TreeUtil.getPath(loopNode);
      tableLoader(loopNode,path.substring(0,path.lastIndexOf("String_Node_Str")),loop,loopNode.getDefaultValue());
    }
    Element groupNode=(Element)TreeUtil.getGroupNode(foxTreeNode);
    if (groupNode != null) {
      String path=TreeUtil.getPath(groupNode);
      tableLoader(groupNode,path.substring(0,path.lastIndexOf("String_Node_Str")),group,groupNode.getDefaultValue());
    }
  }
}

Fixed version (ground truth):
public void updateConnection(){
  ConnectionHelper.getTables(getConnection());
  EList root=getConnection().getRoot();
  EList loop=getConnection().getLoop();
  EList group=getConnection().getGroup();
  root.clear();
  loop.clear();
  group.clear();
  List<FOXTreeNode> node=(List<FOXTreeNode>)xmlViewer.getInput();
  FOXTreeNode foxTreeNode=node.get(0);
  if (foxTreeNode != null) {
    initNodeOrder(foxTreeNode);
    if (!foxTreeNode.isLoop()) {
      tableLoader((Element)foxTreeNode,"String_Node_Str",root,foxTreeNode.getDefaultValue());
    }
    Element loopNode=(Element)TreeUtil.getLoopNode(foxTreeNode);
    if (loopNode != null) {
      String path=TreeUtil.getPath(loopNode);
      tableLoader(loopNode,path.substring(0,path.lastIndexOf("String_Node_Str")),loop,loopNode.getDefaultValue());
    }
    Element groupNode=(Element)TreeUtil.getGroupNode(foxTreeNode);
    if (groupNode != null) {
      String path=TreeUtil.getPath(groupNode);
      tableLoader(groupNode,path.substring(0,path.lastIndexOf("String_Node_Str")),group,groupNode.getDefaultValue());
    }
  }
}