nus-yam/ex-repair huggingface dataset:
Program: 128799
Project: 128799
Buggy source:
public IRepositoryViewObject getLastVersion(Project project,String id,String relativeFolder,ERepositoryObjectType type) throws PersistenceException {
  List<IRepositoryViewObject> serializableAllVersion=null;
  Object fullFolder=getFullFolder(project,type,relativeFolder);
  serializableAllVersion=getSerializableFromFolder(project,fullFolder,id,type,false,false,false,true);
  if (serializableAllVersion.isEmpty()) {
    serializableAllVersion=getSerializable(project,id,true,false);
  }
  int size=serializableAllVersion.size();
  if (size > 1) {
    String message=getItemsMessages(serializableAllVersion,size);
    throw new PersistenceException(Messages.getString("String_Node_Str",message));
  }
 else   if (size == 1) {
    return serializableAllVersion.get(0);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public IRepositoryViewObject getLastVersion(Project project,String id,String relativeFolder,ERepositoryObjectType type) throws PersistenceException {
  List<IRepositoryViewObject> serializableAllVersion=null;
  Object fullFolder=getFullFolder(project,type,relativeFolder);
  serializableAllVersion=getSerializableFromFolder(project,fullFolder,id,type,false,false,false,true);
  if (serializableAllVersion.isEmpty()) {
    serializableAllVersion=getSerializable(project,id,true,false);
  }
  int size=serializableAllVersion.size();
  if (size > 1) {
    String message=getItemsMessages(serializableAllVersion,size);
    throw new PersistenceException(Messages.getString("String_Node_Str",message));
  }
 else   if (size == 1) {
    return serializableAllVersion.get(0);
  }
 else {
    return null;
  }
}
Program: 128800
Project: 128800
Buggy source:
public FolderItem getFolderItem(Project project,ERepositoryObjectType itemType,IPath path){
  return getFolderHelper(project.getEmfProject()).getFolder(ERepositoryObjectType.getFolderName(itemType) + IPath.SEPARATOR + path);
}

Fixed version (ground truth):
@Override public FolderItem getFolderItem(Project project,ERepositoryObjectType itemType,IPath path){
  return getFolderHelper(project.getEmfProject()).getFolder(ERepositoryObjectType.getFolderName(itemType) + IPath.SEPARATOR + path);
}
Program: 128801
Project: 128801
Buggy source:
public boolean canUnlock(Item item) throws PersistenceException {
  return true;
}

Fixed version (ground truth):
@Override public boolean canUnlock(Item item) throws PersistenceException {
  return true;
}
Program: 128802
Project: 128802
Buggy source:
public RootContainer<String,IRepositoryViewObject> getTdqRepositoryViewObjects(Project project,ERepositoryObjectType type,String folderName,boolean[] options) throws PersistenceException {
  return getObjectFromFolder(project,type,folderName,true,options);
}

Fixed version (ground truth):
@Override public RootContainer<String,IRepositoryViewObject> getTdqRepositoryViewObjects(Project project,ERepositoryObjectType type,String folderName,boolean[] options) throws PersistenceException {
  return getObjectFromFolder(project,type,folderName,true,options);
}
Program: 128803
Project: 128803
Buggy source:
public RootContainer<String,IRepositoryViewObject> getRootContainerFromType(Project project,ERepositoryObjectType type){
  if (project == null || type == null) {
    return null;
  }
  try {
    return getObjectFromFolder(project,type,true);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}

Fixed version (ground truth):
@Override public RootContainer<String,IRepositoryViewObject> getRootContainerFromType(Project project,ERepositoryObjectType type){
  if (project == null || type == null) {
    return null;
  }
  try {
    return getObjectFromFolder(project,type,true);
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}
Program: 128804
Project: 128804
Buggy source:
private Object getFullFolder(Project project,ERepositoryObjectType itemType,String path) throws PersistenceException {
  Object folder=getFolder(project,itemType);
  if (folder == null) {
    return null;
  }
  Object fullFolder;
  if (folder instanceof IFolder) {
    fullFolder=(IFolder)getFolder(project,itemType);
    if (path != null && !"String_Node_Str".equals(path)) {
      fullFolder=((IFolder)fullFolder).getFolder(new Path(path));
    }
  }
 else {
    if (path != null && !"String_Node_Str".equals(path)) {
      if (folder == null) {
        fullFolder=ResourceModelUtils.getProject(project).getFolder(new Path(path));
      }
 else {
        fullFolder=this.getFolderHelper(project.getEmfProject()).getFolder(((FolderItem)folder).getProperty().getLabel() + "String_Node_Str" + path);
      }
    }
 else {
      fullFolder=folder;
    }
  }
  return fullFolder;
}

Fixed version (ground truth):
private Object getFullFolder(Project project,ERepositoryObjectType itemType,String path) throws PersistenceException {
  Object folder=getFolder(project,itemType);
  if (folder == null) {
    return null;
  }
  Object fullFolder;
  if (folder instanceof IFolder) {
    fullFolder=getFolder(project,itemType);
    if (path != null && !"String_Node_Str".equals(path)) {
      fullFolder=((IFolder)fullFolder).getFolder(new Path(path));
    }
  }
 else {
    if (path != null && !"String_Node_Str".equals(path)) {
      if (folder == null) {
        fullFolder=ResourceModelUtils.getProject(project).getFolder(new Path(path));
      }
 else {
        fullFolder=this.getFolderHelper(project.getEmfProject()).getFolder(((FolderItem)folder).getProperty().getLabel() + "String_Node_Str" + path);
      }
    }
 else {
      fullFolder=folder;
    }
  }
  return fullFolder;
}
Program: 128805
Project: 128805
Buggy source:
public Map<String,List<URI>> getRoutineAndJars();

Fixed version (ground truth):
public Map<String,List<String>> getRoutineAndJars();
Program: 128809
Project: 128809
Buggy source:
public static byte[] saveImageToData(Image img){
  if (img != null) {
    ByteArrayOutputStream baos=null;
    try {
      baos=new ByteArrayOutputStream();
      BufferedOutputStream stream=new BufferedOutputStream(baos,8192);
      ImageLoader imageLoader=new ImageLoader();
      imageLoader.data=new ImageData[]{img.getImageData()};
      imageLoader.save(stream,SWT.IMAGE_PNG);
      stream.flush();
      byte[] imageByteArray=baos.toByteArray();
      return imageByteArray;
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
 finally {
      if (baos != null) {
        try {
          baos.close();
          if (img != null && !img.isDisposed())           img.dispose();
        }
 catch (        IOException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static byte[] saveImageToData(Image img){
  if (img != null) {
    ByteArrayOutputStream baos=null;
    try {
      baos=new ByteArrayOutputStream();
      BufferedOutputStream stream=new BufferedOutputStream(baos,8192);
      ImageLoader imageLoader=new ImageLoader();
      imageLoader.data=new ImageData[]{img.getImageData()};
      imageLoader.save(stream,SWT.IMAGE_PNG);
      stream.flush();
      byte[] imageByteArray=baos.toByteArray();
      return imageByteArray;
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
 finally {
      if (baos != null) {
        try {
          baos.close();
          if (img != null && !img.isDisposed()) {
            img.dispose();
          }
        }
 catch (        IOException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return null;
}
Program: 128810
Project: 128810
Buggy source:
/** 
 * ggu Comment method "AdjustSize". do the better size of image, when scale.
 */
public static Point AdjustSize(final Point originalSize,final Point requiredSize){
  Point newSize=new Point(originalSize.x,originalSize.y);
  if (originalSize.x <= requiredSize.x && originalSize.y <= requiredSize.y) {
    newSize.x=originalSize.x;
    newSize.y=originalSize.y;
  }
 else {
    float w=originalSize.x / (float)requiredSize.x;
    float h=originalSize.y / (float)requiredSize.y;
    if (w > h) {
      newSize.x=requiredSize.x;
      newSize.y=(int)(w >= 1 ? Math.round(originalSize.y / w) : Math.round(originalSize.y * w));
    }
 else     if (w < h) {
      newSize.x=(int)(h >= 1 ? Math.round(originalSize.x / h) : Math.round(originalSize.x * h));
      newSize.y=requiredSize.y;
    }
 else {
      newSize.x=requiredSize.x;
      newSize.y=requiredSize.y;
    }
  }
  return newSize;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "AdjustSize". do the better size of image, when scale.
 */
public static Point AdjustSize(final Point originalSize,final Point requiredSize){
  Point newSize=new Point(originalSize.x,originalSize.y);
  if (originalSize.x <= requiredSize.x && originalSize.y <= requiredSize.y) {
    newSize.x=originalSize.x;
    newSize.y=originalSize.y;
  }
 else {
    float w=originalSize.x / (float)requiredSize.x;
    float h=originalSize.y / (float)requiredSize.y;
    if (w > h) {
      newSize.x=requiredSize.x;
      newSize.y=(w >= 1 ? Math.round(originalSize.y / w) : Math.round(originalSize.y * w));
    }
 else     if (w < h) {
      newSize.x=(h >= 1 ? Math.round(originalSize.x / h) : Math.round(originalSize.x * h));
      newSize.y=requiredSize.y;
    }
 else {
      newSize.x=requiredSize.x;
      newSize.y=requiredSize.y;
    }
  }
  return newSize;
}
Program: 128813
Project: 128813
Buggy source:
public void setContentProvider(IContentProvider contentProvider){
  if (tableViewer != null && tableViewer.getContentProvider() != contentProvider) {
    tableViewer.setContentProvider(contentProvider);
  }
  this.contentProvider=contentProvider;
}

Fixed version (ground truth):
public void setContentProvider(IStructuredContentProvider contentProvider){
  if (tableViewer != null && tableViewer.getContentProvider() != contentProvider) {
    tableViewer.setContentProvider(contentProvider);
  }
  this.contentProvider=contentProvider;
}
Program: 128814
Project: 128814
Buggy source:
/** 
 * <p> Create a new instance of <code>Table</code> with its <code>TableColumn</code>s and create also a new instance of <code>TableViewer</code> if these objects doesn't exist already. </p> <p> Initialize the <code>TableViewer</code> with by default the <code>DefaultStructuredContentProvider</code>, the <code>DefaultTableLabelProvider</code> and the <code>DefaultTableViewerSorter</code>. </p> <p> If you use the default ContentProvider, you must set as input an object which extends <code>Collection</code>. </p> <p> <b> If it is the second or more time than you call this method, only the input object is loaded. Call methods of <code>TableViewer</code> for others operations. </b> </p>
 * @param input by default a object which extends <code>Collection</code>.
 */
public void init(List list){
  if (!initCalled) {
    initCalled=true;
    if (this.table == null) {
      createTable();
    }
    attachLabelProvider();
    buildAndLayoutTable();
    attachViewerSorter();
    attachContentProvider();
    attachCellEditors();
    addListeners();
  }
  boolean hasChanged=false;
  if (this.list != list) {
    hasChanged=true;
  }
  setInputList(list);
  if (tableEditorManager != null && list != null) {
    tableEditorManager.init(this.listenableList);
  }
  if (hasChanged && !(contentProvider instanceof ILazyContentProvider)) {
    refreshTableEditorControls();
  }
}

Fixed version (ground truth):
/** 
 * <p> Create a new instance of <code>Table</code> with its <code>TableColumn</code>s and create also a new instance of <code>TableViewer</code> if these objects doesn't exist already. </p> <p> Initialize the <code>TableViewer</code> with by default the <code>DefaultStructuredContentProvider</code>, the <code>DefaultTableLabelProvider</code> and the <code>DefaultTableViewerSorter</code>. </p> <p> If you use the default ContentProvider, you must set as input an object which extends <code>Collection</code>. </p> <p> <b> If it is the second or more time than you call this method, only the input object is loaded. Call methods of <code>TableViewer</code> for others operations. </b> </p>
 * @param input by default a object which extends <code>Collection</code>.
 */
public void init(List list){
  if (!initCalled) {
    initCalled=true;
    if (this.table == null) {
      createTable();
    }
    attachLabelProvider();
    buildAndLayoutTable();
    attachViewerSorter();
    attachContentProvider();
    attachCellEditors();
    addListeners();
  }
  boolean hasChanged=false;
  if (this.list != list) {
    hasChanged=true;
  }
  setInputList(list);
  if (tableEditorManager != null && list != null) {
    tableEditorManager.init(this.listenableList);
  }
  if (hasChanged && !isLazyLoad()) {
    refreshTableEditorControls();
  }
}
Program: 128815
Project: 128815
Buggy source:
/** 
 * Initiate the style intended for instanciate <code>Table</code>.
 * @return int style
 */
protected int checkTableStyles(){
  int style=SWT.NONE;
  if (lineSelection != null) {
    style|=lineSelection.getSwtStyle();
  }
  if (showLineSelection != null) {
    style|=showLineSelection.getSwtStyle();
  }
  if (checkboxInFirstColumn) {
    style|=SWT.CHECK;
  }
  if (borderVisible) {
    style|=SWT.BORDER;
  }
  if (horizontalScroll) {
    style|=SWT.H_SCROLL;
  }
  if (verticalScroll) {
    style|=SWT.V_SCROLL;
  }
  if (lazyLoad) {
    style|=SWT.VIRTUAL;
  }
  return style;
}

Fixed version (ground truth):
/** 
 * Initiate the style intended for instanciate <code>Table</code>.
 * @return int style
 */
protected int checkTableStyles(){
  int style=SWT.NONE;
  if (lineSelection != null) {
    style|=lineSelection.getSwtStyle();
  }
  if (showLineSelection != null) {
    style|=showLineSelection.getSwtStyle();
  }
  if (checkboxInFirstColumn) {
    style|=SWT.CHECK;
  }
  if (borderVisible) {
    style|=SWT.BORDER;
  }
  if (horizontalScroll) {
    style|=SWT.H_SCROLL;
  }
  if (verticalScroll) {
    style|=SWT.V_SCROLL;
  }
  if (isLazyLoad()) {
    style|=SWT.VIRTUAL;
  }
  return style;
}
Program: 128816
Project: 128816
Buggy source:
public void setLazyLoad(boolean lazyLoad){
  this.lazyLoad=lazyLoad;
  setContentProvider(new LazyContentProvider(this));
}

Fixed version (ground truth):
public void setLazyLoad(boolean lazyLoad){
  this.lazyLoad=lazyLoad;
}
Program: 128817
Project: 128817
Buggy source:
@Override public void replace(Object element,int index){
  super.replace(element,index);
  refreshTableEditorColumn(index);
  if (!(contentProvider instanceof ILazyContentProvider)) {
    refreshTableEditorControls();
  }
}

Fixed version (ground truth):
@Override public void replace(Object element,int index){
  super.replace(element,index);
  refreshTableEditorControls();
}
Program: 128819
Project: 128819
Buggy source:
@Override public void insert(Object element,int position){
  super.insert(element,position);
  refreshTableEditorControls();
}

Fixed version (ground truth):
@Override public void insert(Object element,int position){
  super.insert(element,position);
}
Program: 128820
Project: 128820
Buggy source:
public void refreshTableEditorColumn(int index){
  if (tableEditorManager != null && contentProvider instanceof ILazyContentProvider) {
    tableEditorManager.refreshColumn(index);
  }
}

Fixed version (ground truth):
public void refreshTableEditorColumn(int index){
  if (tableEditorManager != null && isLazyLoad()) {
    tableEditorManager.refreshColumn(index);
  }
}
Program: 128821
Project: 128821
Buggy source:
private void handleAddedEvent(final ListenableListEvent event){
  int indexStart=event.index;
  if (tableViewerCreator.getTable().isDisposed()) {
    return;
  }
  if (!(tableViewerCreator.getContentProvider() instanceof ILazyContentProvider)) {
    TableItem[] items=tableViewerCreator.getTable().getItems();
    List<TableEditor> addedTableEditor=new ArrayList<TableEditor>();
    for (    TableItem item : items) {
      TableItem tableItem=item;
      if (previousItemsHash == null || !previousItemsHash.contains(tableItem)) {
        for (int iEditorCol=0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
          TableViewerCreatorColumnNotModifiable column=columnsWithEditorContent.get(iEditorCol);
          TableEditorContentNotModifiable tableEditorContent=column.getTableEditorContent();
          String idProperty=column.getId();
          TableEditor tableEditor=addTableEditor(column,tableEditorContent,idProperty,tableItem);
          if (tableEditor != null) {
            addedTableEditor.add(tableEditor);
          }
        }
      }
    }
    for (int i=indexStart; i < items.length; i++) {
      TableItem tableItem=items[i];
      Object data=tableItem.getData();
      Collection<TableEditor> tableEditorCollection=dataToMultipleDataEditor.getCollection(data);
      for (      TableEditor tableEditor : tableEditorCollection) {
        tableEditor.setItem(tableItem);
      }
    }
    previousItemsHash=new HashSet<TableItem>(Arrays.asList(items));
  }
 else {
    refreshColumn(indexStart);
  }
}

Fixed version (ground truth):
private void handleAddedEvent(final ListenableListEvent event){
  int indexStart=event.index;
  if (tableViewerCreator.getTable().isDisposed()) {
    return;
  }
  TableItem[] items=tableViewerCreator.getTable().getItems();
  List<TableEditor> addedTableEditor=new ArrayList<TableEditor>();
  for (  TableItem item : items) {
    TableItem tableItem=item;
    if (previousItemsHash == null || !previousItemsHash.contains(tableItem)) {
      for (int iEditorCol=0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
        TableViewerCreatorColumnNotModifiable column=columnsWithEditorContent.get(iEditorCol);
        TableEditorContentNotModifiable tableEditorContent=column.getTableEditorContent();
        String idProperty=column.getId();
        TableEditor tableEditor=addTableEditor(column,tableEditorContent,idProperty,tableItem);
        if (tableEditor != null) {
          addedTableEditor.add(tableEditor);
        }
      }
    }
  }
  for (int i=indexStart; i < items.length; i++) {
    TableItem tableItem=items[i];
    Object data=tableItem.getData();
    Collection<TableEditor> tableEditorCollection=dataToMultipleDataEditor.getCollection(data);
    for (    TableEditor tableEditor : tableEditorCollection) {
      tableEditor.setItem(tableItem);
    }
  }
  previousItemsHash=new HashSet<TableItem>(Arrays.asList(items));
}
Program: 128822
Project: 128822
Buggy source:
public void refreshColumn(int index){
  Table table=tableViewerCreator.getTable();
  if (table.isDisposed()) {
    return;
  }
  for (int iEditorCol=0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
    TableViewerCreatorColumnNotModifiable column=columnsWithEditorContent.get(iEditorCol);
    TableEditorContentNotModifiable tableEditorContent=column.getTableEditorContent();
    String idProperty=column.getId();
    TableItem tableItem=table.getItems()[index];
    if (dataToMultipleDataEditor.containsKey(tableItem.getData())) {
      Collection<TableEditor> object=dataToMultipleDataEditor.getCollection(tableItem.getData());
      for (      TableEditor tableEditor : object) {
        tableEditor.setItem(tableItem);
        Control editor=tableEditor.getEditor();
        if (editor != null) {
          editor.redraw();
        }
      }
      if (object.size() == columnsWithEditorContent.size()) {
        break;
      }
 else {
        if (iEditorCol < object.size()) {
          continue;
        }
 else {
          addTableEditor(column,tableEditorContent,idProperty,table.getItems()[index]);
        }
      }
    }
 else {
      addTableEditor(column,tableEditorContent,idProperty,table.getItems()[index]);
    }
  }
}

Fixed version (ground truth):
public void refreshColumn(int index){
  Table table=tableViewerCreator.getTable();
  if (table.isDisposed() || index >= table.getItems().length) {
    return;
  }
  for (int iEditorCol=0; iEditorCol < columnsWithEditorContent.size(); iEditorCol++) {
    TableViewerCreatorColumnNotModifiable column=columnsWithEditorContent.get(iEditorCol);
    TableEditorContentNotModifiable tableEditorContent=column.getTableEditorContent();
    String idProperty=column.getId();
    TableItem tableItem=table.getItems()[index];
    if (dataToMultipleDataEditor.containsKey(tableItem.getData())) {
      Collection<TableEditor> object=dataToMultipleDataEditor.getCollection(tableItem.getData());
      for (      TableEditor tableEditor : object) {
        tableEditor.setItem(tableItem);
        Control editor=tableEditor.getEditor();
        if (editor != null) {
          editor.redraw();
        }
      }
      if (object.size() == columnsWithEditorContent.size()) {
        break;
      }
 else {
        if (iEditorCol < object.size()) {
          continue;
        }
 else {
          addTableEditor(column,tableEditorContent,idProperty,table.getItems()[index]);
        }
      }
    }
 else {
      addTableEditor(column,tableEditorContent,idProperty,table.getItems()[index]);
    }
  }
}
Program: 128823
Project: 128823
Buggy source:
/** 
 * DOC amaumont Comment method "handleListenableListEvent".
 * @param event
 */
protected void handleAfterListenableListOperationEvent(ListenableListEvent<B> event){
  if (tableViewerCreator.getTable() != null && !tableViewerCreator.getTable().isDisposed()) {
    TableViewer tableViewer=tableViewerCreator.getTableViewer();
    if (event.type == TYPE.LIST_REGISTERED && tableViewerCreator.getInputList() == null && getExtendedTableModel().isDataRegistered()) {
      tableViewerCreator.setInputList(getBeansList());
      new AsynchronousThreading(100,true,tableViewerCreator.getTable().getDisplay(),new Runnable(){
        public void run(){
          tableViewerCreator.layout();
        }
      }
).start();
    }
 else {
      if (event.type == TYPE.ADDED) {
        if (tableViewer.getContentProvider() instanceof ILazyContentProvider) {
          tableViewer.setItemCount(event.source.size());
        }
        tableViewer.refresh();
      }
 else       if (event.type == TYPE.SWAPED) {
        Object[] swapedObjects=event.swapedObjects;
        for (        Object data : swapedObjects) {
          tableViewer.refresh(data,true,true);
        }
      }
 else       if (event.type == TYPE.REMOVED) {
      }
 else {
        if (tableViewer.getContentProvider() instanceof ILazyContentProvider) {
          tableViewer.setItemCount(event.source.size());
        }
        tableViewer.refresh();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "handleListenableListEvent".
 * @param event
 */
protected void handleAfterListenableListOperationEvent(ListenableListEvent<B> event){
  if (tableViewerCreator.getTable() != null && !tableViewerCreator.getTable().isDisposed()) {
    TableViewer tableViewer=tableViewerCreator.getTableViewer();
    if (event.type == TYPE.LIST_REGISTERED && tableViewerCreator.getInputList() == null && getExtendedTableModel().isDataRegistered()) {
      tableViewerCreator.setInputList(getBeansList());
      new AsynchronousThreading(100,true,tableViewerCreator.getTable().getDisplay(),new Runnable(){
        public void run(){
          tableViewerCreator.layout();
        }
      }
).start();
    }
 else {
      if (tableViewerCreator.isLazyLoad()) {
        tableViewer.refresh();
      }
 else {
        if (event.type == TYPE.ADDED) {
        }
 else         if (event.type == TYPE.SWAPED) {
          Object[] swapedObjects=event.swapedObjects;
          for (          Object data : swapedObjects) {
            tableViewer.refresh(data,true,true);
          }
        }
 else         if (event.type == TYPE.REMOVED) {
        }
 else {
          tableViewer.refresh();
        }
      }
    }
  }
}
Program: 128825
Project: 128825
Buggy source:
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    Set<String> jarList=new HashSet<String>();
    Set<ModuleNeeded> neededModules=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion());
    for (    ModuleNeeded module : neededModules) {
      jarList.add(module.getModuleName());
    }
    CorePlugin.getDefault().getRunProcessService().updateLibraries(jarList,currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        ((IJavaProject)CorePlugin.getDefault().getRunProcessService().getJavaProject()).getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    codeModified=false;
  }
}

Fixed version (ground truth):
private static void generateBuildInfo(JobInfo jobInfo,IProgressMonitor progressMonitor,boolean isMainJob,IProcess currentProcess,String currentJobName) throws ProcessorException {
  if (isMainJob) {
    progressMonitor.subTask(Messages.getString("String_Node_Str") + currentJobName);
    Set<String> jarList=new HashSet<String>();
    Set<ModuleNeeded> neededModules=LastGenerationInfo.getInstance().getModulesNeededWithSubjobPerJob(jobInfo.getJobId(),jobInfo.getJobVersion());
    for (    ModuleNeeded module : neededModules) {
      jarList.add(module.getModuleName());
    }
    CorePlugin.getDefault().getRunProcessService().updateLibraries(jarList,currentProcess);
    if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA && codeModified) {
      try {
        (CorePlugin.getDefault().getRunProcessService().getJavaProject()).getProject().build(IncrementalProjectBuilder.AUTO_BUILD,null);
      }
 catch (      CoreException e) {
        throw new ProcessorException(e);
      }
    }
    codeModified=false;
  }
}
Program: 128826
Project: 128826
Buggy source:
/** 
 * This method is used to reset the tRunJob component's context,see feature 1625.
 * @param jobInfo
 * @param currentProcess
 * @param selectedContextName
 */
private static void resetRunJobComponentParameterForContextApply(JobInfo jobInfo,IProcess currentProcess,String selectedContextName){
  if (jobInfo.isApplyContextToChildren()) {
    for (Iterator<? extends INode> iter=currentProcess.getGeneratingNodes().iterator(); iter.hasNext(); ) {
      INode node=iter.next();
      if ((node != null) && node.getComponent().getName().equals("String_Node_Str")) {
        node.getElementParameter("String_Node_Str").setValue(selectedContextName);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This method is used to reset the tRunJob component's context,see feature 1625.
 * @param jobInfo
 * @param currentProcess
 * @param selectedContextName
 */
private static void resetRunJobComponentParameterForContextApply(JobInfo jobInfo,IProcess currentProcess,String selectedContextName){
  if (jobInfo.isApplyContextToChildren()) {
    for (    INode node : currentProcess.getGeneratingNodes()) {
      if ((node != null) && node.getComponent().getName().equals("String_Node_Str")) {
        node.getElementParameter("String_Node_Str").setValue(selectedContextName);
      }
    }
  }
}
Program: 128827
Project: 128827
Buggy source:
public static String[] getMainCommand(String processName,String processVersion,String contextName,int statisticPort,int tracePort,String... codeOptions) throws ProcessorException {
  IProcess currentProcess=null;
  ProcessItem selectedProcessItem=null;
  selectedProcessItem=ItemCacheManager.getProcessItem(processName,processVersion);
  if (selectedProcessItem != null) {
    IDesignerCoreService service=CorePlugin.getDefault().getDesignerCoreService();
    currentProcess=service.getProcessFromProcessItem(selectedProcessItem);
  }
  if (currentProcess == null) {
    return new String[]{};
  }
  IContext currentContext=getContext(currentProcess,contextName);
  IProcessor processor=getProcessor(currentProcess,selectedProcessItem.getProperty(),currentContext);
  String[] cmd=new String[]{processor.getCodePath().removeFirstSegments(1).toString().replace("String_Node_Str","String_Node_Str")};
  if (codeOptions != null) {
    for (int i=0; i < codeOptions.length; i++) {
      String string=codeOptions[i];
      if (string != null) {
        cmd=(String[])ArrayUtils.add(cmd,string);
      }
    }
  }
  if (contextName != null && !contextName.equals("String_Node_Str")) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + contextName);
  }
  if (statisticPort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + statisticPort);
  }
  if (tracePort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + tracePort);
  }
  return cmd;
}

Fixed version (ground truth):
public static String[] getMainCommand(String processName,String processVersion,String contextName,int statisticPort,int tracePort,String... codeOptions) throws ProcessorException {
  IProcess currentProcess=null;
  ProcessItem selectedProcessItem=null;
  selectedProcessItem=ItemCacheManager.getProcessItem(processName,processVersion);
  if (selectedProcessItem != null) {
    IDesignerCoreService service=CorePlugin.getDefault().getDesignerCoreService();
    currentProcess=service.getProcessFromProcessItem(selectedProcessItem);
  }
  if (currentProcess == null) {
    return new String[]{};
  }
  IContext currentContext=getContext(currentProcess,contextName);
  IProcessor processor=getProcessor(currentProcess,selectedProcessItem.getProperty(),currentContext);
  String[] cmd=new String[]{processor.getCodePath().removeFirstSegments(1).toString().replace("String_Node_Str","String_Node_Str")};
  if (codeOptions != null) {
    for (    String string : codeOptions) {
      if (string != null) {
        cmd=(String[])ArrayUtils.add(cmd,string);
      }
    }
  }
  if (contextName != null && !contextName.equals("String_Node_Str")) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + contextName);
  }
  if (statisticPort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + statisticPort);
  }
  if (tracePort != -1) {
    cmd=(String[])ArrayUtils.add(cmd,"String_Node_Str" + tracePort);
  }
  return cmd;
}
Program: 128831
Project: 128831
Buggy source:
/** 
 * Parses text from the beginning of the given string to produce a date using the given pattern and the default date format symbols for the given locale. The method may not use the entire text of the given string. <p>
 * @param pattern the pattern to parse.
 * @param stringDate A <code>String</code> whose beginning should be parsed.
 * @return A <code>Date</code> parsed from the string.
 * @throws ParseException
 * @exception ParseException if the beginning of the specified string cannot be parsed.{talendTypes} Date {Category} TalendDate {param} string("yyyy-MM-dd HH:mm:ss") pattern : the pattern to parse {param} string("") stringDate : A <code>String</code> whose beginning should be parsed {example} parseDate("yyyy-MMM-dd HH:mm:ss", "23-Mar-1979 23:59:59") #
 */
public synchronized static Date parseDate(String pattern,String stringDate){
  try {
    return FastDateParser.getInstance(pattern).parse(stringDate);
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Parses text from the beginning of the given string to produce a date using the given pattern and the default date format symbols for the given locale. The method may not use the entire text of the given string. <p>
 * @param pattern the pattern to parse.
 * @param stringDate A <code>String</code> whose beginning should be parsed.
 * @return A <code>Date</code> parsed from the string.
 * @throws ParseException
 * @exception ParseException if the beginning of the specified string cannot be parsed.{talendTypes} Date {Category} TalendDate {param} string("yyyy-MM-dd HH:mm:ss") pattern : the pattern to parse {param} string("") stringDate : A <code>String</code> whose beginning should be parsed {example} parseDate("yyyy-MMM-dd HH:mm:ss", "23-Mar-1979 23:59:59") #
 */
public synchronized static Date parseDate(String pattern,String stringDate){
  try {
    DateFormat df=FastDateParser.getInstance(pattern);
    Date d=df.parse(stringDate);
    int offset=df.getCalendar().get(Calendar.ZONE_OFFSET);
    char sign=offset >= 0 ? '+' : '-';
    int hour=Math.abs(offset) / 1000 / 60/ 60;
    int min=Math.abs(offset) / 1000 / 60 % 60;
    String minStr=min < 10 ? "String_Node_Str" + min : min + "String_Node_Str";
    TalendTimestampWithTZ tstz=new TalendTimestampWithTZ(new java.sql.Timestamp(d.getTime()),TimeZone.getTimeZone("String_Node_Str" + sign + hour+ "String_Node_Str"+ minStr));
    return tstz;
  }
 catch (  ParseException e) {
    throw new RuntimeException(e);
  }
}
Program: 128838
Project: 128838
Buggy source:
public Map<String,List<URI>> getRoutineAndJars();

Fixed version (ground truth):
public Map<String,List<String>> getRoutineAndJars();
Program: 128844
Project: 128844
Buggy source:
@Override public List<org.talend.core.model.properties.Project> getReferencedProjects(Project project){
  String parentBranch=ProjectManager.getInstance().getMainProjectBranch(project);
  List<org.talend.core.model.properties.Project> refProjectList=new ArrayList<org.talend.core.model.properties.Project>();
  for (  ProjectReference refProject : (List<ProjectReference>)getRepositoryContext().getProject().getEmfProject().getReferencedProjects()) {
    if (refProject.getBranch() == null || parentBranch.equals(refProject.getBranch())) {
      refProjectList.add(refProject.getReferencedProject());
    }
  }
  return refProjectList;
}

Fixed version (ground truth):
@Override public List<org.talend.core.model.properties.Project> getReferencedProjects(Project project){
  String parentBranch=getRepositoryContext().getFields().get(IProxyRepositoryFactory.BRANCH_SELECTION + "String_Node_Str" + project.getTechnicalLabel());
  List<org.talend.core.model.properties.Project> refProjectList=new ArrayList<org.talend.core.model.properties.Project>();
  for (  ProjectReference refProject : (List<ProjectReference>)getRepositoryContext().getProject().getEmfProject().getReferencedProjects()) {
    if (refProject.getBranch() == null || parentBranch.equals(refProject.getBranch())) {
      refProjectList.add(refProject.getReferencedProject());
    }
  }
  return refProjectList;
}
Program: 128845
Project: 128845
Buggy source:
@Override public String getNavigatorViewDescription(){
  Project currentProject=ProjectManager.getInstance().getCurrentProject();
  if (currentProject == null) {
    return "String_Node_Str";
  }
  StringBuffer descBuffer=new StringBuffer();
  descBuffer.append(ProjectManager.LOCAL);
  descBuffer.append("String_Node_Str").append(currentProject.getLabel());
  return descBuffer.toString();
}

Fixed version (ground truth):
@Override public String getNavigatorViewDescription(){
  Project currentProject=ProjectManager.getInstance().getCurrentProject();
  if (currentProject == null) {
    return "String_Node_Str";
  }
  StringBuffer descBuffer=new StringBuffer();
  descBuffer.append("String_Node_Str").append(currentProject.getLabel());
  return descBuffer.toString();
}
Program: 128850
Project: 128850
Buggy source:
/** 
 * create technical name.
 * @param name
 * @return
 */
public static String createTechnicalName(String name){
  return ProjectManager.getInstance().getLocalTechnicalProjectName(name);
}

Fixed version (ground truth):
/** 
 * create technical name.
 * @param name
 * @return
 */
public static String createTechnicalName(String name){
  return ProjectManager.getLocalTechnicalProjectName(name);
}
Program: 128851
Project: 128851
Buggy source:
public String getTechnicalProjectLabel(String lable){
  String projectLabel=lable;
  if (projectLabel != null) {
    projectLabel=projectLabel.trim();
    projectLabel=projectLabel.toUpperCase(Locale.ENGLISH);
    projectLabel=projectLabel.replace("String_Node_Str","String_Node_Str");
    projectLabel=projectLabel.replace("String_Node_Str","String_Node_Str");
  }
  return projectLabel;
}

Fixed version (ground truth):
public static String getTechnicalProjectLabel(String lable){
  String projectLabel=lable;
  if (projectLabel != null) {
    projectLabel=projectLabel.trim();
    projectLabel=projectLabel.toUpperCase(Locale.ENGLISH);
    projectLabel=projectLabel.replace("String_Node_Str","String_Node_Str");
    projectLabel=projectLabel.replace("String_Node_Str","String_Node_Str");
  }
  return projectLabel;
}
Program: 128852
Project: 128852
Buggy source:
/** 
 * DOC ggu Comment method "getLocalTechnicalProjectName". TDI-21185
 * @param projectLabel
 * @return
 */
public String getLocalTechnicalProjectName(String projectLabel){
  if (projectLabel != null) {
    String technicalName=getTechnicalProjectLabel(projectLabel);
    if (enableSpecialTechnicalProjectName()) {
      return LOCAL + UNDER_LINE + technicalName;
    }
    return technicalName;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC ggu Comment method "getLocalTechnicalProjectName". TDI-21185
 * @param projectLabel
 * @return
 */
public static String getLocalTechnicalProjectName(String projectLabel){
  if (projectLabel != null) {
    String technicalName=getTechnicalProjectLabel(projectLabel);
    if (enableSpecialTechnicalProjectName()) {
      return LOCAL + UNDER_LINE + technicalName;
    }
    return technicalName;
  }
  return null;
}
Program: 128853
Project: 128853
Buggy source:
/** 
 * DOC ggu Comment method "getProjectDisplayLabel".
 * @param project
 * @return
 */
public String getProjectDisplayLabel(org.talend.core.model.properties.Project project){
  if (project != null) {
    if (project.getLabel().equals(project.getTechnicalLabel())) {
      return project.getLabel();
    }
    return project.getLabel() + "String_Node_Str" + project.getTechnicalLabel()+ "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * DOC ggu Comment method "getProjectDisplayLabel".
 * @param project
 * @return
 */
public static String getProjectDisplayLabel(org.talend.core.model.properties.Project project){
  if (project != null) {
    if (project.getLabel().equals(project.getTechnicalLabel())) {
      return project.getLabel();
    }
    return project.getLabel() + "String_Node_Str" + project.getTechnicalLabel()+ "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 128854
Project: 128854
Buggy source:
public boolean enableSpecialTechnicalProjectName(){
  return TalendPropertiesUtil.isEnabledMultiBranchesInWorkspace();
}

Fixed version (ground truth):
public static boolean enableSpecialTechnicalProjectName(){
  return TalendPropertiesUtil.isEnabledMultiBranchesInWorkspace();
}
Program: 128855
Project: 128855
Buggy source:
/** 
 * Defines the default <code>Charset</code> used in case the buffer represents an 8-bit <code>Charset</code>.
 * @param defaultCharset the default <code>Charset</code> to be returned by <code>guessEncoding()</code> if an8-bit <code>Charset</code> is encountered.
 */
public void setDefaultCharset(Charset defaultCharset){
  if (defaultCharset != null) {
    this.defaultCharset=defaultCharset;
  }
 else {
    this.defaultCharset=getDefaultSystemCharset();
  }
}

Fixed version (ground truth):
/** 
 * Defines the default <code>Charset</code> used in case the buffer represents an 8-bit <code>Charset</code>.
 * @param defaultCharset the default <code>Charset</code> to be returned by <code>guessEncoding()</code> if an 8-bit<code>Charset</code> is encountered.
 */
public void setDefaultCharset(Charset defaultCharset){
  if (defaultCharset != null) {
    this.defaultCharset=defaultCharset;
  }
 else {
    this.defaultCharset=getDefaultSystemCharset();
  }
}
Program: 128858
Project: 128858
Buggy source:
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn){
  boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
  java.sql.Connection sqlConn=null;
  try {
    if (noStructureExists) {
      IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=(java.sql.Connection)MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "fillDbConnectionInformation".
 * @param dbConn
 * @return
 */
public static DatabaseConnection fillDbConnectionInformation(DatabaseConnection dbConn){
  boolean noStructureExists=ConnectionHelper.getAllCatalogs(dbConn).isEmpty() && ConnectionHelper.getAllSchemas(dbConn).isEmpty();
  java.sql.Connection sqlConn=null;
  try {
    if (noStructureExists) {
      IMetadataConnection metaConnection=ConvertionHelper.convert(dbConn);
      dbConn=(DatabaseConnection)MetadataFillFactory.getDBInstance().fillUIConnParams(metaConnection,dbConn);
      sqlConn=MetadataConnectionUtils.checkConnection(metaConnection).getObject();
      DatabaseMetaData databaseMetaData=ExtractMetaDataUtils.getDatabaseMetaData(sqlConn,dbConn,false);
      if (sqlConn != null) {
        MetadataFillFactory.getDBInstance().fillCatalogs(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,true));
        MetadataFillFactory.getDBInstance().fillSchemas(dbConn,databaseMetaData,MetadataConnectionUtils.getPackageFilter(dbConn,databaseMetaData,false));
      }
    }
  }
 catch (  Exception e) {
    log.error(e,e);
  }
 finally {
    if (derbyDriver != null) {
      try {
        derbyDriver.connect("String_Node_Str",null);
      }
 catch (      SQLException e) {
      }
    }
  }
  return dbConn;
}
Program: 128863
Project: 128863
Buggy source:
/** 
 * Defines the default <code>Charset</code> used in case the buffer represents an 8-bit <code>Charset</code>.
 * @param defaultCharset the default <code>Charset</code> to be returned by <code>guessEncoding()</code> if an8-bit <code>Charset</code> is encountered.
 */
public void setDefaultCharset(Charset defaultCharset){
  if (defaultCharset != null) {
    this.defaultCharset=defaultCharset;
  }
 else {
    this.defaultCharset=getDefaultSystemCharset();
  }
}

Fixed version (ground truth):
/** 
 * Defines the default <code>Charset</code> used in case the buffer represents an 8-bit <code>Charset</code>.
 * @param defaultCharset the default <code>Charset</code> to be returned by <code>guessEncoding()</code> if an 8-bit<code>Charset</code> is encountered.
 */
public void setDefaultCharset(Charset defaultCharset){
  if (defaultCharset != null) {
    this.defaultCharset=defaultCharset;
  }
 else {
    this.defaultCharset=getDefaultSystemCharset();
  }
}
Program: 128866
Project: 128866
Buggy source:
/** 
 * for editorProperties
 */
public static void refreshEditorPropertiesNode(ERepositoryObjectType type){
  if (isRefreshManually() || !isRefreshCreated()) {
    refresh(type);
  }
 else {
    IRepositoryView repositoryView=getRepositoryView();
    if (repositoryView != null) {
      repositoryView.refresh();
    }
  }
  if (type != null) {
    syncRoutineAndJoblet(type);
  }
}

Fixed version (ground truth):
/** 
 * for editorProperties
 */
public static void refreshEditorPropertiesNode(ERepositoryObjectType type){
}
Program: 128867
Project: 128867
Buggy source:
public static void refreshCreatedNode(IProjectRepositoryNode projectNode,ERepositoryObjectType type){
  IRepositoryView repositoryView=getRepositoryView();
  if (repositoryView != null) {
    if ((isRefreshManually() || !isRefreshCreated()) && !type.isSubItem()) {
      if (projectNode != null) {
        RepositoryNode rootNode=(RepositoryNode)projectNode.getRootRepositoryNode(type);
        repositoryView.refreshAllChildNodes(rootNode);
      }
 else {
        refresh(type);
      }
    }
 else {
      repositoryView.refresh();
    }
    if (type != null) {
      syncRoutineAndJoblet(type);
    }
  }
}

Fixed version (ground truth):
public static void refreshCreatedNode(IProjectRepositoryNode projectNode,ERepositoryObjectType type){
}
Program: 128868
Project: 128868
Buggy source:
/** 
 * for save
 */
public static void refreshSavedNode(RepositoryNode node){
  if (node == null) {
    return;
  }
  IRepositoryView repositoryView=getRepositoryView();
  if (repositoryView != null) {
    if (isRefreshManually() || !isRefreshSaved()) {
      repositoryView.refresh(node);
    }
 else {
      repositoryView.refresh();
    }
  }
}

Fixed version (ground truth):
/** 
 * for save
 */
public static void refreshSavedNode(RepositoryNode node){
}
Program: 128869
Project: 128869
Buggy source:
public static void refresh(Set<ERepositoryObjectType> types){
  IRepositoryView repositoryView=getRepositoryView();
  if (types != null && repositoryView != null) {
    for (    ERepositoryObjectType type : types) {
      repositoryView.refresh(type);
    }
  }
}

Fixed version (ground truth):
public static void refresh(Set<ERepositoryObjectType> types){
}
Program: 128870
Project: 128870
Buggy source:
/** 
 * for delete
 */
public static void refreshDeletedNode(Set<ERepositoryObjectType> types){
  IRepositoryView repositoryView=getRepositoryView();
  if (repositoryView != null) {
    repositoryView.refresh();
  }
}

Fixed version (ground truth):
/** 
 * for delete
 */
public static void refreshDeletedNode(Set<ERepositoryObjectType> types){
  IRepositoryView repositoryView=getRepositoryView();
  if (repositoryView != null) {
  }
}
Program: 128871
Project: 128871
Buggy source:
@Override protected void run() throws LoginException, PersistenceException {
  boolean exist=false;
  if (node != null && node.getObject() != null) {
    Property property=node.getObject().getProperty();
    if (property != null) {
      exist=true;
      doRun();
    }
    if (!exist) {
      refreshRelatedItem(getOldItem());
    }
  }
 else {
    doRun();
  }
}

Fixed version (ground truth):
@Override protected void run() throws LoginException, PersistenceException {
  boolean exist=false;
  if (node != null && node.getObject() != null) {
    Property property=node.getObject().getProperty();
    if (property != null) {
      exist=true;
      doRun();
    }
  }
 else {
    doRun();
  }
}
Program: 128872
Project: 128872
Buggy source:
/** 
 * Convenience method user to refresh view (starting with the given element) on wich action had been called.
 * @param obj - object to start the refresh on
 */
public void refresh(Object obj){
  IRepositoryView viewPart=getViewPart();
  if (viewPart != null) {
    viewPart.refresh(obj);
    viewPart.expand(obj,true);
  }
}

Fixed version (ground truth):
/** 
 * Convenience method user to refresh view (starting with the given element) on wich action had been called.
 * @param obj - object to start the refresh on
 */
public void refresh(Object obj){
  IRepositoryView viewPart=getViewPart();
  if (viewPart != null) {
    viewPart.expand(obj,true);
  }
}