nus-yam/ex-repair huggingface dataset:
Program: 137948
Project: 137948
Buggy source:
private boolean isSameType(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  IPath sourcePath=WorkbenchUtils.getPath((RepositoryNode)sourceNode);
  IPath targetPath=WorkbenchUtils.getPath((RepositoryNode)targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  String sourceString=sourcePath.removeLastSegments(sourceCount - 2).toOSString();
  String targetString=targetPath.removeLastSegments(targetCount - 2).toOSString();
  ERepositoryObjectType sourceType=sourceNode.getContentType();
  ERepositoryObjectType targetentType=targetNode.getContentType();
  if (sourceType == null || targetentType == null || !sourceType.equals(targetentType)) {
    return false;
  }
  return sourceString.equals(targetString);
}

Fixed version (ground truth):
private boolean isSameType(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  String sourceString=sourcePath.removeLastSegments(sourceCount - 2).toOSString();
  String targetString=targetPath.removeLastSegments(targetCount - 2).toOSString();
  ERepositoryObjectType sourceType=sourceNode.getContentType();
  ERepositoryObjectType targetentType=targetNode.getContentType();
  if (sourceType == null || targetentType == null || !sourceType.equals(targetentType)) {
    return false;
  }
  return sourceString.equals(targetString);
}
Program: 137949
Project: 137949
Buggy source:
/** 
 * DOC scorreia Comment method "setRowCountAndNullCount".
 * @param elementToIndicator
 */
protected void setRowCountAndNullCount(Map<ModelElement,List<Indicator>> elementToIndicator){
  Set<ModelElement> analyzedElements=elementToIndicator.keySet();
  for (  ModelElement modelElement : analyzedElements) {
    RowCountIndicator rowCount=getRowCountIndicator(modelElement,elementToIndicator);
    NullCountIndicator nullCount=getNullCountIndicator(modelElement,elementToIndicator);
    List<Indicator> list=elementToIndicator.get(modelElement);
    for (    Indicator ind : list) {
      if (rowCount != null && needPercentage(ind)) {
        ind.setCount(rowCount.getCount());
      }
      if (nullCount != null) {
        ind.setNullCount(nullCount.getNullCount());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC scorreia Comment method "setRowCountAndNullCount".
 * @param elementToIndicator
 */
protected void setRowCountAndNullCount(Map<ModelElement,List<Indicator>> elementToIndicator){
  Set<ModelElement> analyzedElements=elementToIndicator.keySet();
  for (  ModelElement modelElement : analyzedElements) {
    RowCountIndicator rowCount=IndicatorHelper.getRowCountIndicator(modelElement,elementToIndicator);
    NullCountIndicator nullCount=IndicatorHelper.getNullCountIndicator(modelElement,elementToIndicator);
    List<Indicator> list=elementToIndicator.get(modelElement);
    for (    Indicator ind : list) {
      if (rowCount != null && needPercentage(ind)) {
        ind.setCount(rowCount.getCount());
      }
      if (nullCount != null) {
        ind.setNullCount(nullCount.getNullCount());
      }
    }
  }
}
Program: 137950
Project: 137950
Buggy source:
/** 
 * DOC xqliu Comment method "setRowCountAndNullCount".
 * @param elementToIndicator
 */
protected void setRowCountAndNullCount(Map<ModelElement,List<Indicator>> elementToIndicator){
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "setRowCountAndNullCount".
 * @param elementToIndicator
 */
protected void setRowCountAndNullCount(Map<ModelElement,List<Indicator>> elementToIndicator){
  Set<ModelElement> analyzedElements=elementToIndicator.keySet();
  for (  ModelElement modelElement : analyzedElements) {
    RowCountIndicator rowCount=IndicatorHelper.getRowCountIndicator(modelElement,elementToIndicator);
    NullCountIndicator nullCount=IndicatorHelper.getNullCountIndicator(modelElement,elementToIndicator);
    List<Indicator> list=elementToIndicator.get(modelElement);
    for (    Indicator ind : list) {
      if (rowCount != null && needPercentage(ind)) {
        ind.setCount(rowCount.getCount());
      }
      if (nullCount != null) {
        ind.setNullCount(nullCount.getNullCount());
      }
    }
  }
}
Program: 137951
Project: 137951
Buggy source:
@Override public void handle(Object object,String[] rowValues){
  if (duplicateMap.containsKey(object)) {
    duplicateMap.get(object).add(rowValues);
  }
 else {
    List<Object[]> temp=new ArrayList<Object[]>();
    temp.add(rowValues);
    duplicateMap.put(object,temp);
  }
}

Fixed version (ground truth):
@Override public void handle(Object object,String[] rowValues){
  super.handle(object);
  if (duplicateMap.containsKey(object)) {
    duplicateMap.get(object).add(rowValues);
  }
 else {
    List<Object[]> temp=new ArrayList<Object[]>();
    temp.add(rowValues);
    duplicateMap.put(object,temp);
  }
}
Program: 137952
Project: 137952
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void setDuplicateValueCount(Long newDuplicateValueCount){
  Long oldDuplicateValueCount=duplicateValueCount;
  duplicateValueCount=newDuplicateValueCount;
  if (eNotificationRequired())   eNotify(new ENotificationImpl(this,Notification.SET,IndicatorsPackage.DUPLICATE_COUNT_INDICATOR__DUPLICATE_VALUE_COUNT,oldDuplicateValueCount,duplicateValueCount));
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override public void setDuplicateValueCount(Long newDuplicateValueCount){
  Long oldDuplicateValueCount=duplicateValueCount;
  duplicateValueCount=newDuplicateValueCount;
  if (eNotificationRequired()) {
    eNotify(new ENotificationImpl(this,Notification.SET,IndicatorsPackage.DUPLICATE_COUNT_INDICATOR__DUPLICATE_VALUE_COUNT,oldDuplicateValueCount,duplicateValueCount));
  }
}
Program: 137953
Project: 137953
Buggy source:
/** 
 * if these items in recycle bin are depended by others which is not in recycle bin,show a warning and return.
 * @param allNodes
 * @return
 */
public static boolean canEmptyRecyBin(List<IRepositoryNode> allNodes){
  for (  IRepositoryNode node : allNodes) {
    List<ModelElement> dependencies=EObjectHelper.getDependencyClients(node);
    if (dependencies == null || dependencies.isEmpty()) {
      continue;
    }
    for (    ModelElement mod : dependencies) {
      Property property=PropertyHelper.getProperty(mod);
      if (property == null) {
        continue;
      }
      Item item=property.getItem();
      if (item != null && !item.getState().isDeleted()) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * if these items in recycle bin are depended by others which is not in recycle bin,show a warning and return.
 * @param allNodes
 * @return
 */
public static boolean canEmptyRecyBin(List<IRepositoryNode> allNodes){
  if (allNodes == null) {
    return false;
  }
  for (  IRepositoryNode node : allNodes) {
    List<ModelElement> dependencies=EObjectHelper.getDependencyClients(node);
    if (dependencies == null || dependencies.isEmpty()) {
      continue;
    }
    for (    ModelElement mod : dependencies) {
      Property property=PropertyHelper.getProperty(mod);
      if (property == null) {
        continue;
      }
      Item item=property.getItem();
      if (item != null && !item.getState().isDeleted()) {
        return false;
      }
    }
  }
  return true;
}
Program: 137954
Project: 137954
Buggy source:
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(IFolder parentFolder,String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    File oldFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault(parentFolder,newFolderName) + File.separator + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        replaceReportGenDocFilePath(file,oldFolder.toString(),newFolder.toString());
      }
      parentFolder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param parentFolder
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(IFolder parentFolder,String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    File oldFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault(parentFolder,newFolderName) + File.separator + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        replaceReportGenDocFilePath(file,oldFolder.toString(),newFolder.toString());
      }
      parentFolder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}
Program: 137955
Project: 137955
Buggy source:
/** 
 * get the link files which link to the Report Generated Doc File.
 * @param file Report file
 * @return
 */
public static List<IFile> getRepDocLinkFiles(IFile file){
  List<IFile> linkFiles=new ArrayList<IFile>();
  try {
    IResource[] reportListFiles=ReportUtils.getReportListFiles(file);
    for (    IResource res : reportListFiles) {
      IFile linkFile=ResourceManager.getRoot().getFile(res.getFullPath());
      if (linkFile.exists() && linkFile.isLinked()) {
        linkFiles.add(linkFile);
      }
    }
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return linkFiles;
}

Fixed version (ground truth):
/** 
 * get the link files which link to the Report Generated Doc File.
 * @param file Report file
 * @return
 */
public static List<IFile> getRepDocLinkFiles(IFile file){
  List<IFile> linkFiles=new ArrayList<IFile>();
  if (file != null) {
    try {
      IResource[] reportListFiles=ReportUtils.getReportListFiles(file);
      for (      IResource res : reportListFiles) {
        IFile linkFile=ResourceManager.getRoot().getFile(res.getFullPath());
        if (linkFile.exists() && linkFile.isLinked()) {
          linkFiles.add(linkFile);
        }
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return linkFiles;
}
Program: 137956
Project: 137956
Buggy source:
private void closeEditorIfOpened(IRepositoryNode fileNode){
  IWorkbenchPage activePage=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
  IEditorReference[] editorReferences=activePage.getEditorReferences();
  for (  IEditorReference reference : editorReferences) {
    try {
      IEditorInput editorInput=reference.getEditorInput();
      if (editorInput instanceof AbstractItemEditorInput) {
        AbstractItemEditorInput fileInput=(AbstractItemEditorInput)editorInput;
        if (fileNode.getObject().getLabel().equals(fileInput.getItem().getProperty().getLabel())) {
          activePage.closeEditor(reference.getEditor(false),false);
          break;
        }
      }
    }
 catch (    PartInitException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void closeEditorIfOpened(IRepositoryNode fileNode){
  if (CorePlugin.getDefault() != null && CorePlugin.getDefault().getWorkbench() != null && CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow() != null) {
    IWorkbenchPage activePage=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (activePage != null) {
      IEditorReference[] editorReferences=activePage.getEditorReferences();
      if (editorReferences != null) {
        for (        IEditorReference reference : editorReferences) {
          try {
            IEditorInput editorInput=reference.getEditorInput();
            if (editorInput instanceof AbstractItemEditorInput) {
              AbstractItemEditorInput fileInput=(AbstractItemEditorInput)editorInput;
              if (fileNode.getObject().getLabel().equals(fileInput.getItem().getProperty().getLabel())) {
                activePage.closeEditor(reference.getEditor(false),false);
                break;
              }
            }
          }
 catch (          PartInitException e) {
            e.printStackTrace();
          }
        }
      }
    }
  }
}
Program: 137959
Project: 137959
Buggy source:
public void keyPressed(KeyEvent e){
  SQLTextEditor.this.editor.getEditorSite().getPage().activate(SQLTextEditor.this.editor.getEditorSite().getPart());
}

Fixed version (ground truth):
@Override public void keyPressed(KeyEvent e){
  SQLTextEditor.this.editor.getEditorSite().getPage().activate(SQLTextEditor.this.editor.getEditorSite().getPart());
}
Program: 137960
Project: 137960
Buggy source:
protected void createActions(){
  super.createActions();
  if (!_enableContentAssist) {
    return;
  }
  Action action=new Action("String_Node_Str"){
    public void run(){
      sqlTextViewer.showAssistance();
    }
  }
;
  action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",action);
}

Fixed version (ground truth):
@Override protected void createActions(){
  super.createActions();
  if (!_enableContentAssist) {
    return;
  }
  Action action=new Action("String_Node_Str"){
    @Override public void run(){
      sqlTextViewer.showAssistance();
    }
  }
;
  action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",action);
}
Program: 137961
Project: 137961
Buggy source:
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null)   editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
    public void run(){
      if (sqlTextViewer != null) {
        sqlTextViewer.setNewDictionary(dictionary);
      }
    }
  }
);
}

Fixed version (ground truth):
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null) {
    editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
      public void run(){
        if (sqlTextViewer != null) {
          sqlTextViewer.setNewDictionary(dictionary);
        }
      }
    }
);
  }
}
Program: 137963
Project: 137963
Buggy source:
public void dispose(){
  if (partListener != null)   editor.getEditorSite().getPage().removePartListener(partListener);
  mcl.uninstall();
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (partListener != null) {
    editor.getEditorSite().getPage().removePartListener(partListener);
  }
  mcl.uninstall();
  super.dispose();
}
Program: 137964
Project: 137964
Buggy source:
public void createPartControl(Composite parent){
  super.createPartControl(parent);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(),SQLExplorerPlugin.PLUGIN_ID + "String_Node_Str");
  Object adapter=getAdapter(org.eclipse.swt.widgets.Control.class);
  if (adapter instanceof StyledText) {
    StyledText text=(StyledText)adapter;
    text.setWordWrap(SQLExplorerPlugin.getDefault().getPluginPreferences().getBoolean(IConstants.WORD_WRAP));
    FontData[] fData=PreferenceConverter.getFontDataArray(store,IConstants.FONT);
    if (fData.length > 0) {
      JFaceResources.getFontRegistry().put(fData[0].toString(),fData);
      text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString()));
    }
  }
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(),SQLExplorerPlugin.PLUGIN_ID + "String_Node_Str");
  Object adapter=getAdapter(org.eclipse.swt.widgets.Control.class);
  if (adapter instanceof StyledText) {
    StyledText text=(StyledText)adapter;
    text.setWordWrap(SQLExplorerPlugin.getDefault().getPluginPreferences().getBoolean(IConstants.WORD_WRAP));
    FontData[] fData=PreferenceConverter.getFontDataArray(store,IConstants.FONT);
    if (fData.length > 0) {
      JFaceResources.getFontRegistry().put(fData[0].toString(),fData);
      text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString()));
    }
  }
}
Program: 137966
Project: 137966
Buggy source:
public void keyPressed(KeyEvent e){
  SQLTextEditor.this.editor.getEditorSite().getPage().activate(SQLTextEditor.this.editor.getEditorSite().getPart());
}

Fixed version (ground truth):
@Override public void keyPressed(KeyEvent e){
  SQLTextEditor.this.editor.getEditorSite().getPage().activate(SQLTextEditor.this.editor.getEditorSite().getPart());
}
Program: 137967
Project: 137967
Buggy source:
protected void createActions(){
  super.createActions();
  if (!_enableContentAssist) {
    return;
  }
  Action action=new Action("String_Node_Str"){
    public void run(){
      sqlTextViewer.showAssistance();
    }
  }
;
  action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",action);
}

Fixed version (ground truth):
@Override protected void createActions(){
  super.createActions();
  if (!_enableContentAssist) {
    return;
  }
  Action action=new Action("String_Node_Str"){
    @Override public void run(){
      sqlTextViewer.showAssistance();
    }
  }
;
  action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",action);
}
Program: 137968
Project: 137968
Buggy source:
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null)   editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
    public void run(){
      if (sqlTextViewer != null) {
        sqlTextViewer.setNewDictionary(dictionary);
      }
    }
  }
);
}

Fixed version (ground truth):
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null) {
    editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
      public void run(){
        if (sqlTextViewer != null) {
          sqlTextViewer.setNewDictionary(dictionary);
        }
      }
    }
);
  }
}
Program: 137970
Project: 137970
Buggy source:
public void dispose(){
  if (partListener != null)   editor.getEditorSite().getPage().removePartListener(partListener);
  mcl.uninstall();
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (partListener != null) {
    editor.getEditorSite().getPage().removePartListener(partListener);
  }
  mcl.uninstall();
  super.dispose();
}
Program: 137971
Project: 137971
Buggy source:
public void createPartControl(Composite parent){
  super.createPartControl(parent);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(),SQLExplorerPlugin.PLUGIN_ID + "String_Node_Str");
  Object adapter=getAdapter(org.eclipse.swt.widgets.Control.class);
  if (adapter instanceof StyledText) {
    StyledText text=(StyledText)adapter;
    text.setWordWrap(SQLExplorerPlugin.getDefault().getPluginPreferences().getBoolean(IConstants.WORD_WRAP));
    FontData[] fData=PreferenceConverter.getFontDataArray(store,IConstants.FONT);
    if (fData.length > 0) {
      JFaceResources.getFontRegistry().put(fData[0].toString(),fData);
      text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString()));
    }
  }
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(),SQLExplorerPlugin.PLUGIN_ID + "String_Node_Str");
  Object adapter=getAdapter(org.eclipse.swt.widgets.Control.class);
  if (adapter instanceof StyledText) {
    StyledText text=(StyledText)adapter;
    text.setWordWrap(SQLExplorerPlugin.getDefault().getPluginPreferences().getBoolean(IConstants.WORD_WRAP));
    FontData[] fData=PreferenceConverter.getFontDataArray(store,IConstants.FONT);
    if (fData.length > 0) {
      JFaceResources.getFontRegistry().put(fData[0].toString(),fData);
      text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString()));
    }
  }
}
Program: 137973
Project: 137973
Buggy source:
public void keyPressed(KeyEvent e){
  SQLTextEditor.this.editor.getEditorSite().getPage().activate(SQLTextEditor.this.editor.getEditorSite().getPart());
}

Fixed version (ground truth):
@Override public void keyPressed(KeyEvent e){
  SQLTextEditor.this.editor.getEditorSite().getPage().activate(SQLTextEditor.this.editor.getEditorSite().getPart());
}
Program: 137974
Project: 137974
Buggy source:
protected void createActions(){
  super.createActions();
  if (!_enableContentAssist) {
    return;
  }
  Action action=new Action("String_Node_Str"){
    public void run(){
      sqlTextViewer.showAssistance();
    }
  }
;
  action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",action);
}

Fixed version (ground truth):
@Override protected void createActions(){
  super.createActions();
  if (!_enableContentAssist) {
    return;
  }
  Action action=new Action("String_Node_Str"){
    @Override public void run(){
      sqlTextViewer.showAssistance();
    }
  }
;
  action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
  setAction("String_Node_Str",action);
}
Program: 137975
Project: 137975
Buggy source:
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null)   editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
    public void run(){
      if (sqlTextViewer != null) {
        sqlTextViewer.setNewDictionary(dictionary);
      }
    }
  }
);
}

Fixed version (ground truth):
public void setNewDictionary(final Dictionary dictionary){
  if (editor.getSite() != null && editor.getSite().getShell() != null && editor.getSite().getShell().getDisplay() != null) {
    editor.getSite().getShell().getDisplay().asyncExec(new Runnable(){
      public void run(){
        if (sqlTextViewer != null) {
          sqlTextViewer.setNewDictionary(dictionary);
        }
      }
    }
);
  }
}
Program: 137977
Project: 137977
Buggy source:
public void dispose(){
  if (partListener != null)   editor.getEditorSite().getPage().removePartListener(partListener);
  mcl.uninstall();
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (partListener != null) {
    editor.getEditorSite().getPage().removePartListener(partListener);
  }
  mcl.uninstall();
  super.dispose();
}
Program: 137978
Project: 137978
Buggy source:
public void createPartControl(Composite parent){
  super.createPartControl(parent);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(),SQLExplorerPlugin.PLUGIN_ID + "String_Node_Str");
  Object adapter=getAdapter(org.eclipse.swt.widgets.Control.class);
  if (adapter instanceof StyledText) {
    StyledText text=(StyledText)adapter;
    text.setWordWrap(SQLExplorerPlugin.getDefault().getPluginPreferences().getBoolean(IConstants.WORD_WRAP));
    FontData[] fData=PreferenceConverter.getFontDataArray(store,IConstants.FONT);
    if (fData.length > 0) {
      JFaceResources.getFontRegistry().put(fData[0].toString(),fData);
      text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString()));
    }
  }
}

Fixed version (ground truth):
@Override public void createPartControl(Composite parent){
  super.createPartControl(parent);
  PlatformUI.getWorkbench().getHelpSystem().setHelp(getSourceViewer().getTextWidget(),SQLExplorerPlugin.PLUGIN_ID + "String_Node_Str");
  Object adapter=getAdapter(org.eclipse.swt.widgets.Control.class);
  if (adapter instanceof StyledText) {
    StyledText text=(StyledText)adapter;
    text.setWordWrap(SQLExplorerPlugin.getDefault().getPluginPreferences().getBoolean(IConstants.WORD_WRAP));
    FontData[] fData=PreferenceConverter.getFontDataArray(store,IConstants.FONT);
    if (fData.length > 0) {
      JFaceResources.getFontRegistry().put(fData[0].toString(),fData);
      text.setFont(JFaceResources.getFontRegistry().get(fData[0].toString()));
    }
  }
}
Program: 137980
Project: 137980
Buggy source:
/** 
 * update the file .report.list to deal with the report generated doc folder's movement.
 * @param outputFolder source folder, the original report generated doc folder
 * @param targetFolder target folder, the new folder which source folder moved into
 */
public static void updateReportListFile(IFolder outputFolder,IFolder targetFolder){
  try {
    File oldFolder=WorkspaceUtils.ifolderToFile(outputFolder);
    File newFolder=WorkspaceUtils.ifolderToFile(targetFolder.getFolder(outputFolder.getName()));
    File file=new File(newFolder.getAbsolutePath() + File.separator + ReportUtils.REPORT_LIST);
    if (file.exists() && file.isFile()) {
      String str1=oldFolder.toString();
      String str2=newFolder.toString();
      str1=StringUtils.replace(str1,"String_Node_Str","String_Node_Str");
      str2=StringUtils.replace(str2,"String_Node_Str","String_Node_Str");
      FilesUtils.replaceInFile(str1,file.toString(),str2);
    }
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
}

Fixed version (ground truth):
/** 
 * update the file .report.list to deal with the report generated doc folder's movement.
 * @param outputFolder source folder, the original report generated doc folder
 * @param targetFolder target folder, the new folder which source folder moved into
 */
public static void updateReportListFile(IFolder outputFolder,IFolder targetFolder){
  try {
    File oldFolder=WorkspaceUtils.ifolderToFile(outputFolder);
    File newFolder=WorkspaceUtils.ifolderToFile(targetFolder.getFolder(outputFolder.getName()));
    File file=new File(newFolder.getAbsolutePath() + File.separator + ReportUtils.REPORT_LIST);
    if (file.exists() && file.isFile()) {
      replaceReportGenDocFilePath(file,oldFolder.toString(),newFolder.toString());
    }
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
}
Program: 137981
Project: 137981
Buggy source:
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    IContainer repItemParent=PropertyHelper.getItemFile(repItem.getProperty()).getParent();
    File oldFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault((IFolder)repItemParent,newFolderName) + File.separator + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        FilesUtils.replaceInFile(oldFolder.toString(),file.toString(),newFolder.toString());
      }
      repItemParent.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(IFolder parentFolder,String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    File oldFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault(parentFolder,newFolderName) + File.separator + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        replaceReportGenDocFilePath(file,oldFolder.toString(),newFolder.toString());
      }
      parentFolder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}
Program: 137982
Project: 137982
Buggy source:
public static IFolder fileToIFolder(File file){
  IFolder folder=null;
  String filePath=file.getAbsolutePath();
  String rootPath=ResourcesPlugin.getWorkspace().getRoot().getLocationURI().getPath();
  if (filePath.startsWith(rootPath)) {
    folder=ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(filePath.substring(rootPath.length(),filePath.length())));
  }
  return folder;
}

Fixed version (ground truth):
public static IFolder fileToIFolder(File file){
  IFolder folder=null;
  String filePath=file.getAbsolutePath();
  String rootPath=ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
  if (filePath.startsWith(rootPath)) {
    folder=ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(filePath.substring(rootPath.length(),filePath.length())));
  }
  return folder;
}
Program: 137983
Project: 137983
Buggy source:
/** 
 * update the file .report.list to deal with the report generated doc folder's movement.
 * @param outputFolder source folder, the original report generated doc folder
 * @param targetFolder target folder, the new folder which source folder moved into
 */
public static void updateReportListFile(IFolder outputFolder,IFolder targetFolder){
  try {
    File oldFolder=WorkspaceUtils.ifolderToFile(outputFolder);
    File newFolder=WorkspaceUtils.ifolderToFile(targetFolder.getFolder(outputFolder.getName()));
    File file=new File(newFolder.getAbsolutePath() + IPath.SEPARATOR + ReportUtils.REPORT_LIST);
    if (file.exists() && file.isFile()) {
      FilesUtils.replaceInFile(oldFolder.toString(),file.toString(),newFolder.toString());
    }
  }
 catch (  IOException e) {
    log.warn(e,e);
  }
}

Fixed version (ground truth):
/** 
 * update the file .report.list to deal with the report generated doc folder's movement.
 * @param outputFolder source folder, the original report generated doc folder
 * @param targetFolder target folder, the new folder which source folder moved into
 */
public static void updateReportListFile(IFolder outputFolder,IFolder targetFolder){
  try {
    File oldFolder=WorkspaceUtils.ifolderToFile(outputFolder);
    File newFolder=WorkspaceUtils.ifolderToFile(targetFolder.getFolder(outputFolder.getName()));
    File file=new File(newFolder.getAbsolutePath() + File.separator + ReportUtils.REPORT_LIST);
    if (file.exists() && file.isFile()) {
      String str1=oldFolder.toString();
      String str2=newFolder.toString();
      str1=StringUtils.replace(str1,"String_Node_Str","String_Node_Str");
      str2=StringUtils.replace(str2,"String_Node_Str","String_Node_Str");
      FilesUtils.replaceInFile(str1,file.toString(),str2);
    }
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
}
Program: 137984
Project: 137984
Buggy source:
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    IContainer repItemParent=PropertyHelper.getItemFile(repItem.getProperty()).getParent();
    File oldFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault((IFolder)repItemParent,newFolderName) + IPath.SEPARATOR + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        FilesUtils.replaceInFile(oldFolder.toString(),file.toString(),newFolder.toString());
      }
      repItemParent.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    IContainer repItemParent=PropertyHelper.getItemFile(repItem.getProperty()).getParent();
    File oldFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault((IFolder)repItemParent,newFolderName) + File.separator + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        FilesUtils.replaceInFile(oldFolder.toString(),file.toString(),newFolder.toString());
      }
      repItemParent.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}
Program: 137985
Project: 137985
Buggy source:
/** 
 * DOC xqliu Comment method "getOriginalOutoutFolderPath".
 * @param srcFolder
 * @param file
 * @param tempFolderName
 * @return
 */
public static String getOriginalOutoutFolderPath(File srcFolder,File file,String tempFolderName){
  String path=srcFolder.getAbsolutePath() + IPath.SEPARATOR + file.getName();
  int indexOf=path.indexOf(tempFolderName);
  if (indexOf > 0) {
    path=path.substring(0,indexOf) + path.substring(indexOf + tempFolderName.length() + 1,path.length());
  }
  return path;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getOriginalOutoutFolderPath".
 * @param srcFolder
 * @param file
 * @param tempFolderName
 * @return
 */
public static String getOriginalOutoutFolderPath(File srcFolder,File file,String tempFolderName){
  String path=srcFolder.getAbsolutePath() + File.separator + file.getName();
  int indexOf=path.indexOf(tempFolderName);
  if (indexOf > 0) {
    path=path.substring(0,indexOf) + path.substring(indexOf + tempFolderName.length() + 1,path.length());
  }
  return path;
}
Program: 137986
Project: 137986
Buggy source:
/** 
 * DOC xqliu Comment method "getReportListFile".
 * @param reportFile
 * @return
 * @throws IOException
 */
public static File getReportListFile(IFile reportFile) throws IOException {
  String reportFileName=reportFile.getName();
  String simpleName=getSimpleName(reportFileName);
  File file=new File(ReportHelper.getOutputFolderNameDefault((IFolder)reportFile.getParent(),simpleName) + "String_Node_Str" + REPORT_LIST);
  if (!file.exists()) {
    File parentFile=file.getParentFile();
    if (parentFile != null) {
      if (!parentFile.exists()) {
        if (parentFile.mkdirs()) {
          file.createNewFile();
        }
      }
 else {
        file.createNewFile();
      }
    }
  }
  return file;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "getReportListFile".
 * @param reportFile
 * @return
 * @throws IOException
 */
public static File getReportListFile(IFile reportFile) throws IOException {
  String reportFileName=reportFile.getName();
  String simpleName=getSimpleName(reportFileName);
  File file=new File(ReportHelper.getOutputFolderNameDefault((IFolder)reportFile.getParent(),simpleName) + File.separator + REPORT_LIST);
  if (!file.exists()) {
    File parentFile=file.getParentFile();
    if (parentFile != null) {
      if (!parentFile.exists()) {
        if (parentFile.mkdirs()) {
          file.createNewFile();
        }
      }
 else {
        file.createNewFile();
      }
    }
  }
  return file;
}
Program: 137987
Project: 137987
Buggy source:
/** 
 * DOC xqliu Comment method "copyAndUpdateRepGenDocFileInfo".
 * @param newFolder
 * @param tempFolder
 * @param subFolderName
 */
public static void copyAndUpdateRepGenDocFileInfo(IFolder newFolder,File tempFolder,String subFolderName){
  File srcFolder=new File(tempFolder.getAbsolutePath() + IPath.SEPARATOR + subFolderName);
  File tarFolder=WorkspaceUtils.ifolderToFile(newFolder);
  moveHiddenFolders(srcFolder,tarFolder);
  updateReportListFileInfo(srcFolder,tarFolder,tempFolder.getName());
  FilesUtils.deleteFile(tempFolder,Boolean.TRUE);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "copyAndUpdateRepGenDocFileInfo".
 * @param newFolder
 * @param tempFolder
 * @param subFolderName
 */
public static void copyAndUpdateRepGenDocFileInfo(IFolder newFolder,File tempFolder,String subFolderName){
  File srcFolder=new File(tempFolder.getAbsolutePath() + File.separator + subFolderName);
  File tarFolder=WorkspaceUtils.ifolderToFile(newFolder);
  moveHiddenFolders(srcFolder,tarFolder);
  updateReportListFileInfo(srcFolder,tarFolder,tempFolder.getName());
  FilesUtils.deleteFile(tempFolder,Boolean.TRUE);
}
Program: 137988
Project: 137988
Buggy source:
/** 
 */
public static void initRepListFile(IFile reportFile) throws Exception {
  String reportFileName=reportFile.getName();
  String simpleName=getSimpleName(reportFileName);
  if (simpleName == null) {
    return;
  }
  IFolder reportFileFolder=((IFolder)reportFile.getParent()).getFolder(PluginConstant.DOT_STRING + simpleName);
  if (reportFileFolder != null && reportFileFolder.exists()) {
    File repListFile=new File(ReportHelper.getOutputFolderNameDefault((IFolder)reportFile.getParent(),simpleName) + "String_Node_Str" + REPORT_LIST);
    List<ReportListParameters> repList=new ArrayList<ReportListParameters>();
    IResource[] members=reportFileFolder.members();
    for (    IResource res : members) {
      if (res.getType() == IResource.FILE) {
        IFile repFile=(IFile)res;
        repList.add(buildRepListParams(repFile.getName(),repFile.getRawLocation().toOSString(),String.valueOf(repFile.getModificationStamp())));
      }
    }
    saveReportListFile(repListFile,repList);
  }
}

Fixed version (ground truth):
/** 
 */
public static void initRepListFile(IFile reportFile) throws Exception {
  String reportFileName=reportFile.getName();
  String simpleName=getSimpleName(reportFileName);
  if (simpleName == null) {
    return;
  }
  IFolder reportFileFolder=((IFolder)reportFile.getParent()).getFolder(PluginConstant.DOT_STRING + simpleName);
  if (reportFileFolder != null && reportFileFolder.exists()) {
    File repListFile=new File(ReportHelper.getOutputFolderNameDefault((IFolder)reportFile.getParent(),simpleName) + File.separator + REPORT_LIST);
    List<ReportListParameters> repList=new ArrayList<ReportListParameters>();
    IResource[] members=reportFileFolder.members();
    for (    IResource res : members) {
      if (res.getType() == IResource.FILE) {
        IFile repFile=(IFile)res;
        repList.add(buildRepListParams(repFile.getName(),repFile.getRawLocation().toOSString(),String.valueOf(repFile.getModificationStamp())));
      }
    }
    saveReportListFile(repListFile,repList);
  }
}
Program: 137989
Project: 137989
Buggy source:
/** 
 * update the file .report.list to deal with the report generated doc folder's movement.
 * @param outputFolder source folder, the original report generated doc folder
 * @param targetFolder target folder, the new folder which source folder moved into
 */
public static void updateReportListFile(IFolder outputFolder,IFolder targetFolder){
  try {
    File oldFolder=WorkspaceUtils.ifolderToFile(outputFolder);
    File newFolder=WorkspaceUtils.ifolderToFile(targetFolder.getFolder(outputFolder.getName()));
    File file=new File(newFolder.getAbsolutePath() + File.separator + ReportUtils.REPORT_LIST);
    if (file.exists() && file.isFile()) {
      String str1=oldFolder.toString();
      String str2=newFolder.toString();
      str1=StringUtils.replace(str1,"String_Node_Str","String_Node_Str");
      str2=StringUtils.replace(str2,"String_Node_Str","String_Node_Str");
      FilesUtils.replaceInFile(str1,file.toString(),str2);
    }
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
}

Fixed version (ground truth):
/** 
 * update the file .report.list to deal with the report generated doc folder's movement.
 * @param outputFolder source folder, the original report generated doc folder
 * @param targetFolder target folder, the new folder which source folder moved into
 */
public static void updateReportListFile(IFolder outputFolder,IFolder targetFolder){
  try {
    File oldFolder=WorkspaceUtils.ifolderToFile(outputFolder);
    File newFolder=WorkspaceUtils.ifolderToFile(targetFolder.getFolder(outputFolder.getName()));
    File file=new File(newFolder.getAbsolutePath() + File.separator + ReportUtils.REPORT_LIST);
    if (file.exists() && file.isFile()) {
      replaceReportGenDocFilePath(file,oldFolder.toString(),newFolder.toString());
    }
  }
 catch (  Exception e) {
    log.warn(e,e);
  }
}
Program: 137990
Project: 137990
Buggy source:
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    IContainer repItemParent=PropertyHelper.getItemFile(repItem.getProperty()).getParent();
    File oldFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(repItemParent.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault((IFolder)repItemParent,newFolderName) + File.separator + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        FilesUtils.replaceInFile(oldFolder.toString(),file.toString(),newFolder.toString());
      }
      repItemParent.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * if the report's name changed, need to update the report folder name also.
 * @param parentFolder
 * @param oldFolderName
 * @param repItem
 */
public static void checkAndUpdateRepFolderName4Rename(IFolder parentFolder,String oldFolderName,TDQReportItem repItem){
  String newFolderName=ReportUtils.getSimpleName(repItem.getProperty());
  if (!oldFolderName.equals(newFolderName)) {
    File oldFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + oldFolderName)));
    File newFolder=WorkspaceUtils.ifolderToFile(parentFolder.getFolder(Path.fromPortableString(PluginConstant.DOT_STRING + newFolderName)));
    try {
      oldFolder.renameTo(newFolder);
      File file=new File(ReportHelper.getOutputFolderNameDefault(parentFolder,newFolderName) + File.separator + REPORT_LIST);
      if (file.exists() && file.isFile()) {
        replaceReportGenDocFilePath(file,oldFolder.toString(),newFolder.toString());
      }
      parentFolder.refreshLocal(IResource.DEPTH_INFINITE,null);
    }
 catch (    Exception e) {
      log.warn(e,e);
    }
  }
}
Program: 137991
Project: 137991
Buggy source:
public static IFolder fileToIFolder(File file){
  IFolder folder=null;
  String filePath=file.getAbsolutePath();
  String rootPath=ResourcesPlugin.getWorkspace().getRoot().getLocationURI().getPath();
  if (filePath.startsWith(rootPath)) {
    folder=ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(filePath.substring(rootPath.length(),filePath.length())));
  }
  return folder;
}

Fixed version (ground truth):
public static IFolder fileToIFolder(File file){
  IFolder folder=null;
  String filePath=file.getAbsolutePath();
  String rootPath=ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
  if (filePath.startsWith(rootPath)) {
    folder=ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(filePath.substring(rootPath.length(),filePath.length())));
  }
  return folder;
}
Program: 137992
Project: 137992
Buggy source:
/** 
 * if the DriverClassName is empty or Jar File Path is invalid return false.
 * @param dbConn a General JDBC database connection
 * @return
 */
public static ReturnCode checkGeneralJdbcJarFilePathDriverClassName(DatabaseConnection dbConn){
  ReturnCode returnCode=new ReturnCode();
  String driverClass=dbConn.getDriverClass();
  String driverJarPath=dbConn.getDriverJarPath();
  if (driverClass == null || driverClass.trim().equals("String_Node_Str")) {
    returnCode.setOk(false);
    returnCode.setMessage(Messages.getString("String_Node_Str"));
  }
 else {
    if (driverJarPath == null || driverJarPath.trim().equals("String_Node_Str")) {
      returnCode.setOk(false);
      returnCode.setMessage(Messages.getString("String_Node_Str"));
    }
 else {
      File jarFile=new File(driverJarPath);
      if (!jarFile.exists() || jarFile.isDirectory()) {
        returnCode.setOk(false);
        returnCode.setMessage(Messages.getString("String_Node_Str"));
      }
    }
  }
  return returnCode;
}

Fixed version (ground truth):
/** 
 * if the DriverClassName is empty or Jar File Path is invalid return false.
 * @param dbConn a General JDBC database connection
 * @return
 */
public static ReturnCode checkGeneralJdbcJarFilePathDriverClassName(DatabaseConnection dbConn){
  ReturnCode returnCode=new ReturnCode();
  String driverClass=dbConn.getDriverClass();
  String driverJarPath=dbConn.getDriverJarPath();
  if (driverClass == null || driverClass.trim().equals("String_Node_Str")) {
    returnCode.setOk(false);
    returnCode.setMessage(Messages.getString("String_Node_Str"));
  }
 else {
    if (driverJarPath == null || driverJarPath.trim().equals("String_Node_Str")) {
      returnCode.setOk(false);
      returnCode.setMessage(Messages.getString("String_Node_Str"));
    }
 else {
      String[] splits=driverJarPath.split("String_Node_Str");
      for (      String str : splits) {
        if (str != null && str.trim().length() > 0) {
          File jarFile=new File(str);
          if (!jarFile.exists() || jarFile.isDirectory()) {
            returnCode.setOk(false);
            returnCode.setMessage(Messages.getString("String_Node_Str"));
            break;
          }
        }
      }
    }
  }
  return returnCode;
}