nus-yam/ex-repair huggingface dataset:
Program: 126066
Project: 126066
Buggy source:
private void showStarting(){
  try {
    IBrandingService service=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    String startingBrowserId=service.getStartingBrowserId();
    if (startingBrowserId == null || startingBrowserId.isEmpty()) {
      return;
    }
    StartingHelper.getHelper().getHtmlContent();
    IWorkbenchPage activePage=getWindowConfigurer().getWindow().getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (activePage != null) {
      if (activePage.getPerspective().getId().equals("String_Node_Str")) {
        startingBrowser=activePage.openEditor(new StartingEditorInput(service),startingBrowserId);
      }
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
private void showStarting(){
  try {
    IBrandingService service=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    String startingBrowserId=service.getStartingBrowserId();
    if (startingBrowserId == null || startingBrowserId.isEmpty()) {
      return;
    }
    StartingHelper.getHelper().getHtmlContent();
    IWorkbenchPage activePage=getWindowConfigurer().getWindow().getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (activePage != null) {
      if (activePage.getPerspective().getId().equals(ProductUtils.PERSPECTIVE_DI_ID)) {
        startingBrowser=activePage.openEditor(new StartingEditorInput(service),startingBrowserId);
      }
    }
  }
 catch (  Exception e) {
  }
}
Program: 126067
Project: 126067
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final Project other=(Project)obj;
  if (this.project == null) {
    if (other.project != null) {
      return false;
    }
  }
 else   if (!this.project.equals(other.project)) {
    if (this.project.getTechnicalLabel().equals(project.getTechnicalLabel()))     return true;
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final Project other=(Project)obj;
  if (this.project == null) {
    if (other.project != null) {
      return false;
    }
  }
 else   if (!this.project.equals(other.project)) {
    if (this.project.getTechnicalLabel().equals(other.project.getTechnicalLabel()))     return true;
    return false;
  }
  return true;
}
Program: 126068
Project: 126068
Buggy source:
@Override public boolean doSupportHive1(){
  return true;
}

Fixed version (ground truth):
@Override public boolean doSupportHive1(){
  return false;
}
Program: 126069
Project: 126069
Buggy source:
@Override public boolean doSupportHive1(){
  return true;
}

Fixed version (ground truth):
@Override public boolean doSupportHive1(){
  return false;
}
Program: 126070
Project: 126070
Buggy source:
@Override public boolean doSupportHive1(){
  return true;
}

Fixed version (ground truth):
@Override public boolean doSupportHive1(){
  return false;
}
Program: 126071
Project: 126071
Buggy source:
public static IImage getWizardIcon(String jobType,String framework){
  if (HadoopConstants.JOBTYPEBDSTREAMING.equals(jobType)) {
    IStormProcessService stormProcessService=(IStormProcessService)GlobalServiceRegister.getDefault().getService(IStormProcessService.class);
    return stormProcessService.getStormWizardIcon(framework);
  }
 else   if (HadoopConstants.JOBTYPEBDBATCH.equals(jobType)) {
    IMRProcessService mrProcessService=(IMRProcessService)GlobalServiceRegister.getDefault().getService(IMRProcessService.class);
    return mrProcessService.getMRWizardIcon(framework);
  }
  return ECoreImage.PROCESS_WIZ;
}

Fixed version (ground truth):
public static IImage getWizardIcon(String jobType,String framework){
  if (HadoopConstants.JOBTYPEBDSTREAMING.equals(jobType)) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IStormProcessService.class)) {
      IStormProcessService stormProcessService=(IStormProcessService)GlobalServiceRegister.getDefault().getService(IStormProcessService.class);
      return stormProcessService.getStormWizardIcon(framework);
    }
  }
 else   if (HadoopConstants.JOBTYPEBDBATCH.equals(jobType)) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IMRProcessService.class)) {
      IMRProcessService mrProcessService=(IMRProcessService)GlobalServiceRegister.getDefault().getService(IMRProcessService.class);
      return mrProcessService.getMRWizardIcon(framework);
    }
  }
  return ECoreImage.PROCESS_WIZ;
}
Program: 126072
Project: 126072
Buggy source:
public void refresh(){
  getPart();
  if (part != null) {
    boolean modified=updateContextFromRepository();
    if (modified) {
      setEditorDirty(part);
    }
    IEditorInput editorInput=part.getEditorInput();
    setCompositeReadonly(editorInput);
  }
  contextComposite.setPart(part);
}

Fixed version (ground truth):
public void refresh(IWorkbenchPart editorPart){
  part=(EditorPart)editorPart;
  refreshPart();
}
Program: 126073
Project: 126073
Buggy source:
/** 
 * DOC marvin EditProcessPropertiesWizard constructor comment.
 * @param repositoryViewObject
 * @param path
 * @param useLastVersion
 */
public EditProcessPropertiesWizard(IRepositoryViewObject repositoryViewObject,IPath path,boolean useLastVersion){
  super(repositoryViewObject,path,useLastVersion);
  this.repositoryViewObject=repositoryViewObject;
  setWindowTitle(Messages.getString("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * DOC marvin EditProcessPropertiesWizard constructor comment.
 * @param repositoryViewObject
 * @param path
 * @param useLastVersion
 */
public EditProcessPropertiesWizard(IRepositoryViewObject repositoryViewObject,IPath path,boolean useLastVersion){
  super(repositoryViewObject,path,useLastVersion);
  this.repositoryViewObject=repositoryViewObject;
  setWindowTitle(Messages.getString("String_Node_Str"));
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(ECoreImage.PROCESS_WIZ));
}
Program: 126074
Project: 126074
Buggy source:
@Override public void modifyText(ModifyEvent e){
  updatePageStatus();
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent e){
  updatePageStatus();
  updateFrameworkIcon(framework.getText());
}
Program: 126075
Project: 126075
Buggy source:
@Override protected void addListeners(){
  super.addListeners();
  if (jobTypeCCombo != null) {
    jobTypeCCombo.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        ConvertJobsUtil.updateJobFrameworkPart(jobTypeCCombo.getText(),framework);
        updatePageStatus();
      }
    }
);
  }
  if (framework != null) {
    framework.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      ModifyEvent e){
        updatePageStatus();
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void addListeners(){
  super.addListeners();
  if (jobTypeCCombo != null) {
    jobTypeCCombo.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      final ModifyEvent e){
        ConvertJobsUtil.updateJobFrameworkPart(jobTypeCCombo.getText(),framework);
        updatePageStatus();
        updateFrameworkIcon(framework.getText());
      }
    }
);
  }
  if (framework != null) {
    framework.addModifyListener(new ModifyListener(){
      @Override public void modifyText(      ModifyEvent e){
        updatePageStatus();
        updateFrameworkIcon(framework.getText());
      }
    }
);
  }
}
Program: 126077
Project: 126077
Buggy source:
public static Set<ModuleNeeded> getCodesModuleNeededs(ERepositoryObjectType type){
  if (type == null) {
    return getRunningModules();
  }
  Set<ModuleNeeded> codesModules=new HashSet<ModuleNeeded>();
  codesModules.addAll(getModulesNeededForRoutines(type));
  if (type.equals(ERepositoryObjectType.ROUTINES)) {
    codesModules.addAll(collectModuleNeeded(new ArrayList<IRepositoryViewObject>(),new HashSet<String>(),true));
  }
  return codesModules;
}

Fixed version (ground truth):
public static Set<ModuleNeeded> getCodesModuleNeededs(ERepositoryObjectType type){
  if (type == null) {
    return Collections.emptySet();
  }
  Set<ModuleNeeded> codesModules=new HashSet<ModuleNeeded>();
  codesModules.addAll(getModulesNeededForRoutines(type));
  if (type.equals(ERepositoryObjectType.ROUTINES)) {
    codesModules.addAll(collectModuleNeeded(new ArrayList<IRepositoryViewObject>(),new HashSet<String>(),true));
  }
  return codesModules;
}
Program: 126079
Project: 126079
Buggy source:
private void collectHiveContextParams(){
  if (isHiveDBConnSelected()) {
    getConetxtParams().clear();
    addContextParams(EDBParamName.Login,true);
    addContextParams(EDBParamName.Server,true);
    addContextParams(EDBParamName.Port,true);
    addContextParams(EDBParamName.Database,true);
    addContextParams(EDBParamName.NameNode,useHadoopRepositoryParam());
    addContextParams(EDBParamName.JobTrackerOrResourceManager,useHadoopRepositoryParam());
    addContextParams(EDBParamName.Password,!isHiveEmbeddedMode());
    addContextParams(EDBParamName.HivePrincipal,isCurrentDbSupportAuthentication() && useKerberos.getSelection());
    addContextParams(EDBParamName.HiveMetastore,hasAuthentication());
    addContextParams(EDBParamName.HiveDriverJar,hasAuthentication());
    addContextParams(EDBParamName.HiveDriveClass,hasAuthentication());
    addContextParams(EDBParamName.HiveUserName,hasAuthentication());
    addContextParams(EDBParamName.HivePassword,hasAuthentication());
    addContextParams(EDBParamName.HiveKeyTabPrincipal,hasAuthentication() && useKeyTab.getSelection());
    addContextParams(EDBParamName.HiveKeyTab,hasAuthentication() && useKeyTab.getSelection());
  }
}

Fixed version (ground truth):
private void collectHiveContextParams(){
  if (isHiveDBConnSelected()) {
    getConetxtParams().clear();
    addContextParams(EDBParamName.Login,true);
    addContextParams(EDBParamName.Server,true);
    addContextParams(EDBParamName.Port,true);
    addContextParams(EDBParamName.Database,true);
    addContextParams(EDBParamName.NameNode,useHadoopRepositoryParam());
    addContextParams(EDBParamName.JobTrackerOrResourceManager,useHadoopRepositoryParam());
    addContextParams(EDBParamName.Password,!isHiveEmbeddedMode());
    addContextParams(EDBParamName.HivePrincipal,isCurrentDbSupportAuthentication() && useKerberos.getSelection());
    addContextParams(EDBParamName.HiveMetastore,hasAuthentication());
    addContextParams(EDBParamName.HiveDriverJar,hasAuthentication());
    addContextParams(EDBParamName.HiveDriveClass,hasAuthentication());
    addContextParams(EDBParamName.HiveUserName,hasAuthentication());
    addContextParams(EDBParamName.HivePassword,hasAuthentication());
    addContextParams(EDBParamName.HiveKeyTabPrincipal,isCurrentDbSupportAuthentication() && useKerberos.getSelection() && useKeyTab.getSelection());
    addContextParams(EDBParamName.HiveKeyTab,isCurrentDbSupportAuthentication() && useKerberos.getSelection() && useKeyTab.getSelection());
  }
}
Program: 126080
Project: 126080
Buggy source:
@SuppressWarnings("String_Node_Str") private static ClassLoader getCustomClassLoader(String index,Object customJars,boolean showDownloadIfNotExist){
  if (customJars instanceof Set) {
    return ClassLoaderFactory.getCustomClassLoader(index,(Set<String>)customJars);
  }
  return ClassLoaderFactory.getCustomClassLoader(index,String.valueOf(customJars));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static synchronized ClassLoader getCustomClassLoader(String index,Object customJars,boolean showDownloadIfNotExist){
  if (customJars instanceof Set) {
    return ClassLoaderFactory.getCustomClassLoader(index,(Set<String>)customJars);
  }
  return ClassLoaderFactory.getCustomClassLoader(index,String.valueOf(customJars));
}
Program: 126081
Project: 126081
Buggy source:
private static ClassLoader getClassLoader(String index,Object extraJars,boolean showDownloadIfNotExist){
  ClassLoader loader=null;
  if (index.startsWith(EHadoopCategory.CUSTOM.getName())) {
    loader=getCustomClassLoader(index,extraJars,showDownloadIfNotExist);
  }
 else {
    loader=ClassLoaderFactory.getClassLoader(index,showDownloadIfNotExist);
  }
  if (loader == null) {
    loader=HadoopClassLoaderFactory2.class.getClassLoader();
  }
  return loader;
}

Fixed version (ground truth):
private static synchronized ClassLoader getClassLoader(String index,Object extraJars,boolean showDownloadIfNotExist){
  ClassLoader loader=null;
  if (index.startsWith(EHadoopCategory.CUSTOM.getName())) {
    loader=getCustomClassLoader(index,extraJars,showDownloadIfNotExist);
  }
 else {
    loader=ClassLoaderFactory.getClassLoader(index,showDownloadIfNotExist);
  }
  if (loader == null) {
    loader=HadoopClassLoaderFactory2.class.getClassLoader();
  }
  return loader;
}
Program: 126082
Project: 126082
Buggy source:
private void synDuplicatedBean(Item item){
  ICodeGeneratorService codeGenService=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  if (codeGenService != null) {
    codeGenService.createCamelBeanSynchronizer().renameBeanClass(item);
    try {
      codeGenService.createCamelBeanSynchronizer().syncBean(item,true);
    }
 catch (    SystemException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private void synDuplicatedBean(Item item){
  ICodeGeneratorService codeGenService=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  if (codeGenService != null) {
    codeGenService.createCamelBeanSynchronizer().renameBeanClass(item);
    try {
      codeGenService.createCamelBeanSynchronizer().syncRoutine((RoutineItem)item,true);
    }
 catch (    SystemException e) {
      ExceptionHandler.process(e);
    }
  }
}
Program: 126083
Project: 126083
Buggy source:
private void synDuplicatedBean(Item item){
  ICodeGeneratorService codeGenService=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  if (codeGenService != null) {
    codeGenService.createCamelBeanSynchronizer().renameBeanClass(item);
    try {
      codeGenService.createCamelBeanSynchronizer().syncBean(item,true);
    }
 catch (    SystemException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
private void synDuplicatedBean(Item item){
  ICodeGeneratorService codeGenService=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  if (codeGenService != null) {
    codeGenService.createCamelBeanSynchronizer().renameBeanClass(item);
    try {
      codeGenService.createCamelBeanSynchronizer().syncRoutine((RoutineItem)item,true);
    }
 catch (    SystemException e) {
      ExceptionHandler.process(e);
    }
  }
}
Program: 126085
Project: 126085
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  IResource resource=delta.getResource();
  if (resource.getType() == IResource.ROOT) {
    return true;
  }
 else   if (resource.getType() == IResource.PROJECT) {
    try {
      if (resource.getProject().hasNature(TalendNature.ID)) {
        if (!ProjectManager.getInstance().getCurrentProject().getTechnicalLabel().equals(resource.getProject().getName())) {
          return false;
        }
        return true;
      }
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
 else   if (resource.getType() == IResource.FOLDER) {
    return false;
  }
 else   if (resource.getType() == IResource.FILE) {
    if (resource.getName().equals(RecycleBinManager.TALEND_RECYCLE_BIN_INDEX) || resource.getName().equals(FileConstants.LOCAL_PROJECT_FILENAME)) {
      if (viewer != null && viewer.getControl() != null && !viewer.getTree().isDisposed()) {
        viewer.getControl().getDisplay().asyncExec(new Runnable(){
          @Override public void run(){
            viewer.refresh(binRepositoryNode);
          }
        }
);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  IResource resource=delta.getResource();
  if (resource.getType() == IResource.ROOT) {
    return true;
  }
 else   if (resource.getType() == IResource.PROJECT) {
    if (!resource.getProject().isOpen()) {
      return false;
    }
    try {
      if (resource.getProject().hasNature(TalendNature.ID)) {
        if (!ProjectManager.getInstance().getCurrentProject().getTechnicalLabel().equals(resource.getProject().getName())) {
          return false;
        }
        return true;
      }
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
 else   if (resource.getType() == IResource.FOLDER) {
    return false;
  }
 else   if (resource.getType() == IResource.FILE) {
    if (resource.getName().equals(RecycleBinManager.TALEND_RECYCLE_BIN_INDEX) || resource.getName().equals(FileConstants.LOCAL_PROJECT_FILENAME)) {
      if (viewer != null && viewer.getControl() != null && !viewer.getTree().isDisposed()) {
        viewer.getControl().getDisplay().asyncExec(new Runnable(){
          @Override public void run(){
            viewer.refresh(binRepositoryNode);
          }
        }
);
      }
    }
  }
  return false;
}
Program: 126087
Project: 126087
Buggy source:
protected void initializeConnectionParameters(DatabaseConnection connection){
  EMap<String,String> parameters=connection.getParameters();
  if (connection.getDatabaseType() == null) {
    connection.setDatabaseType(parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE));
  }
  String productId=connection.getProductId();
  if (productId == null) {
    connection.setProductId(productId=parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_PRODUCT));
    String mapping=null;
    if (MetadataTalendType.getDefaultDbmsFromProduct(productId) != null) {
      mapping=MetadataTalendType.getDefaultDbmsFromProduct(productId).getId();
    }
    if (mapping == null) {
      mapping="String_Node_Str";
    }
    connection.setDbmsId(mapping);
  }
  if (connection.getServerName() == null) {
    connection.setServerName(parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_SERVER));
  }
  if (connection.getPort() == null) {
    connection.setPort(parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_PORT));
  }
  if (connection.getUsername() == null) {
    connection.setUsername(parameters.get(ConnParameterKeys.CONN_PARA_KEY_USERNAME));
  }
}

Fixed version (ground truth):
protected void initializeConnectionParameters(Connection conn){
  if (!(conn instanceof DatabaseConnection)) {
    return;
  }
  DatabaseConnection connection=(DatabaseConnection)conn;
  EMap<String,String> parameters=connection.getParameters();
  if (connection.getDatabaseType() == null) {
    connection.setDatabaseType(parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE));
  }
  String productId=connection.getProductId();
  if (productId == null) {
    connection.setProductId(productId=parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_PRODUCT));
    String mapping=null;
    if (MetadataTalendType.getDefaultDbmsFromProduct(productId) != null) {
      mapping=MetadataTalendType.getDefaultDbmsFromProduct(productId).getId();
    }
    if (mapping == null) {
      mapping="String_Node_Str";
    }
    connection.setDbmsId(mapping);
  }
  if (connection.getServerName() == null) {
    connection.setServerName(parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_SERVER));
  }
  if (connection.getPort() == null) {
    connection.setPort(parameters.get(ConnParameterKeys.CONN_PARA_KEY_DB_PORT));
  }
  if (connection.getUsername() == null) {
    connection.setUsername(parameters.get(ConnParameterKeys.CONN_PARA_KEY_USERNAME));
  }
}
Program: 126089
Project: 126089
Buggy source:
/** 
 * Attempts to return the default shell. If it cannot return the default shell, it returns the shell of the first workbench window that has shell.
 * @return The shell
 * @since 1.2
 */
public static Shell getDefaultShell(){
  Shell shell=null;
  try {
    shell=Display.getDefault().getActiveShell();
  }
 catch (  Exception e) {
  }
  try {
    if (shell == null) {
      IWorkbenchWindow activeWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      if (activeWindow != null)       shell=activeWindow.getShell();
    }
  }
 catch (  Exception e) {
  }
  if (shell == null) {
    IWorkbenchWindow[] windows=PlatformUI.getWorkbench().getWorkbenchWindows();
    for (int i=0; shell == null && i < windows.length; i++) {
      shell=windows[i].getShell();
    }
  }
  return shell;
}

Fixed version (ground truth):
/** 
 * Attempts to return the default shell. If it cannot return the default shell, it returns the shell of the first workbench window that has shell.
 * @return The shell
 * @since 1.2
 */
public static Shell getDefaultShell(){
  Shell shell=null;
  try {
    shell=Display.getDefault().getActiveShell();
  }
 catch (  Exception e) {
  }
  try {
    if (shell == null) {
      if (!PlatformUI.isWorkbenchRunning()) {
        return new Shell();
      }
      IWorkbenchWindow activeWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      if (activeWindow != null) {
        shell=activeWindow.getShell();
      }
    }
  }
 catch (  Exception e) {
  }
  if (shell == null) {
    if (!PlatformUI.isWorkbenchRunning()) {
      return new Shell();
    }
    IWorkbenchWindow[] windows=PlatformUI.getWorkbench().getWorkbenchWindows();
    for (int i=0; shell == null && i < windows.length; i++) {
      shell=windows[i].getShell();
    }
  }
  return shell;
}
Program: 126090
Project: 126090
Buggy source:
/** 
 * Clear the event queue
 * @since 1.2
 */
public static void clearEventLoop(){
  while (getDisplay().readAndDispatch())   ;
}

Fixed version (ground truth):
/** 
 * Clear the event queue
 * @since 1.2
 */
public static void clearEventLoop(){
  while (getDisplay().readAndDispatch()) {
    ;
  }
}
Program: 126091
Project: 126091
Buggy source:
/** 
 * Returns a non-null instance of Display object. Tries to find the Display object for the current thread first and if it fails tries to get: <li> Workbench display if the workbench running <li> Default display object
 * @return non-null Display object
 * @since 1.2
 */
public static Display getDisplay(){
  Display display=Display.getCurrent();
  if (display == null && PlatformUI.isWorkbenchRunning()) {
    display=PlatformUI.getWorkbench().getDisplay();
  }
  return display != null ? display : Display.getDefault();
}

Fixed version (ground truth):
/** 
 * Returns a non-null instance of Display object. Tries to find the Display object for the current thread first and if it fails tries to get: <li>Workbench display if the workbench running <li>Default display object
 * @return non-null Display object
 * @since 1.2
 */
public static Display getDisplay(){
  Display display=Display.getCurrent();
  if (display == null && PlatformUI.isWorkbenchRunning()) {
    display=PlatformUI.getWorkbench().getDisplay();
  }
  return display != null ? display : Display.getDefault();
}
Program: 126094
Project: 126094
Buggy source:
public boolean CheckConvertProcess(RepositoryNode sourceNode,RepositoryNode targetNode){
  boolean checkConvertProcess=false;
  if (sourceNode.getObject().getRepositoryObjectType() == ERepositoryObjectType.PROCESS || sourceNode.getObject().getRepositoryObjectType() == ERepositoryObjectType.PROCESS_STORM || sourceNode.getObject().getRepositoryObjectType() == ERepositoryObjectType.PROCESS_MR) {
    if (ENodeType.SYSTEM_FOLDER == targetNode.getType() || ENodeType.SIMPLE_FOLDER == targetNode.getType()) {
      if (targetNode.getContentType() == ERepositoryObjectType.PROCESS || targetNode.getContentType() == ERepositoryObjectType.PROCESS_STORM || targetNode.getContentType() == ERepositoryObjectType.PROCESS_MR) {
        checkConvertProcess=true;
      }
    }
  }
  return checkConvertProcess;
}

Fixed version (ground truth):
public boolean CheckConvertProcess(RepositoryNode sourceNode,RepositoryNode targetNode){
  boolean checkConvertProcess=false;
  if (sourceNode.getObject().getRepositoryObjectType() == ERepositoryObjectType.PROCESS || sourceNode.getObject().getRepositoryObjectType() == ERepositoryObjectType.PROCESS_STORM || sourceNode.getObject().getRepositoryObjectType() == ERepositoryObjectType.PROCESS_MR) {
    if (ENodeType.SYSTEM_FOLDER == targetNode.getType() || ENodeType.SIMPLE_FOLDER == targetNode.getType()) {
      if (sourceNode.getObject().getRepositoryObjectType() == targetNode.getContentType()) {
        return false;
      }
      if (targetNode.getContentType() == ERepositoryObjectType.PROCESS || targetNode.getContentType() == ERepositoryObjectType.PROCESS_STORM || targetNode.getContentType() == ERepositoryObjectType.PROCESS_MR) {
        checkConvertProcess=true;
      }
    }
  }
  return checkConvertProcess;
}
Program: 126096
Project: 126096
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (super.isVisible()) {
    try {
      populateLDAPSchemaAttributes();
    }
 catch (    Exception e) {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),e.getMessage());
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
      updateStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
    }
    attributeModel.registerDataList(itemTableNameList);
    EList attributeValueList=getConnection().getValue();
    if (attributeValueList != null && !attributeValueList.isEmpty()) {
      refreshPreview();
      checkTheRightAttributes(attributeValueList);
    }
    if (isReadOnly() != readOnly) {
      adaptFormToReadOnly();
    }
    initialize();
    adaptFormToEditable();
  }
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  if (super.isVisible()) {
    try {
      populateLDAPSchemaAttributes();
    }
 catch (    Exception e) {
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),e.getMessage());
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
      updateStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
    }
    attributeModel.registerDataList(itemTableNameList);
    EList attributeValueList=getConnection().getValue();
    boolean isRefreshingPreview=false;
    if (attributeValueList != null && !attributeValueList.isEmpty()) {
      isRefreshingPreview=true;
      refreshPreview();
      checkTheRightAttributes(attributeValueList);
    }
    if (isReadOnly() != readOnly) {
      adaptFormToReadOnly();
    }
    initialize();
    adaptFormToEditable();
    if (isRefreshingPreview && processor != null && !processor.isStopped()) {
      updateStatus(IStatus.ERROR,null);
    }
  }
}
Program: 126098
Project: 126098
Buggy source:
public List<IRepositoryViewObject> getDeletedObjects(Project project){
  loadRecycleBin(project);
  List<IRepositoryViewObject> deletedObjects=new ArrayList<IRepositoryViewObject>();
  for (  TalendItem deletedItem : projectRecyclebins.get(project.getTechnicalLabel()).getDeletedItems()) {
    try {
      IRepositoryViewObject object=ProxyRepositoryFactory.getInstance().getLastVersion(project,deletedItem.getId(),deletedItem.getPath(),ERepositoryObjectType.getType(deletedItem.getType()));
      deletedObjects.add(object);
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return deletedObjects;
}

Fixed version (ground truth):
public List<IRepositoryViewObject> getDeletedObjects(Project project){
  loadRecycleBin(project);
  List<IRepositoryViewObject> deletedObjects=new ArrayList<IRepositoryViewObject>();
  for (  TalendItem deletedItem : projectRecyclebins.get(project.getTechnicalLabel()).getDeletedItems()) {
    try {
      IRepositoryViewObject object=ProxyRepositoryFactory.getInstance().getLastVersion(project,deletedItem.getId(),deletedItem.getPath(),ERepositoryObjectType.getType(deletedItem.getType()));
      if (object == null) {
        object=ProxyRepositoryFactory.getInstance().getLastVersion(project,deletedItem.getId());
      }
      if (object != null) {
        deletedObjects.add(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  return deletedObjects;
}
Program: 126099
Project: 126099
Buggy source:
public static String getUpdateJobInfor(Property property){
  StringBuffer infor=new StringBuffer();
  String prefix=UpdatesConstants.JOB;
  String label=null;
  String version=null;
  if (property.getItem() instanceof JobletProcessItem) {
    prefix=UpdatesConstants.JOBLET;
  }
 else   if (GlobalServiceRegister.getDefault().isServiceRegistered(IMRProcessService.class)) {
    IMRProcessService mrProcessService=(IMRProcessService)GlobalServiceRegister.getDefault().getService(IMRProcessService.class);
    if (mrProcessService.isMapReduceItem(property.getItem())) {
      prefix=UpdatesConstants.MAPREDUCE;
    }
  }
  label=property.getLabel();
  version=property.getVersion();
  infor.append(prefix);
  if (label != null) {
    infor.append(UpdatesConstants.SPACE);
    infor.append(label);
    infor.append(UpdatesConstants.SPACE);
    infor.append(version);
  }
  return infor.toString();
}

Fixed version (ground truth):
public static String getUpdateJobInfor(Property property){
  StringBuffer infor=new StringBuffer();
  String prefix="String_Node_Str";
  String label=null;
  String version=null;
  if (property.getItem() instanceof JobletProcessItem) {
    prefix=UpdatesConstants.JOBLET;
  }
  Item item=property.getItem();
  if (item != null && prefix.isEmpty() && GlobalServiceRegister.getDefault().isServiceRegistered(IMRProcessService.class)) {
    IMRProcessService mrProcessService=(IMRProcessService)GlobalServiceRegister.getDefault().getService(IMRProcessService.class);
    if (mrProcessService.isMapReduceItem(item)) {
      Object framework=BigDataBasicUtil.getFramework(item);
      if (framework != null) {
        if (HadoopConstants.FRAMEWORK_SPARK.equals(framework)) {
          prefix=UpdatesConstants.SPARK;
        }
      }
      if (prefix == null || prefix.isEmpty()) {
        prefix=UpdatesConstants.MAPREDUCE;
      }
    }
  }
  if (item != null && prefix.isEmpty() && GlobalServiceRegister.getDefault().isServiceRegistered(IStormProcessService.class)) {
    IStormProcessService stormProcessService=(IStormProcessService)GlobalServiceRegister.getDefault().getService(IStormProcessService.class);
    if (stormProcessService.isStormItem(item)) {
      Object framework=BigDataBasicUtil.getFramework(item);
      if (framework != null) {
        if (HadoopConstants.FRAMEWORK_SPARKSTREAMING.equals(framework)) {
          prefix=UpdatesConstants.SPARKSTREAMING;
        }
      }
      if (prefix == null || prefix.isEmpty()) {
        prefix=UpdatesConstants.STORM;
      }
    }
  }
  if (prefix == null || prefix.isEmpty()) {
    prefix=UpdatesConstants.JOB;
  }
  label=property.getLabel();
  version=property.getVersion();
  infor.append(prefix);
  if (label != null) {
    infor.append(UpdatesConstants.SPACE);
    infor.append(label);
    infor.append(UpdatesConstants.SPACE);
    infor.append(version);
  }
  return infor.toString();
}
Program: 126100
Project: 126100
Buggy source:
/** 
 * show the cheet sheet view.
 */
private void restoreCheetSheet(){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      CheatSheetView view=ViewUtilities.showCheatSheetView();
      IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
      if (null != view) {
        if (null != cheetSheetID) {
          view.setInput(cheetSheetID);
        }
 else {
          view.setInput(DQ_CHEATSHEET_START_ID);
        }
        CheatSheetUtils.getInstance().maxDisplayCheatSheetView(view);
      }
      if (null != activePart) {
        activePart.setFocus();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * show the cheet sheet view.
 */
private void restoreCheetSheet(){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      CheatSheetView view=ViewUtilities.showCheatSheetView();
      IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
      if (null != view) {
        if (null != cheetSheetID) {
          view.setInput(cheetSheetID);
        }
 else {
          view.setInput(DQ_CHEATSHEET_START_ID);
        }
        if (CheatSheetUtils.getInstance().isFirstTime()) {
          CheatSheetUtils.getInstance().maxDisplayCheatSheetView(view);
        }
      }
      if (null != activePart) {
        activePart.setFocus();
      }
    }
  }
);
}
Program: 126101
Project: 126101
Buggy source:
public void run(){
  CheatSheetView view=ViewUtilities.showCheatSheetView();
  IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  if (null != view) {
    if (null != cheetSheetID) {
      view.setInput(cheetSheetID);
    }
 else {
      view.setInput(DQ_CHEATSHEET_START_ID);
    }
    CheatSheetUtils.getInstance().maxDisplayCheatSheetView(view);
  }
  if (null != activePart) {
    activePart.setFocus();
  }
}

Fixed version (ground truth):
public void run(){
  CheatSheetView view=ViewUtilities.showCheatSheetView();
  IWorkbenchPart activePart=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
  if (null != view) {
    if (null != cheetSheetID) {
      view.setInput(cheetSheetID);
    }
 else {
      view.setInput(DQ_CHEATSHEET_START_ID);
    }
    if (CheatSheetUtils.getInstance().isFirstTime()) {
      CheatSheetUtils.getInstance().maxDisplayCheatSheetView(view);
    }
  }
  if (null != activePart) {
    activePart.setFocus();
  }
}
Program: 126102
Project: 126102
Buggy source:
/** 
 * maximum display CheatSheetView.
 * @param view
 */
public void maxDisplayCheatSheetView(CheatSheetView view){
  if (isFirstTime() && !PrefUtil.getAPIPreferenceStore().getBoolean(this.getClass().getSimpleName())) {
    view.getSite().getPage().toggleZoom(((PartSite)view.getSite()).getPartReference());
    view.setFocus();
    setFirstTime(false);
    PrefUtil.getAPIPreferenceStore().setValue(this.getClass().getSimpleName(),true);
  }
}

Fixed version (ground truth):
/** 
 * maximum display CheatSheetView.
 * @param view
 */
public void maxDisplayCheatSheetView(CheatSheetView view){
  IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  activePage.setEditorAreaVisible(true);
  for (  IViewReference ref : activePage.getViewReferences()) {
    if (view.equals(ref.getView(false))) {
      activePage.setPartState(ref,IWorkbenchPage.STATE_MAXIMIZED);
      activePage.bringToTop(ref.getView(false));
    }
 else {
      activePage.setPartState(ref,IWorkbenchPage.STATE_MINIMIZED);
    }
  }
  for (  IEditorReference ref : activePage.getEditorReferences()) {
    activePage.setPartState(ref,IWorkbenchPage.STATE_MINIMIZED);
  }
  PrefUtil.getAPIPreferenceStore().setValue(this.getClass().getSimpleName(),true);
  setFirstTime(!PrefUtil.getAPIPreferenceStore().getBoolean(this.getClass().getSimpleName()));
}
Program: 126103
Project: 126103
Buggy source:
/** 
 * DOC amaumont Comment method "createPreview".
 * @param configurationElements
 * @return
 * @throws CoreException
 */
private static IPreview createPreview(String type) throws CoreException {
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  forceStopPreview();
  IPreview preview=null;
  if (configurationElements.length > 0) {
    preview=(IPreview)configurationElements[0].createExecutableExtension("String_Node_Str");
  }
  for (  IConfigurationElement configurationElement : configurationElements) {
    if (type != null && !type.isEmpty()) {
      String fileType=configurationElement.getAttribute("String_Node_Str");
      if (fileType == null || fileType.isEmpty() || !fileType.equals(type)) {
        continue;
      }
    }
    IPreview pre=(IPreview)configurationElement.createExecutableExtension("String_Node_Str");
    if (!PluginChecker.isOnlyTopLoaded() && !pre.isTopPreview()) {
      preview=pre;
    }
  }
  if (preview == null) {
    log.error(Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str"));
  }
  currentPreview=preview;
  return preview;
}

Fixed version (ground truth):
/** 
 * DOC amaumont Comment method "createPreview".
 * @param configurationElements
 * @return
 * @throws CoreException
 */
private static IPreview createPreview(String type) throws CoreException {
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  forceStopPreview();
  IPreview preview=null;
  if (configurationElements.length > 0) {
    preview=(IPreview)configurationElements[0].createExecutableExtension("String_Node_Str");
  }
  for (  IConfigurationElement configurationElement : configurationElements) {
    String fileType=configurationElement.getAttribute("String_Node_Str");
    if (type == null && fileType != null) {
      continue;
    }
 else     if (type != null) {
      if (fileType == null) {
        continue;
      }
 else       if (!fileType.equals(type)) {
        continue;
      }
    }
    IPreview pre=(IPreview)configurationElement.createExecutableExtension("String_Node_Str");
    if (!PluginChecker.isOnlyTopLoaded() && !pre.isTopPreview()) {
      preview=pre;
    }
  }
  if (preview == null) {
    log.error(Messages.getString("String_Node_Str") + Messages.getString("String_Node_Str"));
  }
  currentPreview=preview;
  return preview;
}
Program: 126104
Project: 126104
Buggy source:
/** 
 * Show the dialog to the user (if needed). When this method finishes, #getSelection will return the workspace that should be used (whether it was just selected by the user or some previous default has been used. The parameter can be used to override the users preference. For example, this is important in cases where the default selection is already in use and the user is forced to choose a different one.
 * @param force true if the dialog should be opened regardless of the value of the show dialog checkbox
 */
public void prompt(boolean force){
  if (force || launchData.getShowDialog()) {
    open();
    if (getReturnCode() == CANCEL) {
      launchData.workspaceSelected(null);
    }
    return;
  }
  String[] recent=launchData.getRecentWorkspaces();
  String workspace=null;
  if (recent != null && recent.length > 0) {
    workspace=recent[0];
  }
  if (workspace == null || workspace.length() == 0) {
    workspace=launchData.getInitialDefault();
  }
  launchData.workspaceSelected(TextProcessor.deprocess(workspace));
}

Fixed version (ground truth):
/** 
 * Show the dialog to the user (if needed). When this method finishes, #getSelection will return the workspace that should be used (whether it was just selected by the user or some previous default has been used. The parameter can be used to override the users preference. For example, this is important in cases where the default selection is already in use and the user is forced to choose a different one.
 * @param force true if the dialog should be opened regardless of the value of the show dialog checkbox
 */
public void prompt(boolean force){
  if (force || shouldShowDialog()) {
    open();
    if (getReturnCode() == CANCEL) {
      launchData.workspaceSelected(null);
    }
    return;
  }
  String[] recent=launchData.getRecentWorkspaces();
  String workspace=null;
  if (recent != null && recent.length > 0) {
    workspace=recent[0];
  }
  if (workspace == null || workspace.length() == 0) {
    workspace=launchData.getInitialDefault();
  }
  launchData.workspaceSelected(TextProcessor.deprocess(workspace));
}
Program: 126106
Project: 126106
Buggy source:
public void buildDeletedItemsTree(RepositoryNode rootNode){
  List<String> folders=RecycleBinManager.getInstance().getDeletedFolders(rootNode.getRoot().getProject());
  Collections.sort(folders);
  for (  String fullPath : folders) {
    String folderType=fullPath.substring(0,fullPath.indexOf("String_Node_Str"));
    String path=fullPath.substring(fullPath.indexOf("String_Node_Str") + 1);
    ERepositoryObjectType currentType=null;
    for (    DynaEnum<? extends DynaEnum<?>> type : ERepositoryObjectType.values()) {
      ERepositoryObjectType objectType=(ERepositoryObjectType)type;
      if (objectType.isResouce() && folderType.equals(objectType.getFolder())) {
        currentType=objectType;
        break;
      }
    }
    if (currentType != null) {
      buildFolders(rootNode,currentType,path,rootNode);
    }
  }
  addDeletedElements(rootNode,rootNode.getChildren());
}

Fixed version (ground truth):
public void buildDeletedItemsTree(RepositoryNode rootNode){
  List<String> folders=RecycleBinManager.getInstance().getDeletedFolders(rootNode.getRoot().getProject());
  Collections.sort(folders);
  for (  String fullPath : folders) {
    String path=null;
    ERepositoryObjectType currentType=null;
    for (    DynaEnum<? extends DynaEnum<?>> type : ERepositoryObjectType.values()) {
      ERepositoryObjectType objectType=(ERepositoryObjectType)type;
      if (objectType.isResouce() && fullPath.startsWith(objectType.getFolder())) {
        path=fullPath.substring(objectType.getFolder().length() + 1);
        currentType=objectType;
        break;
      }
    }
    if (currentType != null) {
      buildFolders(rootNode,currentType,path,rootNode);
    }
  }
  addDeletedElements(rootNode,rootNode.getChildren());
}
Program: 126108
Project: 126108
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  IResource resource=delta.getResource();
  if (resource.getType() == IResource.ROOT) {
    return true;
  }
 else   if (resource.getType() == IResource.PROJECT) {
    try {
      if (resource.getProject().hasNature(TalendNature.ID)) {
        if (!ProjectManager.getInstance().getCurrentProject().getTechnicalLabel().equals(resource.getProject().getName())) {
          return false;
        }
        return true;
      }
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
 else   if (resource.getType() == IResource.FOLDER) {
    return false;
  }
 else   if (resource.getType() == IResource.FILE) {
    if (resource.getName().equals(RecycleBinManager.TALEND_RECYCLE_BIN_INDEX) || resource.getName().equals(FileConstants.LOCAL_PROJECT_FILENAME)) {
      if (viewer != null && !viewer.getTree().isDisposed()) {
        viewer.refresh(binRepositoryNode);
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  IResource resource=delta.getResource();
  if (resource.getType() == IResource.ROOT) {
    return true;
  }
 else   if (resource.getType() == IResource.PROJECT) {
    try {
      if (resource.getProject().hasNature(TalendNature.ID)) {
        if (!ProjectManager.getInstance().getCurrentProject().getTechnicalLabel().equals(resource.getProject().getName())) {
          return false;
        }
        return true;
      }
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
 else   if (resource.getType() == IResource.FOLDER) {
    return false;
  }
 else   if (resource.getType() == IResource.FILE) {
    if (resource.getName().equals(RecycleBinManager.TALEND_RECYCLE_BIN_INDEX) || resource.getName().equals(FileConstants.LOCAL_PROJECT_FILENAME)) {
      if (viewer != null && viewer.getControl() != null && !viewer.getTree().isDisposed()) {
        viewer.getControl().getDisplay().asyncExec(new Runnable(){
          @Override public void run(){
            viewer.refresh(binRepositoryNode);
          }
        }
);
      }
    }
  }
  return false;
}
Program: 126109
Project: 126109
Buggy source:
public static JsonTreeNode getSchemaTree(String jsonString,int numberOfElementsAccessiable){
  JsonTreeNode jsonTreeNode=null;
  try {
    ObjectMapper objMapper=new ObjectMapper();
    JsonNode jsonNode=objMapper.readTree(jsonString);
    jsonTreeNode=new JsonTreeNode();
    jsonTreeNode.addValue(jsonNode);
    jsonTreeNode.setLabel("String_Node_Str");
    jsonTreeNode.setJsonPath("String_Node_Str");
    fetchTreeNode(jsonTreeNode,numberOfElementsAccessiable - 1);
  }
 catch (  IOException e) {
    CommonExceptionHandler.process(e);
  }
  return jsonTreeNode;
}

Fixed version (ground truth):
public static JsonTreeNode getSchemaTree(String jsonString,int numberOfElementsAccessiable){
  JsonTreeNode jsonTreeNode=null;
  try {
    ObjectMapper objMapper=new ObjectMapper();
    JsonNode jsonNode=objMapper.readTree(jsonString);
    jsonTreeNode=new JsonTreeNode();
    jsonTreeNode.addValue(jsonNode);
    String label="String_Node_Str";
    if (jsonNode.isArray()) {
      label=label + "String_Node_Str";
    }
    jsonTreeNode.setLabel(label);
    jsonTreeNode.setJsonPath(label);
    fetchTreeNode(jsonTreeNode,numberOfElementsAccessiable - 1);
  }
 catch (  IOException e) {
    CommonExceptionHandler.process(e);
  }
  return jsonTreeNode;
}
Program: 126110
Project: 126110
Buggy source:
public boolean hasChildren(){
  Object[] children=super.getChildren();
  if (children != null && 0 < children.length) {
    return true;
  }
  Object obj=getValues();
  boolean hasChildren=false;
  if (obj instanceof Set) {
    Iterator<Object> iter=((Set)obj).iterator();
    while (iter.hasNext()) {
      Object jsonObj=iter.next();
      JsonNode jsonNode=(JsonNode)jsonObj;
      hasChildren=SchemaPopulationUtil.hasChildren(jsonNode);
      if (hasChildren) {
        return hasChildren;
      }
    }
  }
  return hasChildren;
}

Fixed version (ground truth):
public boolean hasChildren(){
  if (!retrievedFlag) {
    SchemaPopulationUtil.fetchTreeNode(this,1);
  }
  Object[] children=super.getChildren();
  if (children != null && 0 < children.length) {
    return true;
  }
 else {
    return false;
  }
}
Program: 126111
Project: 126111
Buggy source:
private TreeItem getTreeItem(TreeItem[] treeItems,String absolutePath){
  if (treeItems == null || treeItems.length == 0) {
    return null;
  }
  for (  TreeItem treeItem : treeItems) {
    Object obj=treeItem.getData();
    if (obj instanceof JsonTreeNode) {
      String jsonPath=((JsonTreeNode)obj).getJsonPath();
      if (absolutePath.equals(jsonPath)) {
        return treeItem;
      }
 else       if (absolutePath.startsWith(jsonPath + "String_Node_Str")) {
        return getTreeItem(treeItem.getItems(),absolutePath);
      }
 else {
        continue;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private TreeItem getTreeItem(TreeItem[] treeItems,String absolutePath){
  if (treeItems == null || treeItems.length == 0) {
    return null;
  }
  for (  TreeItem treeItem : treeItems) {
    Object obj=treeItem.getData();
    if (obj instanceof JsonTreeNode) {
      String jsonPath=SchemaPopulationUtil.getFilteredJsonPath(((JsonTreeNode)obj).getJsonPath());
      if (absolutePath.equals(jsonPath)) {
        return treeItem;
      }
 else       if (absolutePath.startsWith(jsonPath + "String_Node_Str")) {
        return getTreeItem(treeItem.getItems(),absolutePath);
      }
 else {
        continue;
      }
    }
  }
  return null;
}