nus-yam/ex-repair huggingface dataset:
Program: 125695
Project: 125695
Buggy source:
@Override public void run(){
  for (  ResourceNode resourceNode : pathToRefresh) {
    XmiResourceManager xrm=new XmiResourceManager();
    if (xrm.isPropertyFile(resourceNode.getPath())) {
      List<IRepositoryNode> nodes=new ArrayList<>();
      for (      Object object : viewer.getExpandedElements()) {
        if (object instanceof IRepositoryNode) {
          nodes.add((IRepositoryNode)object);
        }
      }
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(resourceNode.getPath()));
      Property property=xrm.loadProperty(file);
      IRepositoryNode itemNode=findItemNode(property.getId(),nodes);
      if (itemNode != null) {
        IRepositoryViewObject object=itemNode.getObject();
        if (object != null) {
          object.getProperty();
        }
        if (itemNode != null && viewer != null && !viewer.getTree().isDisposed()) {
          viewer.refresh(itemNode,true);
        }
      }
    }
 else {
      String folder=resourceNode.getPath().replace(resourceNode.getTopNodePath(),"String_Node_Str");
      IRepositoryNode nodeToRefresh=findFolder(folder,resourceNode.getTopNode());
      if (nodeToRefresh != null) {
        if (nodeToRefresh != null && viewer != null && !viewer.getTree().isDisposed()) {
          viewer.refresh(nodeToRefresh,false);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  for (  ResourceNode resourceNode : pathToRefresh) {
    XmiResourceManager xrm=new XmiResourceManager();
    if (xrm.isPropertyFile(resourceNode.getPath())) {
      List<IRepositoryNode> nodes=new ArrayList<>();
      for (      Object object : viewer.getExpandedElements()) {
        if (object instanceof IRepositoryNode) {
          nodes.add((IRepositoryNode)object);
        }
      }
      IFile file=ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(resourceNode.getPath()));
      Property property=xrm.loadProperty(file);
      if (property != null) {
        IRepositoryNode itemNode=findItemNode(property.getId(),nodes);
        if (itemNode != null) {
          IRepositoryViewObject object=itemNode.getObject();
          if (object != null) {
            object.getProperty();
          }
          if (itemNode != null && viewer != null && !viewer.getTree().isDisposed()) {
            viewer.refresh(itemNode,true);
          }
        }
      }
    }
 else {
      String folder=null;
      if (resourceNode.getPath().startsWith(resourceNode.getTopNodePath())) {
        folder=resourceNode.getPath().replace(resourceNode.getTopNodePath(),"String_Node_Str");
      }
 else {
        folder="String_Node_Str";
      }
      IRepositoryNode nodeToRefresh=findFolder(folder,resourceNode.getTopNode());
      if (nodeToRefresh != null) {
        if (nodeToRefresh != null && viewer != null && !viewer.getTree().isDisposed()) {
          viewer.refresh(nodeToRefresh,false);
        }
      }
    }
  }
}
Program: 125696
Project: 125696
Buggy source:
/** 
 * For TDI-36019
 */
@Test public void testGetInstance(){
  String projectName="String_Node_Str";
  Project project=new Project(projectName);
  project.setTechnicalLabel(projectName);
  RelationshipItemBuilder relationshipItemBuilder=RelationshipItemBuilder.getInstance(project,true);
  assert(project == relationshipItemBuilder.getAimProject());
  assert(ProjectManager.getInstance().getCurrentProject() == RelationshipItemBuilder.getInstance().getAimProject());
  Project project2=new Project(projectName);
  project2.setTechnicalLabel(projectName);
  assert(project2 == RelationshipItemBuilder.getInstance().getAimProject());
}

Fixed version (ground truth):
/** 
 * For TDI-36019
 */
@Test public void testGetInstance(){
  String projectName="String_Node_Str";
  Project project=new Project(projectName);
  project.setTechnicalLabel(projectName);
  RelationshipItemBuilder relationshipItemBuilder=RelationshipItemBuilder.getInstance(project,true);
  assert(project == relationshipItemBuilder.getAimProject());
  Project project2=new Project(projectName);
  project2.setTechnicalLabel(projectName);
  assert(relationshipItemBuilder == RelationshipItemBuilder.getInstance(project2,true));
  assert(relationshipItemBuilder.getAimProject() == project2);
  assert(ProjectManager.getInstance().getCurrentProject() == RelationshipItemBuilder.getInstance().getAimProject());
}
Program: 125703
Project: 125703
Buggy source:
private static void generateJobInfo(JobInfo jobInfo,boolean isMainJob,IProcess currentProcess,ProcessItem selectedProcessItem){
  if (!CommonsPlugin.isHeadless()) {
    if (currentProcess instanceof IProcess2) {
      IProcess2 process2=(IProcess2)currentProcess;
      process2.setActivate(true);
      process2.checkProcess();
    }
  }
  JobInfo generatedJobInfo=new JobInfo(jobInfo.getJobId(),jobInfo.getContextName(),jobInfo.getJobVersion());
  generatedJobInfo.setJobName(currentProcess.getName());
  generatedJobInfo.setTestContainer(jobInfo.isTestContainer());
  String projectFolderName;
  if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
    projectFolderName=JavaResourcesHelper.getProjectFolderName(selectedProcessItem);
  }
 else {
    projectFolderName=PerlResourcesHelper.getRootProjectName(selectedProcessItem);
  }
  generatedJobInfo.setProjectFolderName(projectFolderName);
  LastGenerationInfo.getInstance().getLastGeneratedjobs().add(generatedJobInfo);
  if (isMainJob) {
    LastGenerationInfo.getInstance().setLastMainJob(generatedJobInfo);
  }
}

Fixed version (ground truth):
private static void generateJobInfo(JobInfo jobInfo,boolean isMainJob,IProcess currentProcess,ProcessItem selectedProcessItem){
  if (!CommonsPlugin.isHeadless()) {
    if (currentProcess instanceof IProcess2) {
      IProcess2 process2=(IProcess2)currentProcess;
      process2.setActivate(true);
      process2.checkProcess();
    }
  }
  JobInfo generatedJobInfo=cloneJobInfo(jobInfo);
  String projectFolderName;
  if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
    projectFolderName=JavaResourcesHelper.getProjectFolderName(selectedProcessItem);
  }
 else {
    projectFolderName=PerlResourcesHelper.getRootProjectName(selectedProcessItem);
  }
  generatedJobInfo.setProjectFolderName(projectFolderName);
  LastGenerationInfo.getInstance().getLastGeneratedjobs().add(generatedJobInfo);
  if (isMainJob) {
    LastGenerationInfo.getInstance().setLastMainJob(generatedJobInfo);
  }
}
Program: 125705
Project: 125705
Buggy source:
@Override protected boolean validChildrenJob(JobInfo jobInfo){
  return jobInfo != null && !jobInfo.isTestContainer();
}

Fixed version (ground truth):
@Override protected boolean validChildrenJob(JobInfo jobInfo){
  JobInfo fatherJobInfo=null;
  for (  JobInfo lastGeneratedJobInfo : LastGenerationInfo.getInstance().getLastGeneratedjobs()) {
    if (lastGeneratedJobInfo.getJobId().equals(getJobProcessor().getProperty().getId()) && lastGeneratedJobInfo.getJobVersion().equals(getJobProcessor().getProperty().getVersion())) {
      fatherJobInfo=lastGeneratedJobInfo;
      break;
    }
  }
  if (fatherJobInfo != null) {
    fatherJobInfo=fatherJobInfo.getFatherJobInfo();
  }
  while (fatherJobInfo != null) {
    if (fatherJobInfo.getJobId().equals(jobInfo.getJobId()) && fatherJobInfo.getJobVersion().equals(jobInfo.getJobVersion())) {
      return false;
    }
    fatherJobInfo=fatherJobInfo.getFatherJobInfo();
  }
  return jobInfo != null && !jobInfo.isTestContainer();
}
Program: 125708
Project: 125708
Buggy source:
private static void generateJobInfo(JobInfo jobInfo,boolean isMainJob,IProcess currentProcess,ProcessItem selectedProcessItem){
  if (!CommonsPlugin.isHeadless()) {
    if (currentProcess instanceof IProcess2) {
      IProcess2 process2=(IProcess2)currentProcess;
      process2.setActivate(true);
      process2.checkProcess();
    }
  }
  JobInfo generatedJobInfo=new JobInfo(jobInfo.getJobId(),jobInfo.getContextName(),jobInfo.getJobVersion());
  generatedJobInfo.setJobName(currentProcess.getName());
  generatedJobInfo.setTestContainer(jobInfo.isTestContainer());
  String projectFolderName;
  if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
    projectFolderName=JavaResourcesHelper.getProjectFolderName(selectedProcessItem);
  }
 else {
    projectFolderName=PerlResourcesHelper.getRootProjectName(selectedProcessItem);
  }
  generatedJobInfo.setProjectFolderName(projectFolderName);
  LastGenerationInfo.getInstance().getLastGeneratedjobs().add(generatedJobInfo);
  if (isMainJob) {
    LastGenerationInfo.getInstance().setLastMainJob(generatedJobInfo);
  }
}

Fixed version (ground truth):
private static void generateJobInfo(JobInfo jobInfo,boolean isMainJob,IProcess currentProcess,ProcessItem selectedProcessItem){
  if (!CommonsPlugin.isHeadless()) {
    if (currentProcess instanceof IProcess2) {
      IProcess2 process2=(IProcess2)currentProcess;
      process2.setActivate(true);
      process2.checkProcess();
    }
  }
  JobInfo generatedJobInfo=cloneJobInfo(jobInfo);
  String projectFolderName;
  if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
    projectFolderName=JavaResourcesHelper.getProjectFolderName(selectedProcessItem);
  }
 else {
    projectFolderName=PerlResourcesHelper.getRootProjectName(selectedProcessItem);
  }
  generatedJobInfo.setProjectFolderName(projectFolderName);
  LastGenerationInfo.getInstance().getLastGeneratedjobs().add(generatedJobInfo);
  if (isMainJob) {
    LastGenerationInfo.getInstance().setLastMainJob(generatedJobInfo);
  }
}
Program: 125710
Project: 125710
Buggy source:
@Override protected boolean validChildrenJob(JobInfo jobInfo){
  return jobInfo != null && !jobInfo.isTestContainer();
}

Fixed version (ground truth):
@Override protected boolean validChildrenJob(JobInfo jobInfo){
  JobInfo fatherJobInfo=null;
  for (  JobInfo lastGeneratedJobInfo : LastGenerationInfo.getInstance().getLastGeneratedjobs()) {
    if (lastGeneratedJobInfo.getJobId().equals(getJobProcessor().getProperty().getId()) && lastGeneratedJobInfo.getJobVersion().equals(getJobProcessor().getProperty().getVersion())) {
      fatherJobInfo=lastGeneratedJobInfo;
      break;
    }
  }
  if (fatherJobInfo != null) {
    fatherJobInfo=fatherJobInfo.getFatherJobInfo();
  }
  while (fatherJobInfo != null) {
    if (fatherJobInfo.getJobId().equals(jobInfo.getJobId()) && fatherJobInfo.getJobVersion().equals(jobInfo.getJobVersion())) {
      return false;
    }
    fatherJobInfo=fatherJobInfo.getFatherJobInfo();
  }
  return jobInfo != null && !jobInfo.isTestContainer();
}
Program: 125714
Project: 125714
Buggy source:
@Override public void updateItemsPath(ERepositoryObjectType type,IPath targetPath) throws PersistenceException {
  if (type == null) {
    return;
  }
  Project baseProject=getRepositoryContext().getProject();
  IProject project=ResourceUtils.getProject(baseProject);
  String folderPathString=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + targetPath.toString();
  IFolder folder=ResourceUtils.getFolder(project,folderPathString,false);
  unloadUnlockedResources();
  List<IRepositoryViewObject> serializableFromFolder=getSerializableFromFolder(baseProject,folder,null,type,true,false,false,false);
  for (  IRepositoryViewObject repositoryObject : serializableFromFolder) {
    ItemState state=repositoryObject.getProperty().getItem().getState();
    state.setPath(getItemStatePath(type,targetPath).toString());
    xmiResourceManager.saveResource(state.eResource());
  }
  if (folder.exists()) {
    for (    IResource current : ResourceUtils.getMembers(folder)) {
      if (current instanceof IFolder) {
        updateItemsPath(type,targetPath.append(current.getName()));
      }
    }
  }
}

Fixed version (ground truth):
@Override public void updateItemsPath(ERepositoryObjectType type,IPath targetPath) throws PersistenceException {
  if (type == null) {
    return;
  }
  Project baseProject=getRepositoryContext().getProject();
  IProject project=ResourceUtils.getProject(baseProject);
  String folderPathString=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + targetPath.toString();
  IFolder folder=ResourceUtils.getFolder(project,folderPathString,false);
  unloadUnlockedResources();
  List<IRepositoryViewObject> serializableFromFolder=getSerializableFromFolder(baseProject,folder,null,type,true,false,true,false);
  for (  IRepositoryViewObject repositoryObject : serializableFromFolder) {
    ItemState state=repositoryObject.getProperty().getItem().getState();
    state.setPath(getItemStatePath(type,targetPath).toString());
    xmiResourceManager.saveResource(state.eResource());
  }
  if (folder.exists()) {
    for (    IResource current : ResourceUtils.getMembers(folder)) {
      if (current instanceof IFolder) {
        updateItemsPath(type,targetPath.append(current.getName()));
      }
    }
  }
}
Program: 125715
Project: 125715
Buggy source:
private String getParamType(IMetadataTable table,boolean isInput){
  if (functionUnit == null) {
    return null;
  }
  SAPFunctionParamData paramData=functionUnit.getParamData();
  if (paramData == null) {
    return null;
  }
  EList<SAPFunctionParameter> parameterChildrenList=null;
  if (isInput) {
    parameterChildrenList=paramData.getInputRoot().getChildren();
  }
 else {
    parameterChildrenList=paramData.getOutputRoot().getChildren();
  }
  for (  SAPFunctionParameter parameter : parameterChildrenList) {
    if (parameter.getName().equals(table.getTableName())) {
      if (parameter.getType().equals(ISAPConstant.PARAM_STRUCTURE)) {
        return ISAPConstant.PARAM_STRUCTURE.toUpperCase();
      }
 else       if (parameter.getType().equals(ISAPConstant.PARAM_TABLE)) {
        return ISAPConstant.PARAM_TABLE.toUpperCase();
      }
 else {
        return ISAPConstant.PARAM_SINGLE.toUpperCase();
      }
    }
  }
  if (ISAPConstant.SINGLE_PARAM_TABLE_NAME.equals(table.getTableName())) {
    return ISAPConstant.PARAM_TABLE.toUpperCase();
  }
  return null;
}

Fixed version (ground truth):
private String getParamType(IMetadataTable table,boolean isInput){
  if (functionUnit == null) {
    return null;
  }
  SAPFunctionParamData paramData=functionUnit.getParamData();
  if (paramData == null) {
    return null;
  }
  EList<SAPFunctionParameter> parameterChildrenList=null;
  if (isInput) {
    parameterChildrenList=paramData.getInputRoot().getChildren();
  }
 else {
    parameterChildrenList=paramData.getOutputRoot().getChildren();
  }
  for (  SAPFunctionParameter parameter : parameterChildrenList) {
    if (parameter.getName().equals(table.getTableName())) {
      if (parameter.getType().equals(ISAPConstant.PARAM_STRUCTURE)) {
        return ISAPConstant.PARAM_STRUCTURE.toUpperCase();
      }
 else       if (parameter.getType().equals(ISAPConstant.PARAM_TABLE)) {
        return ISAPConstant.PARAM_TABLE.toUpperCase();
      }
 else {
        return ISAPConstant.PARAM_SINGLE.toUpperCase();
      }
    }
  }
  if (!isInput && ISAPConstant.SINGLE_PARAM_TABLE_NAME.equals(table.getTableName())) {
    return ISAPConstant.PARAM_SINGLE.toUpperCase();
  }
  return null;
}
Program: 125719
Project: 125719
Buggy source:
public void clear(){
  this.allImportItemNode.clear();
  this.allImportItemRecords.clear();
  this.projectNodesMap.clear();
  this.jobNodesMap.clear();
}

Fixed version (ground truth):
public void clear(){
  this.allImportItemNode.clear();
  this.allImportItemRecords.clear();
  this.projectNodesMap.clear();
  this.standardNodesMap.clear();
}
Program: 125720
Project: 125720
Buggy source:
@Override public void getPipelinedChildren(Object aParent,Set theCurrentChildren){
  theCurrentChildren.clear();
}

Fixed version (ground truth):
@Override public void getPipelinedChildren(Object aParent,Set theCurrentChildren){
  removeResourceVisitorForOverride(theCurrentChildren);
  theCurrentChildren.clear();
}
Program: 125721
Project: 125721
Buggy source:
@Override public void getPipelinedElements(Object anInput,Set theCurrentElements){
  theCurrentElements.clear();
}

Fixed version (ground truth):
@Override public void getPipelinedElements(Object anInput,Set theCurrentElements){
  removeResourceVisitorForOverride(theCurrentElements);
  theCurrentElements.clear();
}
Program: 125722
Project: 125722
Buggy source:
@Override public void dispose(){
}

Fixed version (ground truth):
@Override public void dispose(){
  this.viewer=null;
}
Program: 125723
Project: 125723
Buggy source:
@Override public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
}

Fixed version (ground truth):
@Override public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
  this.viewer=viewer;
}
Program: 125724
Project: 125724
Buggy source:
@Override public void dispose(){
  if (this.viewer != null && this.visitor != null && this.viewer instanceof RepoViewCommonViewer) {
    final Control control=this.viewer.getControl();
    if (control != null && !control.isDisposed()) {
      CommonNavigator commonNavigator=((RepoViewCommonViewer)this.viewer).getCommonNavigator();
      if (commonNavigator instanceof RepoViewCommonNavigator) {
        ((RepoViewCommonNavigator)commonNavigator).removeVisitor(this.visitor);
      }
    }
  }
  topLevelNodeToPathMap.clear();
  topLevelNodeToPathMap=null;
  super.dispose();
}

Fixed version (ground truth):
@Override public void dispose(){
  if (this.viewer != null && this.visitor != null && this.viewer instanceof RepoViewCommonViewer) {
    final Control control=this.viewer.getControl();
    if (control != null && !control.isDisposed()) {
      CommonNavigator commonNavigator=((RepoViewCommonViewer)this.viewer).getCommonNavigator();
      if (commonNavigator instanceof RepoViewCommonNavigator) {
        ((RepoViewCommonNavigator)commonNavigator).removeVisitor(this.visitor);
        this.visitor=null;
      }
    }
  }
  topLevelNodeToPathMap.clear();
  super.dispose();
}
Program: 125728
Project: 125728
Buggy source:
/** 
 * For TDI-36019
 */
@Test public void testGetInstance(){
  ProjectManager projectManager=PowerMockito.mock(ProjectManager.class);
  PowerMockito.mockStatic(ProjectManager.class);
  when(ProjectManager.getInstance()).thenReturn(projectManager);
  CoreRuntimePlugin coreRuntimePlugin=PowerMockito.mock(CoreRuntimePlugin.class);
  PowerMockito.mockStatic(CoreRuntimePlugin.class);
  when(CoreRuntimePlugin.getInstance()).thenReturn(coreRuntimePlugin);
  String projectName="String_Node_Str";
  Project project=new Project(projectName);
  project.setTechnicalLabel(projectName);
  RelationshipItemBuilder relationshipItemBuilder=RelationshipItemBuilder.getInstance(project,true);
  assert(project == relationshipItemBuilder.getAimProject());
  when(projectManager.getCurrentProject()).thenReturn(project);
  assert(project == RelationshipItemBuilder.getInstance().getAimProject());
  Project project2=new Project(projectName);
  project2.setTechnicalLabel(projectName);
  when(projectManager.getCurrentProject()).thenReturn(project2);
  assert(project2 == RelationshipItemBuilder.getInstance().getAimProject());
}

Fixed version (ground truth):
/** 
 * For TDI-36019
 */
@Test public void testGetInstance(){
  String projectName="String_Node_Str";
  Project project=new Project(projectName);
  project.setTechnicalLabel(projectName);
  RelationshipItemBuilder relationshipItemBuilder=RelationshipItemBuilder.getInstance(project,true);
  assert(project == relationshipItemBuilder.getAimProject());
  assert(ProjectManager.getInstance().getCurrentProject() == RelationshipItemBuilder.getInstance().getAimProject());
  Project project2=new Project(projectName);
  project2.setTechnicalLabel(projectName);
  assert(project2 == RelationshipItemBuilder.getInstance().getAimProject());
}
Program: 125730
Project: 125730
Buggy source:
/** 
 * @param pane
 * @param viewport
 */
public AnimatableZoomManager(ScalableFigure pane,Viewport viewport){
  super(pane,viewport);
}

Fixed version (ground truth):
/** 
 * @param pane
 * @param viewport
 */
public AnimatableZoomManager(ScalableFigure pane,Viewport viewport){
  super(pane,viewport);
  currentZoom=1.0;
}
Program: 125731
Project: 125731
Buggy source:
private boolean isTestCasesLocked(RepositoryNode node){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  for (  IRepositoryNode child : node.getChildren()) {
    IRepositoryViewObject nodeObject=child.getObject();
    if (nodeObject != null && nodeObject.getProperty() != null && nodeObject.getProperty().getItem() != null) {
      if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
        if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isTestCasesLocked(IRepositoryNode node){
  if (node.getObject() == null) {
    return false;
  }
  if (node.getObject().getProperty() == null) {
    return false;
  }
  Item item=node.getObject().getProperty().getItem();
  if (item instanceof FolderItem) {
    for (    IRepositoryNode child : node.getChildren()) {
      if (isTestCasesLocked(child)) {
        return true;
      }
    }
  }
 else   if (item instanceof ProcessItem) {
    ProcessItem processItem=(ProcessItem)item;
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
      ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
      if (testContainerService != null) {
        List<IRepositoryViewObject> objectList=testContainerService.listExistingTestCases(processItem.getProperty().getId());
        for (        IRepositoryViewObject nodeObject : objectList) {
          if (nodeObject != null && nodeObject.getProperty() != null && nodeObject.getProperty().getItem() != null) {
            if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
              if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
                return true;
              }
            }
          }
        }
      }
    }
  }
  return false;
}
Program: 125733
Project: 125733
Buggy source:
private static boolean loadLibraries(DynamicClassLoader classLoader,String[] driversArray,boolean showDownloadIfNotExist){
  List<String> jarPathList=new ArrayList<String>();
  if (driversArray == null || driversArray.length == 0) {
    return true;
  }
  ILibraryManagerService librairesManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  String libPath=getLibPath();
  List<String> driverNotExist=new ArrayList<String>();
  for (  String driverName : driversArray) {
    String jarPath=libPath + PATH_SEPARATOR + driverName;
    File jarFile=new File(jarPath);
    if (!jarFile.exists()) {
      driverNotExist.add(driverName);
    }
    jarPathList.add(jarFile.getAbsolutePath());
  }
  boolean putInCache=false;
  if (!driverNotExist.isEmpty()) {
    putInCache=librairesManagerService.retrieve(driverNotExist,libPath,showDownloadIfNotExist,new NullProgressMonitor());
  }
  classLoader.setLibStorePath(libPath);
  classLoader.addLibraries(jarPathList);
  return putInCache;
}

Fixed version (ground truth):
private static boolean loadLibraries(DynamicClassLoader classLoader,String[] driversArray,boolean showDownloadIfNotExist){
  List<String> jarPathList=new ArrayList<String>();
  if (driversArray == null || driversArray.length == 0) {
    return true;
  }
  ILibraryManagerService librairesManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  String libPath=getLibPath();
  List<String> driverNotExist=new ArrayList<String>();
  for (  String driverName : driversArray) {
    if (StringUtils.isNotEmpty(driverName)) {
      String jarPath=libPath + PATH_SEPARATOR + driverName;
      File jarFile=new File(jarPath);
      if (!jarFile.exists()) {
        driverNotExist.add(driverName);
      }
      jarPathList.add(jarFile.getAbsolutePath());
    }
  }
  boolean putInCache=false;
  if (!driverNotExist.isEmpty()) {
    putInCache=librairesManagerService.retrieve(driverNotExist,libPath,showDownloadIfNotExist,new NullProgressMonitor());
  }
  classLoader.setLibStorePath(libPath);
  classLoader.addLibraries(jarPathList);
  return putInCache;
}
Program: 125734
Project: 125734
Buggy source:
private static String getImpalaURLString(boolean supportContext,String server,String port,String sid,String Principal){
  String s=EDatabaseConnTemplate.IMPALA.getUrlTemplate(EDatabaseVersion4Drivers.IMPALA_CDH5);
  String standardURlString=getImpalaURlString(s,supportContext,server,port,sid);
  String principalSuffix="String_Node_Str";
  boolean hasPrinc=false;
  String[] urlArray=standardURlString.split(SEMICOLON);
  if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
    hasPrinc=true;
  }
  if (hasPrinc) {
    if (Principal == null) {
      standardURlString=standardURlString.substring(0,standardURlString.lastIndexOf(principalSuffix));
    }
  }
 else {
    if (Principal != null) {
      standardURlString=standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
    }
  }
  return standardURlString;
}

Fixed version (ground truth):
private static String getImpalaURLString(boolean supportContext,String server,String port,String sid,String Principal){
  String s=EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
  String standardURlString=getImpalaURlString(s,supportContext,server,port,sid);
  String principalSuffix="String_Node_Str";
  boolean hasPrinc=false;
  String[] urlArray=standardURlString.split(SEMICOLON);
  if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
    hasPrinc=true;
  }
  if (hasPrinc) {
    if (Principal == null) {
      standardURlString=standardURlString.substring(0,standardURlString.lastIndexOf(principalSuffix));
    }
  }
 else {
    if (Principal != null) {
      standardURlString=standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
    }
  }
  return standardURlString;
}
Program: 125735
Project: 125735
Buggy source:
/** 
 * @param pane
 * @param viewport
 */
public AnimatableZoomManager(ScalableFigure pane,Viewport viewport){
  super(pane,viewport);
}

Fixed version (ground truth):
/** 
 * @param pane
 * @param viewport
 */
public AnimatableZoomManager(ScalableFigure pane,Viewport viewport){
  super(pane,viewport);
  currentZoom=1.0;
}
Program: 125736
Project: 125736
Buggy source:
private boolean isTestCasesLocked(RepositoryNode node){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  for (  IRepositoryNode child : node.getChildren()) {
    IRepositoryViewObject nodeObject=child.getObject();
    if (nodeObject != null && nodeObject.getProperty() != null && nodeObject.getProperty().getItem() != null) {
      if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
        if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isTestCasesLocked(IRepositoryNode node){
  if (node.getObject() == null) {
    return false;
  }
  if (node.getObject().getProperty() == null) {
    return false;
  }
  Item item=node.getObject().getProperty().getItem();
  if (item instanceof FolderItem) {
    for (    IRepositoryNode child : node.getChildren()) {
      if (isTestCasesLocked(child)) {
        return true;
      }
    }
  }
 else   if (item instanceof ProcessItem) {
    ProcessItem processItem=(ProcessItem)item;
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
      ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
      if (testContainerService != null) {
        List<IRepositoryViewObject> objectList=testContainerService.listExistingTestCases(processItem.getProperty().getId());
        for (        IRepositoryViewObject nodeObject : objectList) {
          if (nodeObject != null && nodeObject.getProperty() != null && nodeObject.getProperty().getItem() != null) {
            if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
              if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
                return true;
              }
            }
          }
        }
      }
    }
  }
  return false;
}
Program: 125738
Project: 125738
Buggy source:
public List<IRepositoryViewObject> listExistingTestCases();

Fixed version (ground truth):
public List<IRepositoryViewObject> listExistingTestCases(String originalParentID);
Program: 125740
Project: 125740
Buggy source:
private Set<Relation> getItemsHaveRelationWith(Map<Relation,Set<Relation>> itemsRelations,String itemId,boolean includeTestCase){
  Set<Relation> relations=new HashSet<Relation>();
  for (  Relation baseItem : itemsRelations.keySet()) {
    for (    Relation relatedItem : itemsRelations.get(baseItem)) {
      String id=relatedItem.getId();
      if (id != null) {
        Relation tmpRelatedItem=null;
        if (id.indexOf("String_Node_Str") != -1) {
          try {
            tmpRelatedItem=(Relation)relatedItem.clone();
            tmpRelatedItem.setId(id.split("String_Node_Str")[0]);
          }
 catch (          CloneNotSupportedException e) {
            log.error(e);
          }
        }
 else {
          tmpRelatedItem=relatedItem;
        }
        if (tmpRelatedItem != null && itemId.equals(id)) {
          if (!includeTestCase && TEST_RELATION.equals(tmpRelatedItem.getType())) {
            continue;
          }
          relations.add(baseItem);
          break;
        }
      }
    }
  }
  return relations;
}

Fixed version (ground truth):
private Set<Relation> getItemsHaveRelationWith(Map<Relation,Set<Relation>> itemsRelations,String itemId){
  Set<Relation> relations=new HashSet<Relation>();
  for (  Relation baseItem : itemsRelations.keySet()) {
    for (    Relation relatedItem : itemsRelations.get(baseItem)) {
      String id=relatedItem.getId();
      if (id != null) {
        Relation tmpRelatedItem=null;
        if (id.indexOf("String_Node_Str") != -1) {
          try {
            tmpRelatedItem=(Relation)relatedItem.clone();
            tmpRelatedItem.setId(id.split("String_Node_Str")[0]);
          }
 catch (          CloneNotSupportedException e) {
            log.error(e);
          }
        }
 else {
          tmpRelatedItem=relatedItem;
        }
        if (tmpRelatedItem != null && itemId.equals(id)) {
          relations.add(baseItem);
          break;
        }
      }
    }
  }
  return relations;
}
Program: 125741
Project: 125741
Buggy source:
/** 
 * @param pane
 * @param viewport
 */
public AnimatableZoomManager(ScalableFigure pane,Viewport viewport){
  super(pane,viewport);
}

Fixed version (ground truth):
/** 
 * @param pane
 * @param viewport
 */
public AnimatableZoomManager(ScalableFigure pane,Viewport viewport){
  super(pane,viewport);
  currentZoom=1.0;
}
Program: 125742
Project: 125742
Buggy source:
private boolean isTestCasesLocked(RepositoryNode node){
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  for (  IRepositoryNode child : node.getChildren()) {
    IRepositoryViewObject nodeObject=child.getObject();
    if (nodeObject != null && nodeObject.getProperty() != null && nodeObject.getProperty().getItem() != null) {
      if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
        if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isTestCasesLocked(IRepositoryNode node){
  if (node.getObject() == null) {
    return false;
  }
  if (node.getObject().getProperty() == null) {
    return false;
  }
  Item item=node.getObject().getProperty().getItem();
  if (item instanceof FolderItem) {
    for (    IRepositoryNode child : node.getChildren()) {
      if (isTestCasesLocked(child)) {
        return true;
      }
    }
  }
 else   if (item instanceof ProcessItem) {
    ProcessItem processItem=(ProcessItem)item;
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
      ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
      if (testContainerService != null) {
        List<IRepositoryViewObject> objectList=testContainerService.listExistingTestCases(processItem.getProperty().getId());
        for (        IRepositoryViewObject nodeObject : objectList) {
          if (nodeObject != null && nodeObject.getProperty() != null && nodeObject.getProperty().getItem() != null) {
            if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
              if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER) {
                return true;
              }
            }
          }
        }
      }
    }
  }
  return false;
}
Program: 125744
Project: 125744
Buggy source:
private static boolean loadLibraries(DynamicClassLoader classLoader,String[] driversArray,boolean showDownloadIfNotExist){
  List<String> jarPathList=new ArrayList<String>();
  if (driversArray == null || driversArray.length == 0) {
    return true;
  }
  ILibraryManagerService librairesManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  String libPath=getLibPath();
  List<String> driverNotExist=new ArrayList<String>();
  for (  String driverName : driversArray) {
    String jarPath=libPath + PATH_SEPARATOR + driverName;
    File jarFile=new File(jarPath);
    if (!jarFile.exists()) {
      driverNotExist.add(driverName);
    }
    jarPathList.add(jarFile.getAbsolutePath());
  }
  boolean putInCache=false;
  if (!driverNotExist.isEmpty()) {
    putInCache=librairesManagerService.retrieve(driverNotExist,libPath,showDownloadIfNotExist,new NullProgressMonitor());
  }
  classLoader.setLibStorePath(libPath);
  classLoader.addLibraries(jarPathList);
  return putInCache;
}

Fixed version (ground truth):
private static boolean loadLibraries(DynamicClassLoader classLoader,String[] driversArray,boolean showDownloadIfNotExist){
  List<String> jarPathList=new ArrayList<String>();
  if (driversArray == null || driversArray.length == 0) {
    return true;
  }
  ILibraryManagerService librairesManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  String libPath=getLibPath();
  List<String> driverNotExist=new ArrayList<String>();
  for (  String driverName : driversArray) {
    if (StringUtils.isNotEmpty(driverName)) {
      String jarPath=libPath + PATH_SEPARATOR + driverName;
      File jarFile=new File(jarPath);
      if (!jarFile.exists()) {
        driverNotExist.add(driverName);
      }
      jarPathList.add(jarFile.getAbsolutePath());
    }
  }
  boolean putInCache=false;
  if (!driverNotExist.isEmpty()) {
    putInCache=librairesManagerService.retrieve(driverNotExist,libPath,showDownloadIfNotExist,new NullProgressMonitor());
  }
  classLoader.setLibStorePath(libPath);
  classLoader.addLibraries(jarPathList);
  return putInCache;
}
Program: 125745
Project: 125745
Buggy source:
private static String getImpalaURLString(boolean supportContext,String server,String port,String sid,String Principal){
  String s=EDatabaseConnTemplate.IMPALA.getUrlTemplate(EDatabaseVersion4Drivers.IMPALA_CDH5);
  String standardURlString=getImpalaURlString(s,supportContext,server,port,sid);
  String principalSuffix="String_Node_Str";
  boolean hasPrinc=false;
  String[] urlArray=standardURlString.split(SEMICOLON);
  if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
    hasPrinc=true;
  }
  if (hasPrinc) {
    if (Principal == null) {
      standardURlString=standardURlString.substring(0,standardURlString.lastIndexOf(principalSuffix));
    }
  }
 else {
    if (Principal != null) {
      standardURlString=standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
    }
  }
  return standardURlString;
}

Fixed version (ground truth):
private static String getImpalaURLString(boolean supportContext,String server,String port,String sid,String Principal){
  String s=EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
  String standardURlString=getImpalaURlString(s,supportContext,server,port,sid);
  String principalSuffix="String_Node_Str";
  boolean hasPrinc=false;
  String[] urlArray=standardURlString.split(SEMICOLON);
  if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
    hasPrinc=true;
  }
  if (hasPrinc) {
    if (Principal == null) {
      standardURlString=standardURlString.substring(0,standardURlString.lastIndexOf(principalSuffix));
    }
  }
 else {
    if (Principal != null) {
      standardURlString=standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
    }
  }
  return standardURlString;
}
Program: 125747
Project: 125747
Buggy source:
private static boolean loadLibraries(DynamicClassLoader classLoader,String[] driversArray,boolean showDownloadIfNotExist){
  List<String> jarPathList=new ArrayList<String>();
  if (driversArray == null || driversArray.length == 0) {
    return true;
  }
  ILibraryManagerService librairesManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  String libPath=getLibPath();
  List<String> driverNotExist=new ArrayList<String>();
  for (  String driverName : driversArray) {
    String jarPath=libPath + PATH_SEPARATOR + driverName;
    File jarFile=new File(jarPath);
    if (!jarFile.exists()) {
      driverNotExist.add(driverName);
    }
    jarPathList.add(jarFile.getAbsolutePath());
  }
  boolean putInCache=false;
  if (!driverNotExist.isEmpty()) {
    putInCache=librairesManagerService.retrieve(driverNotExist,libPath,showDownloadIfNotExist,new NullProgressMonitor());
  }
  classLoader.setLibStorePath(libPath);
  classLoader.addLibraries(jarPathList);
  return putInCache;
}

Fixed version (ground truth):
private static boolean loadLibraries(DynamicClassLoader classLoader,String[] driversArray,boolean showDownloadIfNotExist){
  List<String> jarPathList=new ArrayList<String>();
  if (driversArray == null || driversArray.length == 0) {
    return true;
  }
  ILibraryManagerService librairesManagerService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  String libPath=getLibPath();
  List<String> driverNotExist=new ArrayList<String>();
  for (  String driverName : driversArray) {
    if (StringUtils.isNotEmpty(driverName)) {
      String jarPath=libPath + PATH_SEPARATOR + driverName;
      File jarFile=new File(jarPath);
      if (!jarFile.exists()) {
        driverNotExist.add(driverName);
      }
      jarPathList.add(jarFile.getAbsolutePath());
    }
  }
  boolean putInCache=false;
  if (!driverNotExist.isEmpty()) {
    putInCache=librairesManagerService.retrieve(driverNotExist,libPath,showDownloadIfNotExist,new NullProgressMonitor());
  }
  classLoader.setLibStorePath(libPath);
  classLoader.addLibraries(jarPathList);
  return putInCache;
}
Program: 125748
Project: 125748
Buggy source:
private static String getImpalaURLString(boolean supportContext,String server,String port,String sid,String Principal){
  String s=EDatabaseConnTemplate.IMPALA.getUrlTemplate(EDatabaseVersion4Drivers.IMPALA_CDH5);
  String standardURlString=getImpalaURlString(s,supportContext,server,port,sid);
  String principalSuffix="String_Node_Str";
  boolean hasPrinc=false;
  String[] urlArray=standardURlString.split(SEMICOLON);
  if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
    hasPrinc=true;
  }
  if (hasPrinc) {
    if (Principal == null) {
      standardURlString=standardURlString.substring(0,standardURlString.lastIndexOf(principalSuffix));
    }
  }
 else {
    if (Principal != null) {
      standardURlString=standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
    }
  }
  return standardURlString;
}

Fixed version (ground truth):
private static String getImpalaURLString(boolean supportContext,String server,String port,String sid,String Principal){
  String s=EDatabaseConnTemplate.IMPALA.getUrlTemplate(null);
  String standardURlString=getImpalaURlString(s,supportContext,server,port,sid);
  String principalSuffix="String_Node_Str";
  boolean hasPrinc=false;
  String[] urlArray=standardURlString.split(SEMICOLON);
  if (urlArray[urlArray.length - 1].startsWith(principalSuffix)) {
    hasPrinc=true;
  }
  if (hasPrinc) {
    if (Principal == null) {
      standardURlString=standardURlString.substring(0,standardURlString.lastIndexOf(principalSuffix));
    }
  }
 else {
    if (Principal != null) {
      standardURlString=standardURlString.concat(SEMICOLON).concat(principalSuffix).concat(Principal);
    }
  }
  return standardURlString;
}
Program: 125750
Project: 125750
Buggy source:
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;
}

Fixed version (ground truth):
public static Set<ModuleNeeded> getCodesModuleNeededs(ERepositoryObjectType type,boolean systemOnly){
  if (type == null) {
    return Collections.emptySet();
  }
  Set<ModuleNeeded> codesModules=new HashSet<ModuleNeeded>();
  if (type.equals(ERepositoryObjectType.ROUTINES)) {
    codesModules.addAll(collectModuleNeeded(new ArrayList<IRepositoryViewObject>(),new HashSet<String>(),true));
  }
  if (!systemOnly || !type.equals(ERepositoryObjectType.ROUTINES)) {
    codesModules.addAll(getModulesNeededForRoutines(type));
  }
  return codesModules;
}
Program: 125751
Project: 125751
Buggy source:
public static Set<ModuleNeeded> getRunningModules(){
  Set<ModuleNeeded> runningModules=new HashSet<ModuleNeeded>();
  runningModules.addAll(getCodesModuleNeededs(ERepositoryObjectType.ROUTINES));
  runningModules.addAll(getCodesModuleNeededs(ERepositoryObjectType.getType("String_Node_Str")));
  runningModules.addAll(getCodesModuleNeededs(ERepositoryObjectType.PIG_UDF));
  return runningModules;
}

Fixed version (ground truth):
public static Set<ModuleNeeded> getRunningModules(){
  Set<ModuleNeeded> runningModules=new HashSet<ModuleNeeded>();
  runningModules.addAll(getCodesModuleNeededs(ERepositoryObjectType.ROUTINES,true));
  runningModules.addAll(getCodesModuleNeededs(ERepositoryObjectType.getType("String_Node_Str"),true));
  runningModules.addAll(getCodesModuleNeededs(ERepositoryObjectType.PIG_UDF,true));
  return runningModules;
}
Program: 125752
Project: 125752
Buggy source:
@Override public Set<ModuleNeeded> getCodesModuleNeededs(ERepositoryObjectType type){
  return ModulesNeededProvider.getCodesModuleNeededs(type);
}

Fixed version (ground truth):
@Override public Set<ModuleNeeded> getCodesModuleNeededs(ERepositoryObjectType type){
  return ModulesNeededProvider.getCodesModuleNeededs(type,false);
}
Program: 125753
Project: 125753
Buggy source:
@Override public void checkInstalledLibraries(){
  Set<String> existLibraries=repositoryBundleService.list();
  List<String> modulesNeededNames=ModulesNeededProvider.getModulesNeededNames();
  ModulesNeededProvider.getUnUsedModules().clear();
  for (  String library : existLibraries) {
    if (!modulesNeededNames.contains(library)) {
      ModulesNeededProvider.userAddUnusedModules("String_Node_Str",library);
    }
  }
}

Fixed version (ground truth):
@Override public void checkInstalledLibraries(){
  repositoryBundleService.deployModules(ModulesNeededProvider.getCodesModuleNeededs(ERepositoryObjectType.ROUTINES,true),null);
  Set<String> existLibraries=repositoryBundleService.list();
  List<String> modulesNeededNames=ModulesNeededProvider.getModulesNeededNames();
  ModulesNeededProvider.getUnUsedModules().clear();
  for (  String library : existLibraries) {
    if (!modulesNeededNames.contains(library)) {
      ModulesNeededProvider.userAddUnusedModules("String_Node_Str",library);
    }
  }
}
Program: 125758
Project: 125758
Buggy source:
/** 
 * Added by Marvin Wang on Aug 10, 2012.
 */
protected void doHiveDistributionModify(){
  IHDistribution newHiveDistribution=getCurrentHiveDistribution(false);
  if (newHiveDistribution == null) {
    return;
  }
  String distributionObj=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
  IHDistribution originalHiveDistribution=HiveMetadataHelper.getDistribution(distributionObj,false);
  boolean doSupportMapRTicket=false;
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null && newHiveDistribution != null) {
    doSupportMapRTicket=hadoopService.doSupportMapRTicket(newHiveDistribution.getDefaultVersion());
  }
  useMaprTForHive.setEnabled(doSupportMapRTicket);
  hideControl(useMaprTForHive,!doSupportMapRTicket);
  hideControl(authenticationMaprTComForHive,!useMaprTForHive.getSelection());
  hideControl(authenticationUserPassComForHive,!useMaprTForHive.getSelection());
  if (originalHiveDistribution == null || !newHiveDistribution.equals(originalHiveDistribution)) {
    updateHiveVersionAndMakeSelection(newHiveDistribution,null);
    setHideVersionInfoWidgets(false);
    updateYarnInfo(newHiveDistribution,null);
    updateHiveModeAndMakeSelection(null);
    doHiveModeModify();
    fillDefaultsWhenHiveVersionChanged();
  }
}

Fixed version (ground truth):
/** 
 * Added by Marvin Wang on Aug 10, 2012.
 */
protected void doHiveDistributionModify(){
  IHDistribution newHiveDistribution=getCurrentHiveDistribution(false);
  if (newHiveDistribution == null) {
    return;
  }
  String distributionObj=getConnection().getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
  IHDistribution originalHiveDistribution=HiveMetadataHelper.getDistribution(distributionObj,false);
  boolean doSupportMapRTicket=false;
  IHadoopDistributionService hadoopService=getHadoopDistributionService();
  if (hadoopService != null && newHiveDistribution != null) {
    doSupportMapRTicket=hadoopService.doSupportMapRTicket(newHiveDistribution.getDefaultVersion());
  }
  hideControl(useMaprTForHive,!doSupportMapRTicket);
  hideControl(authenticationMaprTComForHive,!(useMaprTForHive.getSelection() && doSupportMapRTicket));
  hideControl(authenticationUserPassComForHive,useKerberos.getSelection() && doSupportMapRTicket);
  authenticationGrp.layout();
  authenticationGrp.getParent().layout();
  if (originalHiveDistribution == null || !newHiveDistribution.equals(originalHiveDistribution)) {
    updateHiveVersionAndMakeSelection(newHiveDistribution,null);
    setHideVersionInfoWidgets(false);
    updateYarnInfo(newHiveDistribution,null);
    updateHiveModeAndMakeSelection(null);
    doHiveModeModify();
    fillDefaultsWhenHiveVersionChanged();
  }
}
Program: 125762
Project: 125762
Buggy source:
public List<ComponentProperties> getAllComponentProperties(Connection connection);

Fixed version (ground truth):
/** 
 * Get all component properties which are related to the <code>connection</code>.
 * @param connection the connection.
 * @param tableLabel the table which need to consider the component properties along.
 * @return
 */
public List<ComponentProperties> getAllComponentProperties(Connection connection,String tableLabel);