nus-yam/ex-repair huggingface dataset:
Program: 120999
Project: 120999
Buggy source:
/** 
 * yzhang Comment method "closeRowGenerator".
 * @param response
 */
public void closeRowGenerator(int response,boolean fromDialog){
  setRowGenResponse(response);
  Composite parent=generatorUI.getRowGenUIParent();
  saveCurrentUIProperties();
  MetadataTable table=(MetadataTable)rgManager.getRowGeneratorComponent().getMetadataList().get(0);
  boolean hasColumns=(table != null) && (table.getListColumns() != null && (table.getListColumns().size() != 0));
  List<Map<String,Object>> originalColumnDataList=this.getRowGenManager().getRowGeneratorComponent().getMapList();
  List<Map<String,Object>> currentColumnDataList=getCurrentColumnData();
  boolean containsAll1=originalColumnDataList.containsAll(currentColumnDataList);
  boolean containsAll2=currentColumnDataList.containsAll(originalColumnDataList);
  boolean containsAll=containsAll1 && containsAll2;
  if (hasColumns && !containsAll && response == SWT.CANCEL) {
    boolean isNotSaveSetting=MessageDialog.openQuestion(parent.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (isNotSaveSetting) {
      reductAllData();
    }
 else {
      response=SWT.OK;
      setRowGenResponse(response);
    }
  }
  if (response == SWT.OK) {
    saveAllData(currentColumnDataList);
  }
  if (parent instanceof Shell && !fromDialog) {
    ((Shell)parent).close();
  }
}

Fixed version (ground truth):
/** 
 * yzhang Comment method "closeRowGenerator".
 * @param response
 */
public void closeRowGenerator(int response,boolean fromDialog){
  setRowGenResponse(response);
  Composite parent=generatorUI.getRowGenUIParent();
  saveCurrentUIProperties();
  MetadataTable table=(MetadataTable)rgManager.getRowGeneratorComponent().getMetadataList().get(0);
  boolean hasColumns=(table != null) && (table.getListColumns() != null && (table.getListColumns().size() != 0));
  List<Map<String,Object>> originalColumnDataList=this.getRowGenManager().getRowGeneratorComponent().getMapList();
  List<Map<String,Object>> currentColumnDataList=getCurrentColumnData();
  boolean containsAll1=originalColumnDataList.containsAll(currentColumnDataList);
  boolean containsAll2=currentColumnDataList.containsAll(originalColumnDataList);
  boolean containsAll=containsAll1 && containsAll2;
  if (hasColumns && !containsAll && response == SWT.CANCEL) {
    boolean isNotSaveSetting=MessageDialog.openQuestion(parent.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!isNotSaveSetting) {
      response=SWT.NONE;
      setRowGenResponse(response);
    }
    return;
  }
  if (response == SWT.OK) {
    saveAllData(currentColumnDataList);
  }
  if (parent instanceof Shell && !fromDialog) {
    ((Shell)parent).close();
  }
}
Program: 121000
Project: 121000
Buggy source:
public void handleEvent(Event event){
  rowGenMain.updateTableTitleColumn();
}

Fixed version (ground truth):
@Override public void handleEvent(Event event){
  rowGenMain.updateTableTitleColumn();
}
Program: 121001
Project: 121001
Buggy source:
@Override protected void configureShell(Shell newShell){
  super.configureShell(newShell);
  newShell.setText(title);
  newShell.setImage(icon);
  newShell.addListener(SWT.Resize,new Listener(){
    public void handleEvent(    Event event){
      rowGenMain.updateTableTitleColumn();
    }
  }
);
  if (maximized) {
    newShell.setMaximized(true);
  }
 else {
    newShell.setBounds(size);
  }
}

Fixed version (ground truth):
@Override protected void configureShell(Shell newShell){
  super.configureShell(newShell);
  newShell.setText(title);
  newShell.setImage(icon);
  newShell.addListener(SWT.Resize,new Listener(){
    @Override public void handleEvent(    Event event){
      rowGenMain.updateTableTitleColumn();
    }
  }
);
  if (maximized) {
    newShell.setMaximized(true);
  }
 else {
    newShell.setBounds(size);
  }
}
Program: 121002
Project: 121002
Buggy source:
@Override protected void cancelPressed(){
  UIManager uiManager=rowGenMain.getRowGenManager().getUiManager();
  uiManager.closeRowGenerator(SWT.CANCEL,true);
  rowGenMain.buildExternalData();
  super.cancelPressed();
}

Fixed version (ground truth):
@Override protected void cancelPressed(){
  UIManager uiManager=rowGenMain.getRowGenManager().getUiManager();
  uiManager.closeRowGenerator(SWT.CANCEL,true);
  if (uiManager.getRowGenResponse() == SWT.CANCEL) {
    rowGenMain.buildExternalData();
    super.cancelPressed();
  }
}
Program: 121004
Project: 121004
Buggy source:
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=33525760;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=33525760;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        clean(buf);
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        clean(buf);
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}
Program: 121006
Project: 121006
Buggy source:
private void setDeparallelization(INode node){
  if (node.isActivate()) {
    for (    IConnection con : node.getIncomingConnections()) {
      if (con.isActivate()) {
        EConnectionType lineStyle=con.getLineStyle();
        if (lineStyle.hasConnectionCategory(IConnectionCategory.DATA)) {
          IElementParameter parElem=con.getElementParameter(EParameterName.PARTITIONER.getName());
          parElem.setValue(Boolean.FALSE);
          con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
          con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
          con.setPropertyValue(EParameterName.DEPARTITIONER.getName(),Boolean.TRUE);
        }
      }
    }
    if (node.getOutgoingConnections().size() > 0) {
      setParallelization(node);
    }
  }
}

Fixed version (ground truth):
private void setDeparallelization(INode node){
  if (node.isActivate()) {
    for (    IConnection con : node.getIncomingConnections()) {
      EConnectionType lineStyle=con.getLineStyle();
      if (lineStyle.hasConnectionCategory(IConnectionCategory.DATA)) {
        IElementParameter parElem=con.getElementParameter(EParameterName.PARTITIONER.getName());
        parElem.setValue(Boolean.FALSE);
        con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
        con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
        con.setPropertyValue(EParameterName.DEPARTITIONER.getName(),Boolean.TRUE);
      }
    }
    if (node.getOutgoingConnections().size() > 0) {
      setParallelization(node);
    }
  }
}
Program: 121007
Project: 121007
Buggy source:
public void updateStatus(){
  if (connection.isActivate()) {
    for (    IElementParameter enableParallel : figureMap.keySet()) {
      if (enableParallel != null) {
        if (enableParallel.getValue().equals(true)) {
          if (enableParallel.getName().equals(EParameterName.NONE.getName())) {
            boolean isDisplayKeepPartion=false;
            isDisplayKeepPartion=ParallelExecutionUtils.isExistPreviousParCon((Node)connection.getSource());
            if (isDisplayKeepPartion) {
              for (              ParallelFigure pf : figureMap.get(enableParallel)) {
                pf.setVisible(true);
              }
            }
 else {
              for (              ParallelFigure pf : figureMap.get(enableParallel)) {
                pf.setVisible(false);
              }
            }
          }
 else {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(true);
            }
          }
        }
 else {
          for (          ParallelFigure pf : figureMap.get(enableParallel)) {
            pf.setVisible(false);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void updateStatus(){
  for (  IElementParameter enableParallel : figureMap.keySet()) {
    if (enableParallel != null) {
      if (enableParallel.getValue().equals(true)) {
        if (enableParallel.getName().equals(EParameterName.NONE.getName())) {
          boolean isDisplayKeepPartion=false;
          isDisplayKeepPartion=ParallelExecutionUtils.isExistPreviousParCon((Node)connection.getSource());
          if (isDisplayKeepPartion) {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(true);
            }
          }
 else {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(false);
            }
          }
        }
 else {
          for (          ParallelFigure pf : figureMap.get(enableParallel)) {
            pf.setVisible(true);
          }
        }
      }
 else {
        for (        ParallelFigure pf : figureMap.get(enableParallel)) {
          pf.setVisible(false);
        }
      }
    }
  }
}
Program: 121008
Project: 121008
Buggy source:
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;
  }
}

Fixed version (ground truth):
private CellStyle getPreCellStyle(){
  if (preSheet != null && 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;
  }
}
Program: 121009
Project: 121009
Buggy source:
@Override public void setMetadataList(List<IMetadataTable> metadataTablesOut){
  boolean needUpdateMetadata=false;
  if (this.metadataListOut == null) {
    needUpdateMetadata=true;
  }
 else   if (this.metadataListOut.size() != metadataTablesOut.size()) {
    needUpdateMetadata=true;
  }
 else {
    for (    IMetadataTable metaTable : this.metadataListOut) {
      for (      IMetadataTable externalMetaTable : metadataTablesOut) {
        if (!metaTable.sameMetadataAs(externalMetaTable,IMetadataColumn.OPTIONS_NONE)) {
          needUpdateMetadata=true;
          break;
        }
      }
      if (needUpdateMetadata) {
        break;
      }
    }
  }
  if (needUpdateMetadata) {
    this.metadataListOut=metadataTablesOut;
  }
}

Fixed version (ground truth):
@Override public void setMetadataList(List<IMetadataTable> metadataTablesOut){
  boolean needUpdateMetadata=false;
  if (this.metadataListOut == null) {
    needUpdateMetadata=true;
  }
 else   if (this.metadataListOut.size() != metadataTablesOut.size()) {
    needUpdateMetadata=true;
  }
 else {
    for (    IMetadataTable metaTable : this.metadataListOut) {
      for (      IMetadataTable externalMetaTable : metadataTablesOut) {
        if (!metaTable.sameMetadataAs(externalMetaTable,IMetadataColumn.OPTIONS_NONE) || !this.sameMetadataFunctionsAs(metaTable)) {
          needUpdateMetadata=true;
          break;
        }
      }
      if (needUpdateMetadata) {
        break;
      }
    }
  }
  if (needUpdateMetadata) {
    this.metadataListOut=metadataTablesOut;
  }
}
Program: 121010
Project: 121010
Buggy source:
/** 
 * yzhang Comment method "closeRowGenerator".
 * @param response
 */
public void closeRowGenerator(int response,boolean fromDialog){
  setRowGenResponse(response);
  Composite parent=generatorUI.getRowGenUIParent();
  saveCurrentUIProperties();
  MetadataTable table=(MetadataTable)rgManager.getRowGeneratorComponent().getMetadataList().get(0);
  boolean hasColumns=(table != null) && (table.getListColumns() != null && (table.getListColumns().size() != 0));
  List<Map<String,Object>> originalColumnDataList=this.getRowGenManager().getRowGeneratorComponent().getMapList();
  List<Map<String,Object>> currentColumnDataList=getCurrentColumnData();
  boolean containsAll1=originalColumnDataList.containsAll(currentColumnDataList);
  boolean containsAll2=currentColumnDataList.containsAll(originalColumnDataList);
  boolean containsAll=containsAll1 && containsAll2;
  if (hasColumns && !containsAll && response == SWT.CANCEL) {
    boolean isNotSaveSetting=MessageDialog.openQuestion(parent.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (isNotSaveSetting) {
      reductAllData();
    }
 else {
      response=SWT.OK;
      setRowGenResponse(response);
    }
  }
  if (response == SWT.OK) {
    saveAllData(currentColumnDataList);
  }
  if (parent instanceof Shell && !fromDialog) {
    ((Shell)parent).close();
  }
}

Fixed version (ground truth):
/** 
 * yzhang Comment method "closeRowGenerator".
 * @param response
 */
public void closeRowGenerator(int response,boolean fromDialog){
  setRowGenResponse(response);
  Composite parent=generatorUI.getRowGenUIParent();
  saveCurrentUIProperties();
  MetadataTable table=(MetadataTable)rgManager.getRowGeneratorComponent().getMetadataList().get(0);
  boolean hasColumns=(table != null) && (table.getListColumns() != null && (table.getListColumns().size() != 0));
  List<Map<String,Object>> originalColumnDataList=this.getRowGenManager().getRowGeneratorComponent().getMapList();
  List<Map<String,Object>> currentColumnDataList=getCurrentColumnData();
  boolean containsAll1=originalColumnDataList.containsAll(currentColumnDataList);
  boolean containsAll2=currentColumnDataList.containsAll(originalColumnDataList);
  boolean containsAll=containsAll1 && containsAll2;
  if (hasColumns && !containsAll && response == SWT.CANCEL) {
    boolean isNotSaveSetting=MessageDialog.openQuestion(parent.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!isNotSaveSetting) {
      response=SWT.NONE;
      setRowGenResponse(response);
    }
    return;
  }
  if (response == SWT.OK) {
    saveAllData(currentColumnDataList);
  }
  if (parent instanceof Shell && !fromDialog) {
    ((Shell)parent).close();
  }
}
Program: 121011
Project: 121011
Buggy source:
@Override protected void cancelPressed(){
  UIManager uiManager=rowGenMain.getRowGenManager().getUiManager();
  uiManager.closeRowGenerator(SWT.CANCEL,true);
  rowGenMain.buildExternalData();
  super.cancelPressed();
}

Fixed version (ground truth):
@Override protected void cancelPressed(){
  UIManager uiManager=rowGenMain.getRowGenManager().getUiManager();
  uiManager.closeRowGenerator(SWT.CANCEL,true);
  if (uiManager.getRowGenResponse() == SWT.CANCEL) {
    rowGenMain.buildExternalData();
    super.cancelPressed();
  }
}
Program: 121012
Project: 121012
Buggy source:
@Override public void setMetadataList(List<IMetadataTable> metadataTablesOut){
  boolean needUpdateMetadata=false;
  if (this.metadataListOut == null) {
    needUpdateMetadata=true;
  }
 else   if (this.metadataListOut.size() != metadataTablesOut.size()) {
    needUpdateMetadata=true;
  }
 else {
    for (    IMetadataTable metaTable : this.metadataListOut) {
      for (      IMetadataTable externalMetaTable : metadataTablesOut) {
        if (!metaTable.sameMetadataAs(externalMetaTable,IMetadataColumn.OPTIONS_NONE)) {
          needUpdateMetadata=true;
          break;
        }
      }
      if (needUpdateMetadata) {
        break;
      }
    }
  }
  if (needUpdateMetadata) {
    this.metadataListOut=metadataTablesOut;
  }
}

Fixed version (ground truth):
@Override public void setMetadataList(List<IMetadataTable> metadataTablesOut){
  boolean needUpdateMetadata=false;
  if (this.metadataListOut == null) {
    needUpdateMetadata=true;
  }
 else   if (this.metadataListOut.size() != metadataTablesOut.size()) {
    needUpdateMetadata=true;
  }
 else {
    for (    IMetadataTable metaTable : this.metadataListOut) {
      for (      IMetadataTable externalMetaTable : metadataTablesOut) {
        if (!metaTable.sameMetadataAs(externalMetaTable,IMetadataColumn.OPTIONS_NONE) || !this.sameMetadataFunctionsAs(metaTable)) {
          needUpdateMetadata=true;
          break;
        }
      }
      if (needUpdateMetadata) {
        break;
      }
    }
  }
  if (needUpdateMetadata) {
    this.metadataListOut=metadataTablesOut;
  }
}
Program: 121013
Project: 121013
Buggy source:
/** 
 * yzhang Comment method "closeRowGenerator".
 * @param response
 */
public void closeRowGenerator(int response,boolean fromDialog){
  setRowGenResponse(response);
  Composite parent=generatorUI.getRowGenUIParent();
  saveCurrentUIProperties();
  MetadataTable table=(MetadataTable)rgManager.getRowGeneratorComponent().getMetadataList().get(0);
  boolean hasColumns=(table != null) && (table.getListColumns() != null && (table.getListColumns().size() != 0));
  List<Map<String,Object>> originalColumnDataList=this.getRowGenManager().getRowGeneratorComponent().getMapList();
  List<Map<String,Object>> currentColumnDataList=getCurrentColumnData();
  boolean containsAll1=originalColumnDataList.containsAll(currentColumnDataList);
  boolean containsAll2=currentColumnDataList.containsAll(originalColumnDataList);
  boolean containsAll=containsAll1 && containsAll2;
  if (hasColumns && !containsAll && response == SWT.CANCEL) {
    boolean isNotSaveSetting=MessageDialog.openQuestion(parent.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (isNotSaveSetting) {
      reductAllData();
    }
 else {
      response=SWT.OK;
      setRowGenResponse(response);
    }
  }
  if (response == SWT.OK) {
    saveAllData(currentColumnDataList);
  }
  if (parent instanceof Shell && !fromDialog) {
    ((Shell)parent).close();
  }
}

Fixed version (ground truth):
/** 
 * yzhang Comment method "closeRowGenerator".
 * @param response
 */
public void closeRowGenerator(int response,boolean fromDialog){
  setRowGenResponse(response);
  Composite parent=generatorUI.getRowGenUIParent();
  saveCurrentUIProperties();
  MetadataTable table=(MetadataTable)rgManager.getRowGeneratorComponent().getMetadataList().get(0);
  boolean hasColumns=(table != null) && (table.getListColumns() != null && (table.getListColumns().size() != 0));
  List<Map<String,Object>> originalColumnDataList=this.getRowGenManager().getRowGeneratorComponent().getMapList();
  List<Map<String,Object>> currentColumnDataList=getCurrentColumnData();
  boolean containsAll1=originalColumnDataList.containsAll(currentColumnDataList);
  boolean containsAll2=currentColumnDataList.containsAll(originalColumnDataList);
  boolean containsAll=containsAll1 && containsAll2;
  if (hasColumns && !containsAll && response == SWT.CANCEL) {
    boolean isNotSaveSetting=MessageDialog.openQuestion(parent.getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    if (!isNotSaveSetting) {
      response=SWT.NONE;
      setRowGenResponse(response);
    }
    return;
  }
  if (response == SWT.OK) {
    saveAllData(currentColumnDataList);
  }
  if (parent instanceof Shell && !fromDialog) {
    ((Shell)parent).close();
  }
}
Program: 121014
Project: 121014
Buggy source:
@Override protected void cancelPressed(){
  UIManager uiManager=rowGenMain.getRowGenManager().getUiManager();
  uiManager.closeRowGenerator(SWT.CANCEL,true);
  rowGenMain.buildExternalData();
  super.cancelPressed();
}

Fixed version (ground truth):
@Override protected void cancelPressed(){
  UIManager uiManager=rowGenMain.getRowGenManager().getUiManager();
  uiManager.closeRowGenerator(SWT.CANCEL,true);
  if (uiManager.getRowGenResponse() == SWT.CANCEL) {
    rowGenMain.buildExternalData();
    super.cancelPressed();
  }
}
Program: 121015
Project: 121015
Buggy source:
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=33525760;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        if (delSrc) {
          clean(buf);
        }
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}

Fixed version (ground truth):
private static void copyFileL(String srcFileName,FileInputStream srcInputStream,String desFileName,boolean delSrc) throws Exception {
  File source=new File(srcFileName);
  File dest=new File(desFileName);
  FileChannel in=null, out=null;
  try {
    in=srcInputStream.getChannel();
    out=new FileOutputStream(dest).getChannel();
    long size=in.size();
    long position=0;
    final long MAP_SIZE=33525760;
    MappedByteBuffer buf=null;
    while (true) {
      if (position + MAP_SIZE >= size) {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,size - position);
        out.write(buf);
        clean(buf);
        break;
      }
 else {
        buf=in.map(FileChannel.MapMode.READ_ONLY,position,MAP_SIZE);
        out.write(buf);
        clean(buf);
        position+=MAP_SIZE;
      }
    }
    in.close();
    out.close();
    if (delSrc) {
      source.delete();
    }
  }
  finally {
    if (in != null) {
      in.close();
    }
    if (out != null) {
      out.close();
    }
  }
}
Program: 121016
Project: 121016
Buggy source:
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;
  }
}

Fixed version (ground truth):
private CellStyle getPreCellStyle(){
  if (preSheet != null && 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;
  }
}
Program: 121017
Project: 121017
Buggy source:
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;
  }
}

Fixed version (ground truth):
private CellStyle getPreCellStyle(){
  if (preSheet != null && 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;
  }
}
Program: 121022
Project: 121022
Buggy source:
private void setDeparallelization(INode node){
  if (node.isActivate()) {
    for (    IConnection con : node.getIncomingConnections()) {
      if (con.isActivate()) {
        EConnectionType lineStyle=con.getLineStyle();
        if (lineStyle.hasConnectionCategory(IConnectionCategory.DATA)) {
          IElementParameter parElem=con.getElementParameter(EParameterName.PARTITIONER.getName());
          parElem.setValue(Boolean.FALSE);
          con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
          con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
          con.setPropertyValue(EParameterName.DEPARTITIONER.getName(),Boolean.TRUE);
        }
      }
    }
    if (node.getOutgoingConnections().size() > 0) {
      setParallelization(node);
    }
  }
}

Fixed version (ground truth):
private void setDeparallelization(INode node){
  if (node.isActivate()) {
    for (    IConnection con : node.getIncomingConnections()) {
      EConnectionType lineStyle=con.getLineStyle();
      if (lineStyle.hasConnectionCategory(IConnectionCategory.DATA)) {
        IElementParameter parElem=con.getElementParameter(EParameterName.PARTITIONER.getName());
        parElem.setValue(Boolean.FALSE);
        con.getElementParameter(EParameterName.REPARTITIONER.getName()).setValue(Boolean.FALSE);
        con.getElementParameter(EParameterName.NONE.getName()).setValue(Boolean.FALSE);
        con.setPropertyValue(EParameterName.DEPARTITIONER.getName(),Boolean.TRUE);
      }
    }
    if (node.getOutgoingConnections().size() > 0) {
      setParallelization(node);
    }
  }
}
Program: 121023
Project: 121023
Buggy source:
public void updateStatus(){
  if (connection.isActivate()) {
    for (    IElementParameter enableParallel : figureMap.keySet()) {
      if (enableParallel != null) {
        if (enableParallel.getValue().equals(true)) {
          if (enableParallel.getName().equals(EParameterName.NONE.getName())) {
            boolean isDisplayKeepPartion=false;
            isDisplayKeepPartion=ParallelExecutionUtils.isExistPreviousParCon((Node)connection.getSource());
            if (isDisplayKeepPartion) {
              for (              ParallelFigure pf : figureMap.get(enableParallel)) {
                pf.setVisible(true);
              }
            }
 else {
              for (              ParallelFigure pf : figureMap.get(enableParallel)) {
                pf.setVisible(false);
              }
            }
          }
 else {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(true);
            }
          }
        }
 else {
          for (          ParallelFigure pf : figureMap.get(enableParallel)) {
            pf.setVisible(false);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void updateStatus(){
  for (  IElementParameter enableParallel : figureMap.keySet()) {
    if (enableParallel != null) {
      if (enableParallel.getValue().equals(true)) {
        if (enableParallel.getName().equals(EParameterName.NONE.getName())) {
          boolean isDisplayKeepPartion=false;
          isDisplayKeepPartion=ParallelExecutionUtils.isExistPreviousParCon((Node)connection.getSource());
          if (isDisplayKeepPartion) {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(true);
            }
          }
 else {
            for (            ParallelFigure pf : figureMap.get(enableParallel)) {
              pf.setVisible(false);
            }
          }
        }
 else {
          for (          ParallelFigure pf : figureMap.get(enableParallel)) {
            pf.setVisible(true);
          }
        }
      }
 else {
        for (        ParallelFigure pf : figureMap.get(enableParallel)) {
          pf.setVisible(false);
        }
      }
    }
  }
}
Program: 121024
Project: 121024
Buggy source:
private Resource createResource(ItemRecord itemRecord,IPath path,boolean byteArrayResource) throws FileNotFoundException {
  Resource resource;
  ResourceSet resourceSet=itemRecord.getResourceSet();
  if (byteArrayResource) {
    resource=new ByteArrayResource(getURI(path));
    resourceSet.getResources().add(resource);
  }
 else {
    if (FileConstants.ITEM_EXTENSION.equals(path.getFileExtension())) {
      String projectName="String_Node_Str";
      if (itemRecord.getItemProject() != null) {
        projectName=itemRecord.getItemProject().getTechnicalLabel();
      }
      String business=projectName + "String_Node_Str";
      String context=projectName + "String_Node_Str";
      String process=projectName + "String_Node_Str";
      String joblet=projectName + "String_Node_Str";
      String pathString=path.toPortableString();
      if (pathString.contains(process) || pathString.contains(context) || pathString.contains(business)|| pathString.contains(joblet)) {
        resource=new TalendXMIResource(getURI(path));
      }
 else {
        resource=new CwmResource(getURI(path));
      }
      resourceSet.getResources().add(resource);
    }
 else {
      resource=resourceSet.createResource(getURI(path));
    }
  }
  return resource;
}

Fixed version (ground truth):
private Resource createResource(ItemRecord itemRecord,IPath path,boolean byteArrayResource) throws FileNotFoundException {
  Resource resource;
  ResourceSet resourceSet=itemRecord.getResourceSet();
  if (byteArrayResource) {
    resource=new ByteArrayResource(getURI(path));
    resourceSet.getResources().add(resource);
  }
 else {
    if (FileConstants.ITEM_EXTENSION.equals(path.getFileExtension())) {
      String projectName="String_Node_Str";
      if (itemRecord.getItemProject() != null) {
        projectName=itemRecord.getItemProject().getTechnicalLabel();
        projectName=projectName.toLowerCase();
      }
      String business=projectName + "String_Node_Str";
      String context=projectName + "String_Node_Str";
      String process=projectName + "String_Node_Str";
      String joblet=projectName + "String_Node_Str";
      String pathString=path.toPortableString();
      pathString=pathString.toLowerCase();
      if (pathString.contains(process) || pathString.contains(context) || pathString.contains(business)|| pathString.contains(joblet)) {
        resource=new TalendXMIResource(getURI(path));
      }
 else {
        resource=new CwmResource(getURI(path));
      }
      resourceSet.getResources().add(resource);
    }
 else {
      resource=resourceSet.createResource(getURI(path));
    }
  }
  return resource;
}
Program: 121026
Project: 121026
Buggy source:
private void checkDeletedFolders(){
  List<FolderItem> foldersList=ProjectManager.getInstance().getFolders(ProjectManager.getInstance().getCurrentProject().getEmfProject());
  for (  FolderItem folderItem : foldersList) {
    setPathToDeleteIfNeed(folderItem);
  }
}

Fixed version (ground truth):
private void checkDeletedFolders(){
  ProxyRepositoryFactory repFactory=ProxyRepositoryFactory.getInstance();
  if (!foldersCreated.isEmpty()) {
    for (    ERepositoryObjectType itemType : foldersCreated.keySet()) {
      for (      String folder : foldersCreated.get(itemType)) {
        FolderItem folderItem=repFactory.getFolderItem(ProjectManager.getInstance().getCurrentProject(),itemType,new Path(folder));
        if (folderItem != null) {
          folderItem.getState().setDeleted(true);
        }
      }
    }
    foldersCreated.clear();
  }
}
Program: 121027
Project: 121027
Buggy source:
public void clearAllData(){
  deletedItems.clear();
  if ((!CommonsPlugin.isSameProjectLogonCommline() && CommonsPlugin.isHeadless()) || !CommonsPlugin.isHeadless() || !ProjectManager.getInstance().getCurrentProject().isLocal()) {
    cache.clear();
  }
  treeBuilder.clear();
  xmiResourceManager.unloadResources();
  xmiResourceManager.resetResourceSet();
  projects.clear();
}

Fixed version (ground truth):
public void clearAllData(){
  deletedItems.clear();
  if ((!CommonsPlugin.isSameProjectLogonCommline() && CommonsPlugin.isHeadless()) || !CommonsPlugin.isHeadless() || !ProjectManager.getInstance().getCurrentProject().isLocal()) {
    cache.clear();
  }
  treeBuilder.clear();
  xmiResourceManager.unloadResources();
  xmiResourceManager.resetResourceSet();
  projects.clear();
  foldersCreated.clear();
}
Program: 121029
Project: 121029
Buggy source:
private Resource createResource(ItemRecord itemRecord,IPath path,boolean byteArrayResource) throws FileNotFoundException {
  Resource resource;
  ResourceSet resourceSet=itemRecord.getResourceSet();
  if (byteArrayResource) {
    resource=new ByteArrayResource(getURI(path));
    resourceSet.getResources().add(resource);
  }
 else {
    if (FileConstants.ITEM_EXTENSION.equals(path.getFileExtension())) {
      String projectName="String_Node_Str";
      if (itemRecord.getItemProject() != null) {
        projectName=itemRecord.getItemProject().getTechnicalLabel();
      }
      String business=projectName + "String_Node_Str";
      String context=projectName + "String_Node_Str";
      String process=projectName + "String_Node_Str";
      String joblet=projectName + "String_Node_Str";
      String pathString=path.toPortableString();
      if (pathString.contains(process) || pathString.contains(context) || pathString.contains(business)|| pathString.contains(joblet)) {
        resource=new TalendXMIResource(getURI(path));
      }
 else {
        resource=new CwmResource(getURI(path));
      }
      resourceSet.getResources().add(resource);
    }
 else {
      resource=resourceSet.createResource(getURI(path));
    }
  }
  return resource;
}

Fixed version (ground truth):
private Resource createResource(ItemRecord itemRecord,IPath path,boolean byteArrayResource) throws FileNotFoundException {
  Resource resource;
  ResourceSet resourceSet=itemRecord.getResourceSet();
  if (byteArrayResource) {
    resource=new ByteArrayResource(getURI(path));
    resourceSet.getResources().add(resource);
  }
 else {
    if (FileConstants.ITEM_EXTENSION.equals(path.getFileExtension())) {
      String projectName="String_Node_Str";
      if (itemRecord.getItemProject() != null) {
        projectName=itemRecord.getItemProject().getTechnicalLabel();
        projectName=projectName.toLowerCase();
      }
      String business=projectName + "String_Node_Str";
      String context=projectName + "String_Node_Str";
      String process=projectName + "String_Node_Str";
      String joblet=projectName + "String_Node_Str";
      String pathString=path.toPortableString();
      pathString=pathString.toLowerCase();
      if (pathString.contains(process) || pathString.contains(context) || pathString.contains(business)|| pathString.contains(joblet)) {
        resource=new TalendXMIResource(getURI(path));
      }
 else {
        resource=new CwmResource(getURI(path));
      }
      resourceSet.getResources().add(resource);
    }
 else {
      resource=resourceSet.createResource(getURI(path));
    }
  }
  return resource;
}
Program: 121031
Project: 121031
Buggy source:
private Resource createResource(ItemRecord itemRecord,IPath path,boolean byteArrayResource) throws FileNotFoundException {
  Resource resource;
  ResourceSet resourceSet=itemRecord.getResourceSet();
  if (byteArrayResource) {
    resource=new ByteArrayResource(getURI(path));
    resourceSet.getResources().add(resource);
  }
 else {
    if (FileConstants.ITEM_EXTENSION.equals(path.getFileExtension())) {
      String projectName="String_Node_Str";
      if (itemRecord.getItemProject() != null) {
        projectName=itemRecord.getItemProject().getTechnicalLabel();
      }
      String business=projectName + "String_Node_Str";
      String context=projectName + "String_Node_Str";
      String process=projectName + "String_Node_Str";
      String joblet=projectName + "String_Node_Str";
      String pathString=path.toPortableString();
      if (pathString.contains(process) || pathString.contains(context) || pathString.contains(business)|| pathString.contains(joblet)) {
        resource=new TalendXMIResource(getURI(path));
      }
 else {
        resource=new CwmResource(getURI(path));
      }
      resourceSet.getResources().add(resource);
    }
 else {
      resource=resourceSet.createResource(getURI(path));
    }
  }
  return resource;
}

Fixed version (ground truth):
private Resource createResource(ItemRecord itemRecord,IPath path,boolean byteArrayResource) throws FileNotFoundException {
  Resource resource;
  ResourceSet resourceSet=itemRecord.getResourceSet();
  if (byteArrayResource) {
    resource=new ByteArrayResource(getURI(path));
    resourceSet.getResources().add(resource);
  }
 else {
    if (FileConstants.ITEM_EXTENSION.equals(path.getFileExtension())) {
      String projectName="String_Node_Str";
      if (itemRecord.getItemProject() != null) {
        projectName=itemRecord.getItemProject().getTechnicalLabel();
        projectName=projectName.toLowerCase();
      }
      String business=projectName + "String_Node_Str";
      String context=projectName + "String_Node_Str";
      String process=projectName + "String_Node_Str";
      String joblet=projectName + "String_Node_Str";
      String pathString=path.toPortableString();
      pathString=pathString.toLowerCase();
      if (pathString.contains(process) || pathString.contains(context) || pathString.contains(business)|| pathString.contains(joblet)) {
        resource=new TalendXMIResource(getURI(path));
      }
 else {
        resource=new CwmResource(getURI(path));
      }
      resourceSet.getResources().add(resource);
    }
 else {
      resource=resourceSet.createResource(getURI(path));
    }
  }
  return resource;
}
Program: 121033
Project: 121033
Buggy source:
@Override public void run(){
  FOXTreeNode node=(FOXTreeNode)this.getStructuredSelection().getFirstElement();
  if (createChildNode(node)) {
    foxui.redrawLinkers();
  }
}

Fixed version (ground truth):
@Override public void run(){
  FOXTreeNode node=(FOXTreeNode)this.getStructuredSelection().getFirstElement();
  if (node != null && createChildNode(node)) {
    foxui.redrawLinkers();
  }
}
Program: 121035
Project: 121035
Buggy source:
protected IStructuredContentProvider createContentProvider(){
  return new IStructuredContentProvider(){
    public Object[] getElements(    Object inputElement){
      return ((List)inputElement).toArray();
    }
    public void dispose(){
    }
    public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
  }
;
}

Fixed version (ground truth):
protected IStructuredContentProvider createContentProvider(){
  return new IStructuredContentProvider(){
    @Override public Object[] getElements(    Object inputElement){
      return ((List)inputElement).toArray();
    }
    @Override public void dispose(){
    }
    @Override public void inputChanged(    Viewer viewer,    Object oldInput,    Object newInput){
    }
  }
;
}
Program: 121036
Project: 121036
Buggy source:
public void widgetDisposed(DisposeEvent event){
  addButton=null;
  removeButton=null;
  upButton=null;
  downButton=null;
  buttonBox=null;
}

Fixed version (ground truth):
@Override public void widgetDisposed(DisposeEvent event){
  addButton=null;
  removeButton=null;
  upButton=null;
  downButton=null;
  buttonBox=null;
}
Program: 121037
Project: 121037
Buggy source:
private void executeCommand(Command cmd){
  if (cmd != null) {
    boolean exec=false;
    if (processContext != null && processContext.getProcess() instanceof IProcess2) {
      IProcess2 process=(IProcess2)processContext.getProcess();
      if (process != null) {
        CommandStack commandStack=process.getCommandStack();
        if (commandStack != null) {
          exec=true;
          commandStack.execute(cmd);
        }
      }
    }
    if (!exec) {
      cmd.execute();
    }
  }
}

Fixed version (ground truth):
private void executeCommand(Command cmd){
  if (cmd != null) {
    boolean exec=false;
    if (processContext != null && processContext.getProcess() instanceof IProcess2) {
      IProcess2 process=processContext.getProcess();
      if (process != null) {
        CommandStack commandStack=process.getCommandStack();
        if (commandStack != null) {
          exec=true;
          commandStack.execute(cmd);
        }
      }
    }
    if (!exec) {
      cmd.execute();
    }
  }
}
Program: 121038
Project: 121038
Buggy source:
public void doubleClick(DoubleClickEvent event){
  editItem(event.getSelection());
}

Fixed version (ground truth):
@Override public void doubleClick(DoubleClickEvent event){
  editItem(event.getSelection());
}
Program: 121039
Project: 121039
Buggy source:
public Image getColumnImage(Object element,int columnIndex){
  return null;
}

Fixed version (ground truth):
@Override public Image getColumnImage(Object element,int columnIndex){
  return null;
}
Program: 121040
Project: 121040
Buggy source:
public Object[] getElements(Object inputElement){
  return ((List)inputElement).toArray();
}

Fixed version (ground truth):
@Override public Object[] getElements(Object inputElement){
  return ((List)inputElement).toArray();
}
Program: 121041
Project: 121041
Buggy source:
/** 
 * DOC gcui RunVMArgumentsViewer constructor comment.
 * @param name
 * @param labelText
 * @param parent
 */
public JobVMArgumentsComposite(String name,String labelText,Composite parent){
  Label label=new Label(parent,SWT.NONE);
  label.setText(labelText);
  checkBox=new Button(parent,SWT.CHECK);
  checkBox.setText(EParameterName.JOB_RUN_VM_ARGUMENTS_OPTION.getDisplayName());
  final Composite composite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=getNumberOfControls();
  layout.marginWidth=0;
  layout.marginHeight=0;
  layout.horizontalSpacing=8;
  composite.setLayout(layout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  doFillIntoGrid(composite,layout.numColumns);
  composite.setEnabled(false);
  checkBox.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setAllEnabled(composite,checkBox.getSelection());
      if (getJobProcess() != null) {
        executeCommand(new PropertyChangeCommand((Element)getJobProcess(),EParameterName.JOB_RUN_VM_ARGUMENTS_OPTION.getName(),checkBox.getSelection()));
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * DOC gcui RunVMArgumentsViewer constructor comment.
 * @param name
 * @param labelText
 * @param parent
 */
public JobVMArgumentsComposite(String name,String labelText,Composite parent){
  Label label=new Label(parent,SWT.NONE);
  label.setText(labelText);
  checkBox=new Button(parent,SWT.CHECK);
  checkBox.setText(EParameterName.JOB_RUN_VM_ARGUMENTS_OPTION.getDisplayName());
  final Composite composite=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.numColumns=getNumberOfControls();
  layout.marginWidth=0;
  layout.marginHeight=0;
  layout.horizontalSpacing=8;
  composite.setLayout(layout);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  doFillIntoGrid(composite,layout.numColumns);
  composite.setEnabled(false);
  checkBox.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      setAllEnabled(composite,checkBox.getSelection());
      if (getJobProcess() != null) {
        executeCommand(new PropertyChangeCommand(getJobProcess(),EParameterName.JOB_RUN_VM_ARGUMENTS_OPTION.getName(),checkBox.getSelection()));
      }
    }
  }
);
}
Program: 121042
Project: 121042
Buggy source:
public void dispose(){
}

Fixed version (ground truth):
@Override public void dispose(){
}
Program: 121043
Project: 121043
Buggy source:
public boolean isLabelProperty(Object element,String property){
  return false;
}

Fixed version (ground truth):
@Override public boolean isLabelProperty(Object element,String property){
  return false;
}
Program: 121044
Project: 121044
Buggy source:
protected void doSave(){
  String s=writeString(list);
  if (s != null && getJobProcess() != null) {
    executeCommand(new PropertyChangeCommand((Element)getJobProcess(),EParameterName.JOB_RUN_VM_ARGUMENTS.getName(),s));
  }
}

Fixed version (ground truth):
protected void doSave(){
  String s=writeString(list);
  if (s != null && getJobProcess() != null) {
    executeCommand(new PropertyChangeCommand(getJobProcess(),EParameterName.JOB_RUN_VM_ARGUMENTS.getName(),s));
  }
}
Program: 121045
Project: 121045
Buggy source:
protected ITableLabelProvider createLabelProvider(){
  return new ITableLabelProvider(){
    public Image getColumnImage(    Object element,    int columnIndex){
      return null;
    }
    public String getColumnText(    Object element,    int columnIndex){
      String value=((String)element);
      if (columnIndex == 0) {
        String trim=ARG_DELIMITER.trim();
        if (value.trim().startsWith(trim)) {
          return value;
        }
        return trim + value;
      }
      throw new IllegalStateException();
    }
    public void addListener(    ILabelProviderListener listener){
    }
    public void dispose(){
    }
    public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    public void removeListener(    ILabelProviderListener listener){
    }
  }
;
}

Fixed version (ground truth):
protected ITableLabelProvider createLabelProvider(){
  return new ITableLabelProvider(){
    @Override public Image getColumnImage(    Object element,    int columnIndex){
      return null;
    }
    @Override public String getColumnText(    Object element,    int columnIndex){
      String value=((String)element);
      if (columnIndex == 0) {
        return value;
      }
      throw new IllegalStateException();
    }
    @Override public void addListener(    ILabelProviderListener listener){
    }
    @Override public void dispose(){
    }
    @Override public boolean isLabelProperty(    Object element,    String property){
      return false;
    }
    @Override public void removeListener(    ILabelProviderListener listener){
    }
  }
;
}
Program: 121046
Project: 121046
Buggy source:
protected void editItem(ISelection sel){
  IStructuredSelection selection=(IStructuredSelection)sel;
  String existing=(String)selection.getFirstElement();
  String value=getExistingInputObject(existing);
  if (value != null) {
    int indexOf=list.indexOf(existing);
    list.remove(existing);
    list.add(indexOf,value);
    viewer.refresh();
    doSave();
  }
}

Fixed version (ground truth):
protected void editItem(ISelection sel){
  IStructuredSelection selection=(IStructuredSelection)sel;
  String existing=(String)selection.getFirstElement();
  String value=getExistingInputObject(existing);
  if (value != null) {
    int indexOf=list.indexOf(existing);
    list.remove(existing);
    list.add(indexOf,value.replaceAll("String_Node_Str","String_Node_Str"));
    viewer.refresh();
    doSave();
  }
}