nus-yam/ex-repair huggingface dataset:
Program: 124718
Project: 124718
Buggy source:
/** 
 * Builds a   {@link HadoopComponent} distribution.
 * @param pDistribution The name of the distribution
 * @param pVersion The name of the version
 * @return an implementation of {@link HadoopComponent}.
 * @throws Exception
 */
public static HadoopComponent buildDistribution(String pDistribution,String pVersion) throws Exception {
  BundleContext bc=FrameworkUtil.getBundle(DistributionFactory.class).getBundleContext();
  Collection<ServiceReference<HadoopComponent>> distributions=Collections.emptyList();
  try {
    distributions=bc.getServiceReferences(HadoopComponent.class,null);
  }
 catch (  InvalidSyntaxException e) {
    CommonExceptionHandler.process(e);
  }
  for (  ServiceReference<HadoopComponent> sr : distributions) {
    HadoopComponent np=bc.getService(sr);
    String thatDistribution=np.getDistribution();
    if (Constant.DISTRIBUTION_CUSTOM.equals(thatDistribution) && thatDistribution.equals(pDistribution)) {
      return np;
    }
    if (thatDistribution != null && thatDistribution.equals(pDistribution)) {
      String thatVersion=np.getVersion();
      if (thatVersion != null && thatVersion.equals(pVersion)) {
        return np;
      }
    }
  }
  throw new Exception("String_Node_Str" + pDistribution + "String_Node_Str"+ pVersion+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Builds a   {@link HadoopComponent} distribution.
 * @param pDistribution The name of the distribution
 * @param pVersion The name of the version
 * @return an implementation of {@link HadoopComponent}.
 * @throws Exception
 */
public static HadoopComponent buildDistribution(String pDistribution,String pVersion) throws Exception {
  final BundleContext bc=FrameworkUtil.getBundle(DistributionFactory.class).getBundleContext();
  if (hadoopDistributions == null) {
synchronized (HadoopDistributionsHelper.class) {
      if (hadoopDistributions == null) {
        try {
          hadoopDistributions=bc.getServiceReferences(HadoopComponent.class,null);
        }
 catch (        InvalidSyntaxException e) {
          CommonExceptionHandler.process(e);
        }
      }
    }
  }
  for (  ServiceReference<HadoopComponent> sr : hadoopDistributions) {
    HadoopComponent np=bc.getService(sr);
    String thatDistribution=np.getDistribution();
    if (Constant.DISTRIBUTION_CUSTOM.equals(thatDistribution) && thatDistribution.equals(pDistribution)) {
      return np;
    }
    if (thatDistribution != null && thatDistribution.equals(pDistribution)) {
      String thatVersion=np.getVersion();
      if (thatVersion != null && thatVersion.equals(pVersion)) {
        return np;
      }
    }
  }
  throw new Exception("String_Node_Str" + pDistribution + "String_Node_Str"+ pVersion+ "String_Node_Str");
}
Program: 124719
Project: 124719
Buggy source:
public void addModuleGroup(DistributionModuleGroup g){
  if (g != null) {
    DistributionVersionModule vm=new DistributionVersionModule(this);
    vm.moduleGrop=g;
    modulesNeeded.addAll(vm.getModulesNeeded());
    modules.add(vm);
  }
}

Fixed version (ground truth):
public void addModuleGroup(DistributionModuleGroup g){
  if (g != null) {
    DistributionVersionModule vm=new DistributionVersionModule(this);
    vm.moduleGrop=g;
    modules.add(vm);
  }
}
Program: 124720
Project: 124720
Buggy source:
public List<ModuleNeeded> getModulesNeeded(){
  return modulesNeeded;
}

Fixed version (ground truth):
public List<ModuleNeeded> getModulesNeeded(){
  if (modulesNeeded.isEmpty()) {
synchronized (DistributionVersion.class) {
      if (modulesNeeded.isEmpty()) {
        for (        DistributionVersionModule vm : modules) {
          modulesNeeded.addAll(vm.getModulesNeeded());
        }
      }
    }
  }
  return modulesNeeded;
}
Program: 124723
Project: 124723
Buggy source:
@Override protected boolean isValidResourceDelta(IResourceDelta delta){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=null;
    if ((repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) || (repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
      IProjectRepositoryNode root=repoNode.getRoot();
      if (root != null) {
        String projectName=root.getProject().getTechnicalLabel();
        topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
      }
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean isValidResourceDelta(IResourceDelta delta){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=null;
    if (repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) {
      IProjectRepositoryNode root=repoNode.getRoot();
      if (root != null) {
        String projectName=root.getProject().getTechnicalLabel();
        topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
      }
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
 else     if (repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER) {
      topLevelNodeWorkspaceRelativePath=getWorkspaceTopNodePath(repoNode);
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      return true;
    }
  }
  return false;
}
Program: 124724
Project: 124724
Buggy source:
protected ClassLoader addCustomConfsJarIfNeeded(ClassLoader baseLoader,HadoopServiceProperties serviceProperties){
  ClassLoader classLoader=baseLoader;
  if (serviceProperties.isUseCustomConfs()) {
    String clusterId=serviceProperties.getRelativeHadoopClusterId();
    if (baseLoader instanceof DynamicClassLoader && clusterId != null) {
      String customConfsJarName=HadoopParameterUtil.getConfsJarDefaultName(clusterId);
      try {
        classLoader=DynamicClassLoader.createNewOneBaseLoader((DynamicClassLoader)baseLoader,new String[]{customConfsJarName},null);
      }
 catch (      MalformedURLException e) {
        ExceptionHandler.process(e);
      }
    }
  }
  return classLoader;
}

Fixed version (ground truth):
protected ClassLoader addCustomConfsJarIfNeeded(ClassLoader baseLoader,HadoopServiceProperties serviceProperties){
  ClassLoader classLoader=baseLoader;
  if (serviceProperties.isUseCustomConfs()) {
    String clusterLabel=serviceProperties.getRelativeHadoopClusterLabel();
    if (classLoader instanceof DynamicClassLoader && clusterLabel != null) {
      String customConfsJarName=HadoopParameterUtil.getConfsJarDefaultName(clusterLabel);
      boolean confFileExist=false;
      Set<String> libraries=((DynamicClassLoader)classLoader).getLibraries();
      for (      String lib : libraries) {
        if (customConfsJarName.equals(lib)) {
          confFileExist=true;
          break;
        }
      }
      if (!confFileExist) {
        try {
          classLoader=DynamicClassLoader.createNewOneBaseLoader((DynamicClassLoader)baseLoader,new String[]{customConfsJarName},null);
        }
 catch (        MalformedURLException e) {
          ExceptionHandler.process(e);
        }
      }
    }
  }
  return classLoader;
}
Program: 124726
Project: 124726
Buggy source:
@Override protected boolean isValidResourceDelta(IResourceDelta delta){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=null;
    if ((repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) || (repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
      IProjectRepositoryNode root=repoNode.getRoot();
      if (root != null) {
        String projectName=root.getProject().getTechnicalLabel();
        topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
      }
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean isValidResourceDelta(IResourceDelta delta){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=null;
    if (repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) {
      IProjectRepositoryNode root=repoNode.getRoot();
      if (root != null) {
        String projectName=root.getProject().getTechnicalLabel();
        topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
      }
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
 else     if (repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER) {
      topLevelNodeWorkspaceRelativePath=getWorkspaceTopNodePath(repoNode);
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      return true;
    }
  }
  return false;
}
Program: 124736
Project: 124736
Buggy source:
private void hideMaprTicketChildControl(boolean hide){
  maprTClusterText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTDurationText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTHomeDirText.setEditable(!hide && setMaprTHomeDirBtn.isEnabled() && setMaprTHomeDirBtn.getSelection());
  maprTHadoopLoginText.setEditable(!hide && setHadoopLoginBtn.isEnabled() && setHadoopLoginBtn.getSelection());
  hideControl(maprTPCDCompposite,hide);
  hideControl(maprTSetComposite,hide);
  authMaprTComposite.layout();
  authMaprTComposite.getParent().layout();
}

Fixed version (ground truth):
private void hideMaprTicketChildControl(boolean hide){
  maprTClusterText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTDurationText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTHomeDirText.setEditable(!hide && setMaprTHomeDirBtn.isEnabled() && setMaprTHomeDirBtn.getSelection());
  maprTHadoopLoginText.setEditable(!hide && setHadoopLoginBtn.isEnabled() && setHadoopLoginBtn.getSelection());
  hideControl(maprTPasswordCompposite,kerberosBtn.getSelection() && maprTBtn.getSelection());
  hideControl(maprTPCDCompposite,hide);
  hideControl(maprTSetComposite,hide);
  authMaprTComposite.layout();
  authMaprTComposite.getParent().layout();
}
Program: 124737
Project: 124737
Buggy source:
@Override public ExecutionResult execute(Item item){
  ILibraryManagerService libService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
    libService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  }
  if (libService == null) {
    return null;
  }
  if (item instanceof HadoopClusterConnectionItem) {
    HadoopClusterConnectionItem hcItem=(HadoopClusterConnectionItem)item;
    HadoopClusterConnection connection=(HadoopClusterConnection)hcItem.getConnection();
    if (connection.getConfFile() == null) {
      String confJarName=HadoopParameterUtil.getConfsJarDefaultName(hcItem.getProperty().getId());
      File confsTempFolder=new File(HadoopConfsUtils.getConfsJarTempFolder());
      boolean retrieved=libService.retrieve(confJarName,confsTempFolder.getAbsolutePath(),false);
      File confJarFile=new File(confsTempFolder,confJarName);
      if (retrieved && confJarFile.exists()) {
        try {
          connection.setConfFile(FileUtils.readFileToByteArray(confJarFile));
          ProxyRepositoryFactory.getInstance().save(hcItem,true);
          return ExecutionResult.SUCCESS_WITH_ALERT;
        }
 catch (        Exception e) {
          ExceptionHandler.process(e);
          return ExecutionResult.FAILURE;
        }
      }
    }
  }
  return ExecutionResult.NOTHING_TO_DO;
}

Fixed version (ground truth):
@Override public ExecutionResult execute(Item item){
  ILibraryManagerService libService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
    libService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  }
  if (libService == null) {
    return ExecutionResult.NOTHING_TO_DO;
  }
  if (item instanceof HadoopClusterConnectionItem) {
    HadoopClusterConnectionItem hcItem=(HadoopClusterConnectionItem)item;
    HadoopClusterConnection connection=(HadoopClusterConnection)hcItem.getConnection();
    if (connection.getConfFile() == null) {
      String confJarName=HadoopParameterUtil.getConfsJarDefaultName(hcItem.getProperty().getId());
      if (!libService.contains(confJarName)) {
        return ExecutionResult.NOTHING_TO_DO;
      }
      File confsTempFolder=new File(HadoopConfsUtils.getConfsJarTempFolder());
      boolean retrieved=libService.retrieve(confJarName,confsTempFolder.getAbsolutePath(),false);
      File confJarFile=new File(confsTempFolder,confJarName);
      if (retrieved && confJarFile.exists()) {
        try {
          connection.setConfFile(FileUtils.readFileToByteArray(confJarFile));
          ProxyRepositoryFactory.getInstance().save(hcItem,true);
          return ExecutionResult.SUCCESS_WITH_ALERT;
        }
 catch (        Exception e) {
          ExceptionHandler.process(e);
          return ExecutionResult.FAILURE;
        }
      }
    }
  }
  return ExecutionResult.NOTHING_TO_DO;
}
Program: 124740
Project: 124740
Buggy source:
private Map<HadoopHostedService,HadoopClusterService> getHostedServicesForOld(List<String> servicesName){
  Map<String,Map<String,String>> actualConfigVersion=getActualConfigVersion();
  Map<HadoopHostedService,HadoopClusterService> servicesMapping=new HashMap<>();
  for (  String serviceName : servicesName) {
    servicesMapping.put(HadoopHostedService.fromString(serviceName),new HadoopAmbariClusterService(getConfigFiles(actualConfigVersion.get(serviceName))));
  }
  return servicesMapping;
}

Fixed version (ground truth):
private Map<HadoopHostedService,HadoopClusterService> getHostedServicesForOld(List<String> servicesName){
  Map<String,Map<String,String>> actualConfigVersion=getActualConfigVersion();
  Map<HadoopHostedService,HadoopClusterService> servicesMapping=new HashMap<>();
  for (  String serviceName : servicesName) {
    servicesMapping.put(HadoopHostedService.fromString(serviceName),new HadoopAmbariClusterService(getConfigFiles(actualConfigVersion.get(serviceName)),blacklistParams));
  }
  return servicesMapping;
}
Program: 124741
Project: 124741
Buggy source:
private Map<HadoopHostedService,HadoopClusterService> distributeConfigFilesToService(String serviceName,List<ApiConfigFile> configs){
  Map<HadoopHostedService,HadoopClusterService> servicesMapping=new HashMap<HadoopHostedService,HadoopClusterService>();
  HadoopHostedService service=HadoopHostedService.fromString(serviceName);
  if (service == HadoopHostedService.HIVE) {
    ApiConfigFile hcatalogConfig=null;
    for (    ApiConfigFile file : configs) {
      if ("String_Node_Str".equals(file.getType())) {
        hcatalogConfig=file;
        break;
      }
    }
    if (hcatalogConfig != null) {
      configs.remove(hcatalogConfig);
      servicesMapping.put(HadoopHostedService.WEBHCAT,new HadoopAmbariClusterService(Arrays.asList(hcatalogConfig)));
    }
  }
  servicesMapping.put(service,new HadoopAmbariClusterService(configs));
  return servicesMapping;
}

Fixed version (ground truth):
private Map<HadoopHostedService,HadoopClusterService> distributeConfigFilesToService(String serviceName,List<ApiConfigFile> configs){
  Map<HadoopHostedService,HadoopClusterService> servicesMapping=new HashMap<HadoopHostedService,HadoopClusterService>();
  HadoopHostedService service=HadoopHostedService.fromString(serviceName);
  if (service == HadoopHostedService.HIVE) {
    ApiConfigFile hcatalogConfig=null;
    for (    ApiConfigFile file : configs) {
      if ("String_Node_Str".equals(file.getType())) {
        hcatalogConfig=file;
        break;
      }
    }
    if (hcatalogConfig != null) {
      configs.remove(hcatalogConfig);
      servicesMapping.put(HadoopHostedService.WEBHCAT,new HadoopAmbariClusterService(Arrays.asList(hcatalogConfig),blacklistParams));
    }
  }
  servicesMapping.put(service,new HadoopAmbariClusterService(configs,blacklistParams));
  return servicesMapping;
}
Program: 124742
Project: 124742
Buggy source:
private void init(){
  confs=new HashMap<>();
  for (  ApiConfigFile file : configFiles) {
    String type=file.getType();
    if (!type.endsWith(SUPPORT_FILE)) {
      continue;
    }
    Configuration conf=new Configuration(false);
    Map<String,String> properties=file.getProperties();
    for (    String key : properties.keySet()) {
      conf.set(key,properties.get(key));
    }
    confs.put(type,conf);
  }
}

Fixed version (ground truth):
private void init(List<String> blacklistParams){
  confs=new HashMap<>();
  for (  ApiConfigFile file : configFiles) {
    String type=file.getType();
    if (!type.endsWith(SUPPORT_FILE)) {
      continue;
    }
    Configuration conf=new Configuration(false);
    Map<String,String> properties=file.getProperties();
    for (    String key : properties.keySet()) {
      if (blacklistParams != null && blacklistParams.contains(key)) {
        continue;
      }
      conf.set(key,properties.get(key));
    }
    confs.put(type,conf);
  }
}
Program: 124743
Project: 124743
Buggy source:
/** 
 * DOC bchen HadoopAmbariClusterService constructor comment.
 */
public HadoopAmbariClusterService(List<ApiConfigFile> configFiles){
  this.configFiles=configFiles;
  init();
}

Fixed version (ground truth):
/** 
 * DOC bchen HadoopAmbariClusterService constructor comment.
 */
public HadoopAmbariClusterService(List<ApiConfigFile> configFiles,List<String> blacklistParams){
  this.configFiles=configFiles;
  init(blacklistParams);
}
Program: 124744
Project: 124744
Buggy source:
@Override public Map<HadoopHostedService,HadoopClusterService> getHostedServices(){
  ApiServiceList services=cluster.readServices(DataView.SUMMARY);
  Map<HadoopHostedService,HadoopClusterService> servicesMapping=new HashMap<HadoopHostedService,HadoopClusterService>();
  for (  ApiService service : services.getServices()) {
    if (HadoopHostedService.isSupport(service.getType())) {
      HadoopCMClusterService clusterService=new HadoopCMClusterService(service.getName(),cluster);
      if (clusterService.hasConfigurations()) {
        servicesMapping.put(HadoopHostedService.fromString(service.getType()),clusterService);
      }
    }
  }
  return servicesMapping;
}

Fixed version (ground truth):
@Override public Map<HadoopHostedService,HadoopClusterService> getHostedServices(){
  ApiServiceList services=cluster.readServices(DataView.SUMMARY);
  Map<HadoopHostedService,HadoopClusterService> servicesMapping=new HashMap<HadoopHostedService,HadoopClusterService>();
  for (  ApiService service : services.getServices()) {
    if (HadoopHostedService.isSupport(service.getType())) {
      HadoopCMClusterService clusterService=new HadoopCMClusterService(service.getName(),cluster,blacklistParams);
      if (clusterService.hasConfigurations()) {
        servicesMapping.put(HadoopHostedService.fromString(service.getType()),clusterService);
      }
    }
  }
  return servicesMapping;
}
Program: 124746
Project: 124746
Buggy source:
/** 
 * DOC bchen HadoopCMClusterService constructor comment.
 * @param cluster
 */
public HadoopCMClusterService(String serviceName,ServicesResourceV3 cluster){
  this.serviceName=serviceName;
  this.cluster=cluster;
  init();
}

Fixed version (ground truth):
/** 
 * DOC bchen HadoopCMClusterService constructor comment.
 * @param cluster
 */
public HadoopCMClusterService(String serviceName,ServicesResourceV3 cluster,List<String> blacklistParams){
  this.serviceName=serviceName;
  this.cluster=cluster;
  init(blacklistParams);
}
Program: 124747
Project: 124747
Buggy source:
private void hideMaprTicketChildControl(boolean hide){
  maprTClusterText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTDurationText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTHomeDirText.setEditable(!hide && setMaprTHomeDirBtn.isEnabled() && setMaprTHomeDirBtn.getSelection());
  maprTHadoopLoginText.setEditable(!hide && setHadoopLoginBtn.isEnabled() && setHadoopLoginBtn.getSelection());
  hideControl(maprTPCDCompposite,hide);
  hideControl(maprTSetComposite,hide);
  authMaprTComposite.layout();
  authMaprTComposite.getParent().layout();
}

Fixed version (ground truth):
private void hideMaprTicketChildControl(boolean hide){
  maprTClusterText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTDurationText.setEditable(maprTBtn.isEnabled() && maprTBtn.getSelection());
  maprTHomeDirText.setEditable(!hide && setMaprTHomeDirBtn.isEnabled() && setMaprTHomeDirBtn.getSelection());
  maprTHadoopLoginText.setEditable(!hide && setHadoopLoginBtn.isEnabled() && setHadoopLoginBtn.getSelection());
  hideControl(maprTPasswordCompposite,kerberosBtn.getSelection() && maprTBtn.getSelection());
  hideControl(maprTPCDCompposite,hide);
  hideControl(maprTSetComposite,hide);
  authMaprTComposite.layout();
  authMaprTComposite.getParent().layout();
}
Program: 124751
Project: 124751
Buggy source:
public static String getConfsJarDefaultName(String itemId){
  return CONFS_JAR_PREFIX.concat(itemId).concat(CONFS_JAR_EXT);
}

Fixed version (ground truth):
public static String getConfsJarDefaultName(String uid){
  return CONFS_JAR_PREFIX.concat(uid).concat(CONFS_JAR_EXT);
}
Program: 124752
Project: 124752
Buggy source:
@Override public ExecutionResult execute(Item item){
  ILibraryManagerService libService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
    libService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  }
  if (libService == null) {
    return null;
  }
  if (item instanceof HadoopClusterConnectionItem) {
    HadoopClusterConnectionItem hcItem=(HadoopClusterConnectionItem)item;
    HadoopClusterConnection connection=(HadoopClusterConnection)hcItem.getConnection();
    if (connection.getConfFile() == null) {
      String confJarName=HadoopParameterUtil.getConfsJarDefaultName(hcItem.getProperty().getId());
      File confsTempFolder=new File(HadoopConfsUtils.getConfsJarTempFolder());
      boolean retrieved=libService.retrieve(confJarName,confsTempFolder.getAbsolutePath(),false);
      File confJarFile=new File(confsTempFolder,confJarName);
      if (retrieved && confJarFile.exists()) {
        try {
          connection.setConfFile(FileUtils.readFileToByteArray(confJarFile));
          return ExecutionResult.SUCCESS_WITH_ALERT;
        }
 catch (        IOException e) {
          ExceptionHandler.process(e);
          return ExecutionResult.FAILURE;
        }
      }
    }
  }
  return ExecutionResult.NOTHING_TO_DO;
}

Fixed version (ground truth):
@Override public ExecutionResult execute(Item item){
  ILibraryManagerService libService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
    libService=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  }
  if (libService == null) {
    return null;
  }
  if (item instanceof HadoopClusterConnectionItem) {
    HadoopClusterConnectionItem hcItem=(HadoopClusterConnectionItem)item;
    HadoopClusterConnection connection=(HadoopClusterConnection)hcItem.getConnection();
    if (connection.getConfFile() == null) {
      String confJarName=HadoopParameterUtil.getConfsJarDefaultName(hcItem.getProperty().getId());
      File confsTempFolder=new File(HadoopConfsUtils.getConfsJarTempFolder());
      boolean retrieved=libService.retrieve(confJarName,confsTempFolder.getAbsolutePath(),false);
      File confJarFile=new File(confsTempFolder,confJarName);
      if (retrieved && confJarFile.exists()) {
        try {
          connection.setConfFile(FileUtils.readFileToByteArray(confJarFile));
          ProxyRepositoryFactory.getInstance().save(hcItem,true);
          return ExecutionResult.SUCCESS_WITH_ALERT;
        }
 catch (        Exception e) {
          ExceptionHandler.process(e);
          return ExecutionResult.FAILURE;
        }
      }
    }
  }
  return ExecutionResult.NOTHING_TO_DO;
}
Program: 124754
Project: 124754
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  namenodeUriText.setReadOnly(readOnly);
  jobtrackerUriText.setReadOnly(readOnly);
  rmSchedulerText.setReadOnly(readOnly);
  jobHistoryText.setReadOnly(readOnly);
  stagingDirectoryText.setReadOnly(readOnly);
  useDNHostBtn.setEnabled(!readOnly);
  useCustomConfBtn.setEnabled(!readOnly);
  hadoopConfsButton.setEnabled(!readOnly && useCustomConfBtn.getSelection());
  if (useClouderaNaviBtn != null) {
    useClouderaNaviBtn.setEnabled(!readOnly);
    clouderaNaviButton.setEnabled(!readOnly && useClouderaNaviBtn.getSelection());
  }
  kerberosBtn.setEnabled(!readOnly);
  namenodePrincipalText.setReadOnly(readOnly);
  jtOrRmPrincipalText.setReadOnly(readOnly);
  jobHistoryPrincipalText.setReadOnly(readOnly);
  userNameText.setReadOnly(readOnly);
  groupText.setReadOnly(readOnly);
  kerberosBtn.setEnabled(!readOnly);
  namenodePrincipalText.setReadOnly(readOnly);
  jtOrRmPrincipalText.setReadOnly(readOnly);
  jobHistoryPrincipalText.setReadOnly(readOnly);
  userNameText.setReadOnly(readOnly);
  groupText.setReadOnly(readOnly);
  maprTBtn.setEnabled(!readOnly);
  maprTPasswordText.setReadOnly(readOnly);
  maprTClusterText.setReadOnly(readOnly);
  maprTDurationText.setReadOnly(readOnly);
  setMaprTHomeDirBtn.setEnabled(!readOnly);
  setHadoopLoginBtn.setEnabled(!readOnly);
  preloadAuthentificationBtn.setEnabled(!readOnly);
  maprTHomeDirText.setReadOnly(readOnly);
  maprTHadoopLoginText.setReadOnly(readOnly);
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  namenodeUriText.setReadOnly(readOnly);
  jobtrackerUriText.setReadOnly(readOnly);
  rmSchedulerText.setReadOnly(readOnly);
  jobHistoryText.setReadOnly(readOnly);
  stagingDirectoryText.setReadOnly(readOnly);
  useDNHostBtn.setEnabled(!readOnly);
  useCustomConfBtn.setEnabled(!readOnly);
  hadoopConfsButton.setEnabled(!readOnly && useCustomConfBtn.getSelection());
  if (useClouderaNaviBtn != null) {
    useClouderaNaviBtn.setEnabled(!readOnly);
    clouderaNaviButton.setEnabled(!readOnly && useClouderaNaviBtn.getSelection());
  }
  kerberosBtn.setEnabled(!readOnly);
  namenodePrincipalText.setReadOnly(readOnly);
  jtOrRmPrincipalText.setReadOnly(readOnly);
  jobHistoryPrincipalText.setReadOnly(readOnly);
  userNameText.setReadOnly(readOnly);
  groupText.setReadOnly(readOnly);
  maprTBtn.setEnabled(!readOnly);
  maprTPasswordText.setReadOnly(readOnly);
  maprTClusterText.setReadOnly(readOnly);
  maprTDurationText.setReadOnly(readOnly);
  setMaprTHomeDirBtn.setEnabled(!readOnly);
  setHadoopLoginBtn.setEnabled(!readOnly);
  preloadAuthentificationBtn.setEnabled(!readOnly);
  maprTHomeDirText.setReadOnly(readOnly);
  maprTHadoopLoginText.setReadOnly(readOnly);
}
Program: 124755
Project: 124755
Buggy source:
/** 
 * is current hadoop version support JobHistoryPrincipal
 * @return
 */
protected boolean isCurrentHadoopVersionSupportJobHistoryPrincipal(){
  if (hadoopDistribution == null || hadoopVersison == null) {
    return false;
  }
  boolean isSupport=false;
  if (hadoopVersison.version != null && (hadoopVersison.version.equals(EHadoopVersion4Drivers.MICROSOFT_HD_INSIGHT_3_1.getVersionValue()) || hadoopVersison.version.equals(EHadoopVersion4Drivers.MICROSOFT_HD_INSIGHT_3_2.getVersionValue()))) {
    return false;
  }
 else {
    if (hadoopDistribution.useCustom()) {
      return true;
    }
 else {
      List<String> supportVersions=new ArrayList<String>();
      supportVersions.add(EHadoopVersion4Drivers.PIVOTAL_HD_1_0_1.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.PIVOTAL_HD_2_0.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.HDP_2_0.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.HDP_2_1.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.HDP_2_2.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.HDP_2_3.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.CLOUDERA_CDH4_YARN.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.CLOUDERA_CDH5.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.CLOUDERA_CDH5_1.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.CLOUDERA_CDH5_4.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.CLOUDERA_CDH5_5.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.MAPR401.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.MAPR500.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.APACHE_2_4_0_EMR.getVersionValue());
      supportVersions.add(EHadoopVersion4Drivers.EMR_4_0_0.getVersionValue());
      isSupport=supportVersions.contains(hadoopVersison.version);
    }
  }
  return isSupport;
}

Fixed version (ground truth):
private boolean isCurrentHadoopVersionSupportJobHistoryPrincipal(){
  return isCurrentHadoopVersionSupportSecurity() && (isCurrentHadoopVersionSupportYarn() || hadoopDistribution.useCustom());
}
Program: 124759
Project: 124759
Buggy source:
@Override public boolean doSupportKerberos(){
  return false;
}

Fixed version (ground truth):
@Override public boolean doSupportKerberos(){
  return true;
}
Program: 124761
Project: 124761
Buggy source:
public static String getConfsJarDefaultName(String itemId){
  return CONFS_JAR_PREFIX.concat(itemId).concat(CONFS_JAR_EXT);
}

Fixed version (ground truth):
public static String getConfsJarDefaultName(String uid){
  return CONFS_JAR_PREFIX.concat(uid).concat(CONFS_JAR_EXT);
}
Program: 124770
Project: 124770
Buggy source:
public void setHadoopVersionValue(String hadoopVersionValue){
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService == null) {
    return;
  }
  IHDistributionVersion hadoopDistributionVersion=hadoopDistributionService.getHadoopDistributionVersion(hadoopVersionValue,false);
  String originalVersionValue=getHadoopVersionValue();
  if (hadoopDistributionVersion != null && hadoopDistributionVersion.getVersion() != null && !hadoopDistributionVersion.getVersion().equals(originalVersionValue) && hadoopDistributionVersion.getDisplayVersion() != null) {
    hadoopVersionCombo.setText(hadoopDistributionVersion.getDisplayVersion());
  }
 else {
    hadoopVersionCombo.select(0);
  }
}

Fixed version (ground truth):
public void setHadoopVersionValue(String hadoopVersionValue){
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService == null) {
    return;
  }
  IHDistributionVersion hadoopDistributionVersion=hadoopDistributionService.getHadoopDistributionVersion(hadoopVersionValue,false);
  String originalVersionValue=getHadoopVersionValue();
  if (hadoopDistributionVersion != null && hadoopDistributionVersion.getVersion() != null && hadoopDistributionVersion.getDisplayVersion() != null) {
    if (hadoopDistributionVersion.getVersion().equals(originalVersionValue)) {
      return;
    }
 else {
      hadoopVersionCombo.setText(hadoopDistributionVersion.getDisplayVersion());
    }
  }
 else {
    hadoopVersionCombo.select(0);
  }
}
Program: 124777
Project: 124777
Buggy source:
private void initCommonProperties(HadoopServiceProperties properties){
  HadoopClusterConnection connection=getConnection();
  ContextType contextType=null;
  if (getConnection().isContextMode()) {
    contextType=ConnectionContextHelper.getContextTypeForContextMode(connection);
  }
  properties.setContextType(contextType);
  properties.setDistribution(connection.getDistribution());
  properties.setVersion(connection.getDfVersion());
  properties.setGroup(connection.getGroup());
  properties.setUseKrb(connection.isEnableKerberos());
  properties.setCustom(connection.isUseCustomVersion());
  properties.setUseCustomConfs(connection.isUseCustomConfs());
  properties.setPrincipal(connection.getPrincipal());
  properties.setJtOrRmPrincipal(connection.getJtOrRmPrincipal());
  properties.setJobHistoryPrincipal(connection.getJobHistoryPrincipal());
  properties.setUseKeytab(connection.isUseKeytab());
  properties.setKeytabPrincipal(connection.getKeytabPrincipal());
  properties.setKeytab(connection.getKeytab());
  properties.setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesList(connection.getHadoopProperties()));
  properties.setRelativeHadoopClusterId(connectionItem.getProperty().getId());
}

Fixed version (ground truth):
private void initCommonProperties(HadoopServiceProperties properties){
  HadoopClusterConnection connection=getConnection();
  ContextType contextType=null;
  if (getConnection().isContextMode()) {
    contextType=ConnectionContextHelper.getContextTypeForContextMode(connection);
  }
  properties.setContextType(contextType);
  properties.setDistribution(connection.getDistribution());
  properties.setVersion(connection.getDfVersion());
  properties.setGroup(connection.getGroup());
  properties.setUseKrb(connection.isEnableKerberos());
  properties.setCustom(connection.isUseCustomVersion());
  properties.setUseCustomConfs(connection.isUseCustomConfs());
  properties.setPrincipal(connection.getPrincipal());
  properties.setJtOrRmPrincipal(connection.getJtOrRmPrincipal());
  properties.setJobHistoryPrincipal(connection.getJobHistoryPrincipal());
  properties.setUseKeytab(connection.isUseKeytab());
  properties.setKeytabPrincipal(connection.getKeytabPrincipal());
  properties.setKeytab(connection.getKeytab());
  properties.setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesList(connection.getHadoopProperties()));
  properties.setRelativeHadoopClusterId(connectionItem.getProperty().getId());
  properties.setMaprT(connection.isEnableMaprT());
  properties.setUserName(connection.getUserName());
  properties.setMaprTPassword(connection.getMaprTPassword());
  properties.setMaprTCluster(connection.getMaprTCluster());
  properties.setMaprTDuration(connection.getMaprTDuration());
  properties.setSetMaprTHomeDir(connection.isSetMaprTHomeDir());
  properties.setSetHadoopLogin(connection.isSetHadoopLogin());
  properties.setPreloadAuthentification(connection.isPreloadAuthentification());
  properties.setMaprTHomeDir(connection.getMaprTHomeDir());
  properties.setMaprTHadoopLogin(connection.getMaprTHadoopLogin());
}
Program: 124779
Project: 124779
Buggy source:
@Test public void testDoSupportSecurity(){
  String messages="String_Node_Str";
  HiveModeInfo hiveMode=HiveModeInfo.EMBEDDED;
  HiveServerVersionInfo hiveServer=HiveServerVersionInfo.HIVE_SERVER_2;
  assertThat(MessageFormat.format(messages,hiveMode.getDisplayName(),hiveServer.getKey()),HiveMetadataHelper.doSupportSecurity(getDistribution(),getDistributionVersion(),hiveMode.getName(),hiveServer.getKey(),false),is(isSupportSecurity()));
  hiveServer=HiveServerVersionInfo.HIVE_SERVER_1;
  assertThat(MessageFormat.format(messages,hiveMode.getDisplayName(),hiveServer.getKey()),HiveMetadataHelper.doSupportSecurity(getDistribution(),getDistributionVersion(),hiveMode.getName(),hiveServer.getKey(),false),is(isSupportSecurity()));
  hiveServer=HiveServerVersionInfo.HIVE_SERVER_2;
  hiveMode=HiveModeInfo.STANDALONE;
  assertThat(MessageFormat.format(messages,hiveMode.getDisplayName(),hiveServer.getKey()),HiveMetadataHelper.doSupportSecurity(getDistribution(),getDistributionVersion(),hiveMode.getName(),hiveServer.getKey(),false),is(isSupportSecurity()));
}

Fixed version (ground truth):
@Test public void testDoSupportSecurity(){
  String messages="String_Node_Str";
  HiveModeInfo hiveMode=HiveModeInfo.EMBEDDED;
  HiveServerVersionInfo hiveServer=HiveServerVersionInfo.HIVE_SERVER_2;
  assertTrue(MessageFormat.format(messages,hiveMode.getDisplayName(),hiveServer.getKey()),HiveMetadataHelper.doSupportSecurity(getDistribution(),getDistributionVersion(),hiveMode.getName(),hiveServer.getKey(),false) == isSupportSecurity());
  hiveServer=HiveServerVersionInfo.HIVE_SERVER_1;
  assertTrue(MessageFormat.format(messages,hiveMode.getDisplayName(),hiveServer.getKey()),HiveMetadataHelper.doSupportSecurity(getDistribution(),getDistributionVersion(),hiveMode.getName(),hiveServer.getKey(),false) == isSupportSecurity());
  hiveServer=HiveServerVersionInfo.HIVE_SERVER_2;
  hiveMode=HiveModeInfo.STANDALONE;
  assertTrue(MessageFormat.format(messages,hiveMode.getDisplayName(),hiveServer.getKey()),HiveMetadataHelper.doSupportSecurity(getDistribution(),getDistributionVersion(),hiveMode.getName(),hiveServer.getKey(),false) == isSupportSecurity());
}
Program: 124780
Project: 124780
Buggy source:
@Test public void testDoSupportTez(){
  assertThat(HiveMetadataHelper.doSupportTez(getDistribution(),getDistributionVersion(),false),is(isSupportTez()));
}

Fixed version (ground truth):
@Test public void testDoSupportTez(){
  assertTrue(HiveMetadataHelper.doSupportTez(getDistribution(),getDistributionVersion(),false) == isSupportTez());
}
Program: 124786
Project: 124786
Buggy source:
public HDFSSchemaWizard(IWorkbench workbench,boolean creation,IRepositoryViewObject object,MetadataTable metadataTable,String[] existingNames,boolean forceReadOnly){
  super(workbench,creation,forceReadOnly);
  this.selectedMetadataTable=metadataTable;
  this.connectionItem=(ConnectionItem)object.getProperty().getItem();
  this.existingNames=existingNames;
  if (connectionItem != null) {
    oldTableMap=RepositoryUpdateManager.getOldTableIdAndNameMap(connectionItem,metadataTable,creation);
    oldMetadataTable=RepositoryUpdateManager.getConversionMetadataTables(connectionItem.getConnection());
    cloneBaseHDFSConnection((HDFSConnection)connectionItem.getConnection());
  }
  setNeedsProgressMonitor(true);
  setRepositoryObject(object);
  isRepositoryObjectEditable();
  initLockStrategy();
}

Fixed version (ground truth):
public HDFSSchemaWizard(IWorkbench workbench,boolean creation,IRepositoryViewObject object,MetadataTable metadataTable,String[] existingNames,boolean forceReadOnly){
  super(workbench,creation,forceReadOnly);
  this.selectedMetadataTable=metadataTable;
  this.connectionItem=(ConnectionItem)object.getProperty().getItem();
  this.existingNames=existingNames;
  if (connectionItem != null) {
    oldTableMap=RepositoryUpdateManager.getOldTableIdAndNameMap(connectionItem,metadataTable,creation);
    oldMetadataTable=RepositoryUpdateManager.getConversionMetadataTables(connectionItem.getConnection());
    connection=(HDFSConnection)connectionItem.getConnection();
  }
  setNeedsProgressMonitor(true);
  setRepositoryObject(object);
  isRepositoryObjectEditable();
  initLockStrategy();
}
Program: 124787
Project: 124787
Buggy source:
@Override public boolean performCancel(){
  if (fileSelectorWizardPage != null) {
    fileSelectorWizardPage.performCancel();
  }
  temConnection=null;
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (fileSelectorWizardPage != null) {
    fileSelectorWizardPage.performCancel();
  }
  connection=null;
  return super.performCancel();
}
Program: 124788
Project: 124788
Buggy source:
@Override public void addPages(){
  setWindowTitle("String_Node_Str");
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(ECoreImage.METADATA_TABLE_WIZ));
  schemaWizardPage=new HDFSSchemaWizardPage(selectedMetadataTable,connectionItem,isRepositoryObjectEditable(),temConnection);
  if (creation) {
    fileSelectorWizardPage=new HDFSFileSelectorWizardPage(connectionItem,isRepositoryObjectEditable(),temConnection);
    fileSelectorWizardPage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    fileSelectorWizardPage.setDescription(Messages.getString("String_Node_Str"));
    fileSelectorWizardPage.setPageComplete(true);
    addPage(fileSelectorWizardPage);
    schemaWizardPage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    schemaWizardPage.setDescription(Messages.getString("String_Node_Str"));
    schemaWizardPage.setPageComplete(false);
    addPage(schemaWizardPage);
  }
 else {
    schemaWizardPage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    schemaWizardPage.setDescription(Messages.getString("String_Node_Str"));
    schemaWizardPage.setPageComplete(false);
    addPage(schemaWizardPage);
  }
}

Fixed version (ground truth):
@Override public void addPages(){
  setWindowTitle("String_Node_Str");
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(ECoreImage.METADATA_TABLE_WIZ));
  schemaWizardPage=new HDFSSchemaWizardPage(selectedMetadataTable,connectionItem,isRepositoryObjectEditable(),connection);
  if (creation) {
    fileSelectorWizardPage=new HDFSFileSelectorWizardPage(connectionItem,isRepositoryObjectEditable(),connection);
    fileSelectorWizardPage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    fileSelectorWizardPage.setDescription(Messages.getString("String_Node_Str"));
    fileSelectorWizardPage.setPageComplete(true);
    addPage(fileSelectorWizardPage);
    schemaWizardPage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    schemaWizardPage.setDescription(Messages.getString("String_Node_Str"));
    schemaWizardPage.setPageComplete(false);
    addPage(schemaWizardPage);
  }
 else {
    schemaWizardPage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    schemaWizardPage.setDescription(Messages.getString("String_Node_Str"));
    schemaWizardPage.setPageComplete(false);
    addPage(schemaWizardPage);
  }
}
Program: 124789
Project: 124789
Buggy source:
@Override public void run(IProgressMonitor monitor) throws CoreException {
  connectionItem.setConnection(temConnection);
  saveMetaData();
  RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
  closeLockStrategy();
  temConnection=null;
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws CoreException {
  saveMetaData();
  RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
  closeLockStrategy();
  connection=null;
}
Program: 124790
Project: 124790
Buggy source:
@Override public boolean performFinish(){
  if (schemaWizardPage.isPageComplete()) {
    IWorkspace workspace=ResourcesPlugin.getWorkspace();
    IWorkspaceRunnable operation=new IWorkspaceRunnable(){
      @Override public void run(      IProgressMonitor monitor) throws CoreException {
        connectionItem.setConnection(temConnection);
        saveMetaData();
        RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
        closeLockStrategy();
        temConnection=null;
      }
    }
;
    try {
      workspace.run(operation,null);
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (schemaWizardPage.isPageComplete()) {
    IWorkspace workspace=ResourcesPlugin.getWorkspace();
    IWorkspaceRunnable operation=new IWorkspaceRunnable(){
      @Override public void run(      IProgressMonitor monitor) throws CoreException {
        saveMetaData();
        RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
        closeLockStrategy();
        connection=null;
      }
    }
;
    try {
      workspace.run(operation,null);
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 124791
Project: 124791
Buggy source:
protected JSONObject loadDefaultConfigurations(){
  JSONObject globalJson=DefaultConfigurationManager.loadDefaultFile(AbstractDistribution.class,getDistribution().toLowerCase());
  if (getVersion() != null) {
    JSONObject versionJson=DefaultConfigurationManager.loadDefaultFile(this.getClass(),getVersion().toLowerCase());
    return JSONUtil.merge(globalJson,versionJson);
  }
  return globalJson;
}

Fixed version (ground truth):
protected JSONObject loadDefaultConfigurations(){
  JSONObject globalJson=DefaultConfigurationManager.loadDefaultFile(AbstractDistribution.class,getDistribution().toLowerCase());
  if (getVersion() != null) {
    JSONObject versionJson=DefaultConfigurationManager.loadDefaultFile(this.getClass(),getVersion().toLowerCase());
    return JSONUtil.merge(versionJson,globalJson);
  }
  return globalJson;
}
Program: 124792
Project: 124792
Buggy source:
@Override protected void collectConParameters(){
  collectConFieldContextParameters(isCurrentHadoopVersionSupportYarn());
  collectAuthFieldContextParameters(kerberosBtn.getSelection());
  collectKeyTabContextParameters(kerberosBtn.getSelection() && keytabBtn.getSelection());
  collectClouderaNavigatorFieldContextParameters(useClouderaNaviBtn.getSelection());
}

Fixed version (ground truth):
@Override protected void collectConParameters(){
  collectConFieldContextParameters(isCurrentHadoopVersionSupportYarn());
  collectAuthFieldContextParameters(kerberosBtn.getSelection());
  collectKeyTabContextParameters(kerberosBtn.getSelection() && keytabBtn.getSelection());
  if (useClouderaNaviBtn != null) {
    collectClouderaNavigatorFieldContextParameters(useClouderaNaviBtn.getSelection());
  }
}
Program: 124793
Project: 124793
Buggy source:
protected JSONObject loadDefaultConfigurations(){
  JSONObject globalJson=DefaultConfigurationManager.loadDefaultFile(AbstractDistribution.class,getDistribution().toLowerCase());
  if (getVersion() != null) {
    JSONObject versionJson=DefaultConfigurationManager.loadDefaultFile(this.getClass(),getVersion().toLowerCase());
    return JSONUtil.merge(globalJson,versionJson);
  }
  return globalJson;
}

Fixed version (ground truth):
protected JSONObject loadDefaultConfigurations(){
  JSONObject globalJson=DefaultConfigurationManager.loadDefaultFile(AbstractDistribution.class,getDistribution().toLowerCase());
  if (getVersion() != null) {
    JSONObject versionJson=DefaultConfigurationManager.loadDefaultFile(this.getClass(),getVersion().toLowerCase());
    return JSONUtil.merge(versionJson,globalJson);
  }
  return globalJson;
}
Program: 124794
Project: 124794
Buggy source:
protected String getDistribution(){
  return IMicrosoftHDInsightDistribution.DISTRIBUTION_NAME;
}

Fixed version (ground truth):
@Override protected String getDistribution(){
  return IMicrosoftHDInsightDistribution.DISTRIBUTION_NAME;
}
Program: 124795
Project: 124795
Buggy source:
protected String getDistributionDisplay(){
  return IMicrosoftHDInsightDistribution.DISTRIBUTION_DISPLAY_NAME;
}

Fixed version (ground truth):
@Override protected String getDistributionDisplay(){
  return IMicrosoftHDInsightDistribution.DISTRIBUTION_DISPLAY_NAME;
}