nus-yam/ex-repair huggingface dataset:
Program: 125826
Project: 125826
Buggy source:
public static String[] getDistributionVersionsDisplay(String hiveDistribution,boolean byDisplay){
  List<String> versionsItems=new ArrayList<String>();
  IHDistribution distribution=getDistribution(hiveDistribution,byDisplay);
  if (distribution != null) {
    versionsItems.addAll(Arrays.asList(distribution.getVersionsDisplay()));
  }
  return versionsItems.toArray(new String[versionsItems.size()]);
}

Fixed version (ground truth):
public static String[] getDistributionVersionsDisplay(String hiveDistribution,boolean byDisplay){
  List<String> versionsItems=new ArrayList<String>();
  IHDistribution distribution=getDistribution(hiveDistribution,byDisplay);
  if (distribution != null) {
    IHDistributionVersion[] hdVersions=distribution.getHDVersions();
    for (    IHDistributionVersion v : hdVersions) {
      String[] hiveModesDisplay=getHiveModesDisplay(distribution.getName(),v.getVersion(),null,false);
      if (hiveModesDisplay == null || hiveModesDisplay.length == 0) {
        continue;
      }
      String displayVersion=v.getDisplayVersion();
      if (displayVersion != null) {
        versionsItems.add(displayVersion);
      }
    }
  }
  return versionsItems.toArray(new String[versionsItems.size()]);
}
Program: 125827
Project: 125827
Buggy source:
private IDistributionsManager getDistributionsManager(){
  if (types != null && types.length == 1) {
    return HadoopVersionControlUtils.getDistributionsManager(types[0]);
  }
  return null;
}

Fixed version (ground truth):
private IDistributionsManager getDistributionsManager(){
  if (types != null && types.length == 1) {
    return HadoopVersionControlUtils.getDistributionsManager(types[0]);
  }
  return HadoopVersionControlUtils.getDistributionsManager(null);
}
Program: 125829
Project: 125829
Buggy source:
/** 
 * for Spark Distribution   {@link SparkComponent}.
 */
IDistributionsManager getHiveDistributionManager();

Fixed version (ground truth):
/** 
 * for Hive Distribution   {@link HiveComponent}.
 */
IDistributionsManager getHiveDistributionManager();
Program: 125830
Project: 125830
Buggy source:
private void updateVersionPart(){
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService != null) {
    final IHDistribution hDistribution=hadoopDistributionService.getHadoopDistribution(distribution,false);
    if (hDistribution != null) {
      boolean isSparkJob=isSparkJob();
      final IHDistributionVersion[] hdVersions=hDistribution.getHDVersions();
      List<String> versionsDisplay=new ArrayList<String>();
      for (      IHDistributionVersion hdv : hdVersions) {
        final String displayVersion=hdv.getDisplayVersion();
        if (displayVersion == null) {
          continue;
        }
        if (isSparkJob) {
          if (hadoopDistributionService.doSupportService(hdv,IHDConstants.SERVICE_SPARK)) {
            versionsDisplay.add(displayVersion);
          }
        }
 else {
          versionsDisplay.add(displayVersion);
        }
      }
      versionCombo.getCombo().setItems(versionsDisplay.toArray(new String[0]));
      IHDistributionVersion defaultVersion=hDistribution.getDefaultVersion();
      if (defaultVersion != null) {
        versionCombo.getCombo().setText(defaultVersion.getDisplayVersion());
      }
 else       if (!versionsDisplay.isEmpty()) {
        versionCombo.getCombo().select(0);
      }
    }
  }
}

Fixed version (ground truth):
private void updateVersionPart(){
  final IHDistribution hadoopDistribution=getHadoopDistribution();
  if (hadoopDistribution != null) {
    String[] versionsDisplay=hadoopDistribution.getVersionsDisplay();
    IHDistributionVersion defaultVersion=hadoopDistribution.getDefaultVersion();
    versionCombo.getCombo().setItems(versionsDisplay);
    if (defaultVersion != null) {
      versionCombo.getCombo().setText(defaultVersion.getDisplayVersion());
    }
 else     if (versionsDisplay.length > 0) {
      versionCombo.getCombo().select(0);
    }
  }
}
Program: 125831
Project: 125831
Buggy source:
private IHDistribution getHadoopDistribution(){
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService != null) {
    final IHDistribution distributionByDisplay=hadoopDistributionService.getHadoopDistribution(distributionCombo.getText(),true);
    return distributionByDisplay;
  }
  return null;
}

Fixed version (ground truth):
private IHDistribution getHadoopDistribution(){
  IDistributionsManager distributionManager=getDistributionsManager();
  if (distributionManager != null) {
    final IHDistribution distributionByDisplay=distributionManager.getDistribution(distributionCombo.getText(),true);
    return distributionByDisplay;
  }
  return null;
}
Program: 125832
Project: 125832
Buggy source:
private void init(){
  List<String> distributionsDisplay=new ArrayList<String>();
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService != null) {
    IDistributionsManager distributionManager=null;
    if (isSparkJob()) {
      distributionManager=hadoopDistributionService.getSparkDistributionManager();
    }
 else {
      distributionManager=hadoopDistributionService.getHadoopDistributionManager();
    }
    IHDistribution[] distributions=distributionManager.getDistributions();
    if (distributions != null) {
      for (      IHDistribution d : distributions) {
        if (!d.useCustom()) {
          distributionsDisplay.add(d.getDisplayName());
        }
      }
    }
  }
  distributionCombo.getCombo().setItems(distributionsDisplay.toArray(new String[0]));
  distributionCombo.select(0);
}

Fixed version (ground truth):
private void init(){
  List<String> distributionsDisplay=new ArrayList<String>();
  IDistributionsManager distributionManager=getDistributionsManager();
  if (distributionManager != null) {
    IHDistribution[] distributions=distributionManager.getDistributions();
    if (distributions != null) {
      for (      IHDistribution d : distributions) {
        if (!d.useCustom()) {
          distributionsDisplay.add(d.getDisplayName());
        }
      }
    }
  }
  distributionCombo.getCombo().setItems(distributionsDisplay.toArray(new String[0]));
  distributionCombo.select(0);
}
Program: 125834
Project: 125834
Buggy source:
@Test public void testGetValueOfHive(){
  DatabaseConnection dbConnection=mock(DatabaseConnection.class);
  when(dbConnection.isContextMode()).thenReturn(true);
  PowerMockito.mockStatic(ContextParameterUtils.class);
  when(ContextParameterUtils.isContainContextParam(anyString())).thenReturn(true);
  EMap<String,String> paramMap=new BasicEMap<>();
  paramMap.put(ConnParameterKeys.HIVE_AUTHENTICATION_HIVEPRINCIPLA,"String_Node_Str");
  paramMap.put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL,"String_Node_Str");
  paramMap.put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB,"String_Node_Str");
  when(dbConnection.getParameters()).thenReturn(paramMap);
  checkIfWithoutQuotes(dbConnection,"String_Node_Str");
  checkIfWithoutQuotes(dbConnection,"String_Node_Str");
  checkIfWithoutQuotes(dbConnection,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testGetValueOfHive(){
  DatabaseConnection dbConnection=mock(DatabaseConnection.class);
  when(dbConnection.isContextMode()).thenReturn(true);
  PowerMockito.mockStatic(ContextParameterUtils.class);
  when(ContextParameterUtils.isContainContextParam(anyString())).thenReturn(true);
  EMap<String,String> paramMap=new BasicEMap<>();
  paramMap.put(ConnParameterKeys.HIVE_AUTHENTICATION_HIVEPRINCIPLA,"String_Node_Str");
  paramMap.put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB_PRINCIPAL,"String_Node_Str");
  paramMap.put(ConnParameterKeys.CONN_PARA_KEY_KEYTAB,"String_Node_Str");
  paramMap.put(ConnParameterKeys.CONN_PARA_KEY_USE_DATANODE_HOSTNAME,null);
  when(dbConnection.getParameters()).thenReturn(paramMap);
  checkIfWithoutQuotes(dbConnection,"String_Node_Str");
  checkIfWithoutQuotes(dbConnection,"String_Node_Str");
  checkIfWithoutQuotes(dbConnection,"String_Node_Str");
  Object result=RepositoryToComponentProperty.getValue(dbConnection,"String_Node_Str",null);
  assertTrue(result == null);
}
Program: 125836
Project: 125836
Buggy source:
public void setCheckedState(){
  List<String> selectedElementLabels=getSelectedElementLabels();
  if (selectedElementLabels != null) {
    List<T> selectedElements=getInitSelectedElements(selectedElementLabels);
    if (selectedElements != null) {
      viewer.setCheckedElements(selectedElements.toArray());
    }
  }
}

Fixed version (ground truth):
public void setCheckedState(){
  List<String> selectedElementLabels=getSelectedElementLabels();
  if (selectedElementLabels != null) {
    List<T> selectedElements=getInitSelectedElements(selectedElementLabels);
    if (selectedElements != null) {
      viewer.setCheckedElements(selectedElements.toArray());
      doSelectionChanged();
    }
  }
}
Program: 125842
Project: 125842
Buggy source:
@Override public void postShutdown(IWorkbench workbench){
}

Fixed version (ground truth):
@Override public void postShutdown(IWorkbench workbench){
  ProxyRepositoryFactory.getInstance().logOffProject();
}
Program: 125844
Project: 125844
Buggy source:
@Override public boolean preShutdown(IWorkbench workbench,boolean forced){
  TokenCollectorFactory.getFactory().process();
  ProxyRepositoryFactory.getInstance().logOffProject();
  return true;
}

Fixed version (ground truth):
@Override public boolean preShutdown(IWorkbench workbench,boolean forced){
  TokenCollectorFactory.getFactory().process();
  return true;
}
Program: 125845
Project: 125845
Buggy source:
public void setViewerData(List<T> nls){
  viewer.setInput(nls);
}

Fixed version (ground truth):
public void setViewerData(List<T> nls){
  this.viewerData=nls;
  viewer.setInput(nls);
}
Program: 125847
Project: 125847
Buggy source:
private boolean doSupportTez(){
  if (isHiveDBConnSelected()) {
    HiveMetadataHelper.doSupportTez(hiveDistributionCombo.getText(),hiveVersionCombo.getText(),true);
  }
  return false;
}

Fixed version (ground truth):
private boolean doSupportTez(){
  if (isHiveDBConnSelected()) {
    return HiveMetadataHelper.doSupportTez(hiveDistributionCombo.getText(),hiveVersionCombo.getText(),true);
  }
  return false;
}
Program: 125848
Project: 125848
Buggy source:
@Override public boolean performCancel(){
  if (selectorWizardPage != null) {
    selectorWizardPage.performCancel();
  }
  temConnection=null;
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (selectorWizardPage != null) {
    selectorWizardPage.performCancel();
  }
  oldCopiedConnection=null;
  return super.performCancel();
}
Program: 125851
Project: 125851
Buggy source:
/** 
 * clone a new DB connection
 */
private void cloneBaseDataBaseConnection(DatabaseConnection connection){
  temConnection=EcoreUtil.copy(connection);
  EList<Package> dataPackage=connection.getDataPackage();
  Collection<Package> newDataPackage=EcoreUtil.copyAll(dataPackage);
  ConnectionHelper.addPackages(newDataPackage,temConnection);
}

Fixed version (ground truth):
/** 
 * clone a new DB connection
 */
private void cloneBaseDataBaseConnection(DatabaseConnection connection){
  oldCopiedConnection=EcoreUtil.copy(connection);
  EList<Package> dataPackage=connection.getDataPackage();
  Collection<Package> newDataPackage=EcoreUtil.copyAll(dataPackage);
  ConnectionHelper.addPackages(newDataPackage,oldCopiedConnection);
}
Program: 125857
Project: 125857
Buggy source:
public void copyTestCases(Item newItem,RepositoryNode sourceNode,boolean isDuplicate){
  if (!isAllowedToCopyTestCase(newItem,sourceNode)) {
    return;
  }
  final IPath path=getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode);
      for (      IRepositoryNode testNode : sourceNode.getChildren()) {
        Item testItem=testNode.getObject().getProperty().getItem();
        if (!(testItem instanceof ProcessItem)) {
          continue;
        }
        testContainerService.copyTestCase(newItem,testItem,path,null,false);
      }
    }
  }
}

Fixed version (ground truth):
public void copyTestCases(Item newItem,RepositoryNode sourceNode,boolean isDuplicate){
  if (!isAllowedToCopyTestCase(newItem,sourceNode)) {
    return;
  }
  final IPath path=getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode.getId());
      for (      IRepositoryNode testNode : sourceNode.getChildren()) {
        Item testItem=testNode.getObject().getProperty().getItem();
        if (!(testItem instanceof ProcessItem)) {
          continue;
        }
        testContainerService.copyTestCase(newItem,testItem,path,null,false);
      }
    }
  }
}
Program: 125858
Project: 125858
Buggy source:
private void duplicateTestCases(Item newItem,final CopyObjectAction copyObjectAction){
  if (!copyObjectAction.isAllowedToCopyTestCase(newItem,sourceNode) || !isAllowDuplicateTest) {
    return;
  }
  final IPath path=copyObjectAction.getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode);
      for (      IRepositoryNode testNode : this.sourceNode.getChildren()) {
        Item testItem=testNode.getObject().getProperty().getItem();
        if (!(testItem instanceof ProcessItem)) {
          continue;
        }
        String initNameValue="String_Node_Str" + testItem.getProperty().getDisplayName();
        String jobNameValue=null;
        final TreeSelection selectionInClipboard=(TreeSelection)selection;
        ERepositoryObjectType type=((RepositoryNode)selectionInClipboard.toArray()[0]).getObject().getRepositoryObjectType();
        try {
          jobNameValue=getDuplicateName((RepositoryNode)testNode,initNameValue,type,selectionInClipboard);
        }
 catch (        BusinessException e) {
          jobNameValue="String_Node_Str";
        }
        testContainerService.copyTestCase(newItem,testItem,path,jobNameValue,true);
      }
    }
  }
}

Fixed version (ground truth):
private void duplicateTestCases(Item newItem,final CopyObjectAction copyObjectAction){
  if (!copyObjectAction.isAllowedToCopyTestCase(newItem,sourceNode) || !isAllowDuplicateTest) {
    return;
  }
  final IPath path=copyObjectAction.getTestCasePath(newItem,sourceNode);
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
    ITestContainerProviderService testContainerService=(ITestContainerProviderService)GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
    if (testContainerService != null) {
      testContainerService.copyDataFiles(newItem,sourceNode.getId());
      for (      IRepositoryNode testNode : this.sourceNode.getChildren()) {
        Item testItem=testNode.getObject().getProperty().getItem();
        if (!(testItem instanceof ProcessItem)) {
          continue;
        }
        String initNameValue="String_Node_Str" + testItem.getProperty().getDisplayName();
        String jobNameValue=null;
        final TreeSelection selectionInClipboard=(TreeSelection)selection;
        ERepositoryObjectType type=((RepositoryNode)selectionInClipboard.toArray()[0]).getObject().getRepositoryObjectType();
        try {
          jobNameValue=getDuplicateName((RepositoryNode)testNode,initNameValue,type,selectionInClipboard);
        }
 catch (        BusinessException e) {
          jobNameValue="String_Node_Str";
        }
        testContainerService.copyTestCase(newItem,testItem,path,jobNameValue,true);
      }
    }
  }
}
Program: 125859
Project: 125859
Buggy source:
public void copyDataFiles(Item newItem,RepositoryNode sourceNode);

Fixed version (ground truth):
public void copyDataFiles(Item newItem,String sourceNodeid);
Program: 125860
Project: 125860
Buggy source:
@Override public boolean performFinish(){
  if (alreadyEditedByUser) {
    return false;
  }
  if (object != null && object.getProperty() != null && object.getProperty().getItem() != null && object.getProperty().getItem() instanceof ProcessItem && PluginChecker.isTIS() && mainPage.jobTypeCCombo != null) {
    Item item=object.getProperty().getItem();
    Object frameworkObj=ConvertJobsUtil.getFramework(item);
    String sourceFramework=null;
    if (frameworkObj != null) {
      sourceFramework=frameworkObj.toString();
    }
    String sourceJobType=ConvertJobsUtil.getJobTypeFromFramework(object.getProperty().getItem());
    boolean isNeedConvert=ConvertJobsUtil.isNeedConvert(item,mainPage.jobTypeCCombo.getText(),mainPage.framework.getText(),true);
    if (sourceJobType != null && !isNeedConvert) {
      return super.performFinish();
    }
    boolean hasTestCase=ConvertJobsUtil.hasTestCase(object.getProperty());
    if (hasTestCase && !MessageDialogWithToggle.openConfirm(null,"String_Node_Str","String_Node_Str")) {
      return super.performFinish();
    }
    boolean convert=true;
    try {
      ConvertJobsUtil.convert(object.getLabel(),mainPage.jobTypeCCombo.getText(),mainPage.framework.getText(),object);
    }
 catch (    Exception e) {
      MessageBoxExceptionHandler.process(e.getCause());
      convert=false;
    }
    return convert;
  }
 else {
    return super.performFinish();
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (alreadyEditedByUser) {
    return false;
  }
  if (object != null && object.getProperty() != null && object.getProperty().getItem() != null && object.getProperty().getItem() instanceof ProcessItem && PluginChecker.isTIS() && mainPage.jobTypeCCombo != null) {
    Item item=object.getProperty().getItem();
    Object frameworkObj=ConvertJobsUtil.getFramework(item);
    String sourceFramework=null;
    if (frameworkObj != null) {
      sourceFramework=frameworkObj.toString();
    }
    String sourceJobType=ConvertJobsUtil.getJobTypeFromFramework(object.getProperty().getItem());
    boolean isNeedConvert=ConvertJobsUtil.isNeedConvert(item,mainPage.jobTypeCCombo.getText(),mainPage.framework.getText(),true);
    if (sourceJobType != null && !isNeedConvert) {
      return super.performFinish();
    }
    boolean convert=true;
    try {
      ConvertJobsUtil.convert(object.getLabel(),mainPage.jobTypeCCombo.getText(),mainPage.framework.getText(),object);
    }
 catch (    Exception e) {
      MessageBoxExceptionHandler.process(e.getCause());
      convert=false;
    }
    return convert;
  }
 else {
    return super.performFinish();
  }
}
Program: 125862
Project: 125862
Buggy source:
/** 
 * return true/false of   {@link HiveComponent#doSupportSecurity}. also, when hive service or embedded
 */
public static boolean doSupportSecurity(String hiveDistribution,String hiveVersion,String hiveMode,String hiveServerVersion,boolean byDisplay){
  HiveModeInfo hiveModeInfo=byDisplay ? HiveModeInfo.getByDisplay(hiveMode) : HiveModeInfo.get(hiveMode);
  HiveServerVersionInfo hiveServerVersionInfo=byDisplay ? HiveServerVersionInfo.getByDisplay(hiveServerVersion) : HiveServerVersionInfo.valueOf(hiveServerVersion);
  boolean supportSecurity=doSupportMethod(hiveDistribution,hiveVersion,byDisplay,"String_Node_Str");
  if (supportSecurity && (HiveServerVersionInfo.HIVE_SERVER_2 == hiveServerVersionInfo || hiveModeInfo == HiveModeInfo.EMBEDDED)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * return true/false of   {@link HiveComponent#doSupportSecurity}. also, when hive service or embedded
 */
public static boolean doSupportSecurity(String hiveDistribution,String hiveVersion,String hiveMode,String hiveServerVersion,boolean byDisplay){
  HiveModeInfo hiveModeInfo=byDisplay ? HiveModeInfo.getByDisplay(hiveMode) : HiveModeInfo.get(hiveMode);
  HiveServerVersionInfo hiveServerVersionInfo=byDisplay ? HiveServerVersionInfo.getByDisplay(hiveServerVersion) : HiveServerVersionInfo.getByKey(hiveServerVersion);
  boolean supportSecurity=doSupportMethod(hiveDistribution,hiveVersion,byDisplay,"String_Node_Str");
  if (supportSecurity && (HiveServerVersionInfo.HIVE_SERVER_2 == hiveServerVersionInfo || hiveModeInfo == HiveModeInfo.EMBEDDED)) {
    return true;
  }
  return false;
}
Program: 125863
Project: 125863
Buggy source:
private boolean doSupportTez(){
  if (isHiveDBConnSelected()) {
    HiveMetadataHelper.doSupportTez(hiveDistributionCombo.getText(),hiveVersionCombo.getText(),true);
  }
  return false;
}

Fixed version (ground truth):
private boolean doSupportTez(){
  if (isHiveDBConnSelected()) {
    return HiveMetadataHelper.doSupportTez(hiveDistributionCombo.getText(),hiveVersionCombo.getText(),true);
  }
  return false;
}
Program: 125864
Project: 125864
Buggy source:
/** 
 * Test method for  {@link org.talend.core.model.metadata.MetadataToolHelper#copyTable(org.talend.core.model.metadata.IMetadataTable source,org.talend.core.model.metadata.IMetadataTable target)}
 */
@Test public void testCopyMetadataTable(){
  IMetadataTable source=new org.talend.core.model.metadata.MetadataTable();
  IMetadataTable target=new org.talend.core.model.metadata.MetadataTable();
  source.getAdditionalProperties().put(SAPBWTableHelper.SAP_INFOOBJECT_INNER_TYPE,SAPBWTableHelper.IO_INNERTYPE_HIERARCHY);
  MetadataToolHelper.copyTable(source,target);
  String innerType=target.getAdditionalProperties().get(SAPBWTableHelper.SAP_INFOOBJECT_INNER_TYPE);
  assertEquals(SAPBWTableHelper.IO_INNERTYPE_HIERARCHY,innerType);
}

Fixed version (ground truth):
/** 
 * Test method for  {@link org.talend.core.model.metadata.MetadataToolHelper#copyTable(org.talend.core.model.metadata.IMetadataTable source,org.talend.core.model.metadata.IMetadataTable target)}
 */
@Test public void testCopyMetadataTable(){
  IMetadataTable source=new org.talend.core.model.metadata.MetadataTable();
  IMetadataTable target=new org.talend.core.model.metadata.MetadataTable();
  source.getAdditionalProperties().put(SAPBWTableHelper.SAP_INFOOBJECT_INNER_TYPE,SAPBWTableHelper.IO_INNERTYPE_HIERARCHY);
  target.getAdditionalProperties().put(SAPBWTableHelper.SAP_INFOOBJECT_INNER_TYPE,SAPBWTableHelper.IO_INNERTYPE_ATTRIBUTE);
  target.getAdditionalProperties().put("String_Node_Str","String_Node_Str");
  MetadataToolHelper.copyTable(source,target);
  String innerType=target.getAdditionalProperties().get(SAPBWTableHelper.SAP_INFOOBJECT_INNER_TYPE);
  String test=target.getAdditionalProperties().get("String_Node_Str");
  assertEquals(SAPBWTableHelper.IO_INNERTYPE_HIERARCHY,innerType);
  assertEquals(test,"String_Node_Str");
}
Program: 125867
Project: 125867
Buggy source:
private boolean isSAPBWTable(RepositoryNode theNode){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)theNode.getProperties(EProperties.CONTENT_TYPE);
  if (nodeType == ERepositoryObjectType.METADATA_CON_TABLE) {
    RepositoryNode node=theNode.getParent();
    nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  }
 else   if (nodeType == ERepositoryObjectType.METADATA_CON_COLUMN) {
    RepositoryNode node=theNode.getParent().getParent().getParent();
    nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  }
  if (ERepositoryObjectType.METADATA_SAP_BW_DATASOURCE != null) {
    if (nodeType == ERepositoryObjectType.METADATA_SAP_BW_DATASOURCE || nodeType == ERepositoryObjectType.METADATA_SAP_BW_DATASTOREOBJECT || nodeType == ERepositoryObjectType.METADATA_SAP_BW_INFOCUBE || nodeType == ERepositoryObjectType.METADATA_SAP_BW_INFOOBJECT) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isSAPBWTable(RepositoryNode theNode,ITreeContextualAction action){
  ERepositoryObjectType nodeType=(ERepositoryObjectType)theNode.getProperties(EProperties.CONTENT_TYPE);
  RepositoryNode node=null;
  if (nodeType == ERepositoryObjectType.METADATA_CON_TABLE) {
    node=theNode.getParent();
    nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  }
 else   if (nodeType == ERepositoryObjectType.METADATA_CON_COLUMN) {
    node=theNode.getParent().getParent().getParent();
    nodeType=(ERepositoryObjectType)node.getProperties(EProperties.CONTENT_TYPE);
  }
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  boolean readOnly=false;
  if (factory.isUserReadOnlyOnCurrentProject() || !ProjectManager.getInstance().isInCurrentMainProject(node)) {
    readOnly=true;
  }
  if ((action.isEditAction() && readOnly) || (action.isReadAction() && !readOnly)) {
    return false;
  }
  if (ERepositoryObjectType.METADATA_SAP_BW_DATASOURCE != null) {
    if (nodeType == ERepositoryObjectType.METADATA_SAP_BW_DATASOURCE || nodeType == ERepositoryObjectType.METADATA_SAP_BW_DATASTOREOBJECT || nodeType == ERepositoryObjectType.METADATA_SAP_BW_INFOCUBE || nodeType == ERepositoryObjectType.METADATA_SAP_BW_INFOOBJECT) {
      return true;
    }
  }
  return false;
}
Program: 125869
Project: 125869
Buggy source:
@Override public String getText(Object element){
  String text="String_Node_Str";
  if (element instanceof RepositoryNode) {
    IRepositoryViewObject object=((RepositoryNode)element).getObject();
    if (object instanceof MetadataTableRepositoryObject) {
      MetadataTable table=((MetadataTableRepositoryObject)object).getTable();
      if (table instanceof SAPBWTable) {
        SAPBWTable bwTable=(SAPBWTable)table;
        if (SAPBWTableHelper.TYPE_INFOOBJECT.equals(bwTable.getModelType())) {
          String innerType=bwTable.getInnerIOType();
          if (innerType != null && !innerType.equals(SAPBWTableHelper.IO_INNERTYPE_BASIC)) {
            text=bwTable.getLabel() + "String_Node_Str" + innerType+ "String_Node_Str";
          }
        }
 else {
          text=repoLabelProv.getText(element);
        }
      }
 else {
        text=repoLabelProv.getText(element);
      }
    }
 else {
      text=repoLabelProv.getText(element);
    }
  }
  return text;
}

Fixed version (ground truth):
@Override public String getText(Object element){
  if (element instanceof RepositoryNode) {
    return repoLabelProv.getText(element);
  }
 else {
    return "String_Node_Str";
  }
}
Program: 125872
Project: 125872
Buggy source:
public static List<ERepositoryObjectType> getAllTypesOfProcess(){
  List<ERepositoryObjectType> allTypes=new ArrayList<ERepositoryObjectType>();
  if (ERepositoryObjectType.PROCESS != null) {
    allTypes.add(ERepositoryObjectType.PROCESS);
  }
  if (ERepositoryObjectType.PROCESS_MR != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_MR);
  }
  if (ERepositoryObjectType.PROCESS_STORM != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_STORM);
  }
  if (ERepositoryObjectType.PROCESS_SPARK != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_SPARK);
  }
  if (ERepositoryObjectType.PROCESS_SPARKSTREAMING != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_SPARKSTREAMING);
  }
  if (ERepositoryObjectType.PROCESS_ROUTE != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_ROUTE);
  }
  if (ERepositoryObjectType.PROCESS_ROUTELET != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_ROUTELET);
  }
  if (ERepositoryObjectType.TEST_CONTAINER != null) {
    allTypes.add(ERepositoryObjectType.TEST_CONTAINER);
  }
  return allTypes;
}

Fixed version (ground truth):
public static List<ERepositoryObjectType> getAllTypesOfProcess(){
  List<ERepositoryObjectType> allTypes=new ArrayList<ERepositoryObjectType>();
  if (ERepositoryObjectType.PROCESS != null) {
    allTypes.add(ERepositoryObjectType.PROCESS);
  }
  if (ERepositoryObjectType.PROCESS_MR != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_MR);
  }
  if (ERepositoryObjectType.PROCESS_STORM != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_STORM);
  }
  if (ERepositoryObjectType.PROCESS_SPARK != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_SPARK);
  }
  if (ERepositoryObjectType.PROCESS_SPARKSTREAMING != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_SPARKSTREAMING);
  }
  if (ERepositoryObjectType.PROCESS_ROUTE != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_ROUTE);
  }
  if (ERepositoryObjectType.PROCESS_ROUTELET != null) {
    allTypes.add(ERepositoryObjectType.PROCESS_ROUTELET);
  }
  return allTypes;
}
Program: 125874
Project: 125874
Buggy source:
@Override public boolean preShutdown(IWorkbench workbench,boolean forced){
  TokenCollectorFactory.getFactory().process();
  return true;
}

Fixed version (ground truth):
@Override public boolean preShutdown(IWorkbench workbench,boolean forced){
  TokenCollectorFactory.getFactory().process();
  ProxyRepositoryFactory.getInstance().logOffProject();
  return true;
}
Program: 125875
Project: 125875
Buggy source:
@Override public void run(){
  IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  if (activePage != null) {
    boolean closeAllEditors=activePage.closeAllEditors(true);
    if (!closeAllEditors) {
      return;
    }
  }
  ProxyRepositoryFactory.getInstance().logOffProject();
  IWorkbenchWindow workbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (workbenchWindow.getActivePage() != null && GlobalServiceRegister.getDefault().isServiceRegistered(IDiagramModelService.class) && CorePlugin.getDefault().getDiagramModelService().isBusinessDiagramEditor(workbenchWindow.getActivePage().getActiveEditor())) {
    IViewReference repoViewRef=RepositoryManagerHelper.findRepositoryViewRef();
    if (repoViewRef != null) {
      repoViewRef.getView(false).setFocus();
    }
  }
  LoginHelper.forceShowLogonDialogNextTime();
  PlatformUI.getWorkbench().restart();
}

Fixed version (ground truth):
@Override public void run(){
  IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  if (activePage != null) {
    boolean closeAllEditors=activePage.closeAllEditors(true);
    if (!closeAllEditors) {
      return;
    }
  }
  IWorkbenchWindow workbenchWindow=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  if (workbenchWindow.getActivePage() != null && GlobalServiceRegister.getDefault().isServiceRegistered(IDiagramModelService.class) && CorePlugin.getDefault().getDiagramModelService().isBusinessDiagramEditor(workbenchWindow.getActivePage().getActiveEditor())) {
    IViewReference repoViewRef=RepositoryManagerHelper.findRepositoryViewRef();
    if (repoViewRef != null) {
      repoViewRef.getView(false).setFocus();
    }
  }
  LoginHelper.forceShowLogonDialogNextTime();
  PlatformUI.getWorkbench().restart();
}
Program: 125878
Project: 125878
Buggy source:
/** 
 * for Spark Distribution   {@link SparkComponent}.
 */
IDistributionsManager getHiveDistributionManager();

Fixed version (ground truth):
/** 
 * for Hive Distribution   {@link HiveComponent}.
 */
IDistributionsManager getHiveDistributionManager();
Program: 125879
Project: 125879
Buggy source:
private void updateVersionPart(){
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService != null) {
    final IHDistribution hDistribution=hadoopDistributionService.getHadoopDistribution(distribution,false);
    if (hDistribution != null) {
      boolean isSparkJob=isSparkJob();
      final IHDistributionVersion[] hdVersions=hDistribution.getHDVersions();
      List<String> versionsDisplay=new ArrayList<String>();
      for (      IHDistributionVersion hdv : hdVersions) {
        final String displayVersion=hdv.getDisplayVersion();
        if (displayVersion == null) {
          continue;
        }
        if (isSparkJob) {
          if (hadoopDistributionService.doSupportService(hdv,IHDConstants.SERVICE_SPARK)) {
            versionsDisplay.add(displayVersion);
          }
        }
 else {
          versionsDisplay.add(displayVersion);
        }
      }
      versionCombo.getCombo().setItems(versionsDisplay.toArray(new String[0]));
      IHDistributionVersion defaultVersion=hDistribution.getDefaultVersion();
      if (defaultVersion != null) {
        versionCombo.getCombo().setText(defaultVersion.getDisplayVersion());
      }
 else       if (!versionsDisplay.isEmpty()) {
        versionCombo.getCombo().select(0);
      }
    }
  }
}

Fixed version (ground truth):
private void updateVersionPart(){
  final IHDistribution hadoopDistribution=getHadoopDistribution();
  if (hadoopDistribution != null) {
    String[] versionsDisplay=hadoopDistribution.getVersionsDisplay();
    IHDistributionVersion defaultVersion=hadoopDistribution.getDefaultVersion();
    versionCombo.getCombo().setItems(versionsDisplay);
    if (defaultVersion != null) {
      versionCombo.getCombo().setText(defaultVersion.getDisplayVersion());
    }
 else     if (versionsDisplay.length > 0) {
      versionCombo.getCombo().select(0);
    }
  }
}
Program: 125880
Project: 125880
Buggy source:
private IHDistribution getHadoopDistribution(){
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService != null) {
    final IHDistribution distributionByDisplay=hadoopDistributionService.getHadoopDistribution(distributionCombo.getText(),true);
    return distributionByDisplay;
  }
  return null;
}

Fixed version (ground truth):
private IHDistribution getHadoopDistribution(){
  IDistributionsManager distributionManager=getDistributionsManager();
  if (distributionManager != null) {
    final IHDistribution distributionByDisplay=distributionManager.getDistribution(distributionCombo.getText(),true);
    return distributionByDisplay;
  }
  return null;
}
Program: 125881
Project: 125881
Buggy source:
private void init(){
  List<String> distributionsDisplay=new ArrayList<String>();
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hadoopDistributionService != null) {
    IDistributionsManager distributionManager=null;
    if (isSparkJob()) {
      distributionManager=hadoopDistributionService.getSparkDistributionManager();
    }
 else {
      distributionManager=hadoopDistributionService.getHadoopDistributionManager();
    }
    IHDistribution[] distributions=distributionManager.getDistributions();
    if (distributions != null) {
      for (      IHDistribution d : distributions) {
        if (!d.useCustom()) {
          distributionsDisplay.add(d.getDisplayName());
        }
      }
    }
  }
  distributionCombo.getCombo().setItems(distributionsDisplay.toArray(new String[0]));
  distributionCombo.select(0);
}

Fixed version (ground truth):
private void init(){
  List<String> distributionsDisplay=new ArrayList<String>();
  IDistributionsManager distributionManager=getDistributionsManager();
  if (distributionManager != null) {
    IHDistribution[] distributions=distributionManager.getDistributions();
    if (distributions != null) {
      for (      IHDistribution d : distributions) {
        if (!d.useCustom()) {
          distributionsDisplay.add(d.getDisplayName());
        }
      }
    }
  }
  distributionCombo.getCombo().setItems(distributionsDisplay.toArray(new String[0]));
  distributionCombo.select(0);
}
Program: 125884
Project: 125884
Buggy source:
/** 
 * Copy all of the information from the MetadataTable in the form of key/value properties into an Avro object.
 * @param builder Any Avro builder capable of taking key/value in the form of strings.
 * @param in The element to copy information from.
 * @return the instance of the builder passed in.
 */
private static <T extends PropBuilder<T>>PropBuilder<T> copyTableProperties(PropBuilder<T> builder,MetadataTable in){
  if (in.getId() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_ID,in.getId());
  }
  if (in.getComment() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_COMMENT,in.getComment());
  }
  if (in.getLabel() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_LABEL,in.getLabel());
  }
  if (in.isReadOnly()) {
    builder.prop(Talend6SchemaConstants.TALEND6_IS_READ_ONLY,"String_Node_Str");
  }
  for (  TaggedValue tv : in.getTaggedValue()) {
    String additionalTag=tv.getTag();
    if (tv.getValue() != null) {
      builder.prop(Talend6SchemaConstants.TALEND6_ADDITIONAL_PROPERTIES + additionalTag,tv.getValue());
    }
  }
  if (in.getName() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_TABLE_NAME,in.getName());
  }
  if (in.getTableType() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_TABLE_TYPE,in.getTableType());
  }
  return builder;
}

Fixed version (ground truth):
/** 
 * Copy all of the information from the MetadataTable in the form of key/value properties into an Avro object.
 * @param builder Any Avro builder capable of taking key/value in the form of strings.
 * @param in The element to copy information from.
 * @return the instance of the builder passed in.
 */
private static <T extends PropBuilder<T>>PropBuilder<T> copyTableProperties(PropBuilder<T> builder,MetadataTable in){
  if (in.getComment() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_COMMENT,in.getComment());
  }
  if (in.getLabel() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_LABEL,in.getLabel());
  }
  if (in.isReadOnly()) {
    builder.prop(Talend6SchemaConstants.TALEND6_IS_READ_ONLY,"String_Node_Str");
  }
  if (in.getName() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_TABLE_NAME,in.getName());
  }
  if (in.getTableType() != null) {
    builder.prop(Talend6SchemaConstants.TALEND6_TABLE_TYPE,in.getTableType());
  }
  return builder;
}
Program: 125885
Project: 125885
Buggy source:
/** 
 * Update component schema for node metadata table of node.
 * @param componentProperties
 * @param schemaPropertyName
 * @param metadataTable
 */
public void updateComponentSchema(ComponentProperties componentProperties,String schemaPropertyName,IMetadataTable metadataTable);

Fixed version (ground truth):
/** 
 * Update component schema for node metadata table of node.
 * @param componentProperties
 * @param schemaPropertyName
 * @param metadataTable
 */
public void updateComponentSchema(ComponentProperties componentProperties,String schemaPropertyName,IMetadataTable metadataTable,IElementParameter param);
Program: 125890
Project: 125890
Buggy source:
private boolean isRepository(INode node,IMetadataTable currentTable){
  boolean nodeModeFlag=false;
  for (  IElementParameter param : node.getElementParameters()) {
    if (param.getFieldType() == EParameterFieldType.SCHEMA_TYPE && (param.getContext() == null || param.getContext().equals(currentTable.getAttachedConnector()))) {
      IElementParameter schemaParam=param.getChildParameters().get("String_Node_Str");
      if (schemaParam.getValue() != null) {
        if (schemaParam.getValue().equals("String_Node_Str")) {
          nodeModeFlag=true;
          break;
        }
      }
    }
  }
  if (!nodeModeFlag) {
    IElementParameter schemaParam=node.getElementParameter("String_Node_Str");
    if (schemaParam != null) {
      List schemaType=(List)schemaParam.getValue();
      for (int i=0; i < schemaType.size(); i++) {
        HashMap map=(HashMap)schemaType.get(i);
        Set set=map.keySet();
        Iterator it=set.iterator();
        while (it.hasNext()) {
          String key=(String)it.next();
          if (key.equals("String_Node_Str")) {
            String value=(String)map.get(key);
            String tableLabel=this.outputMetaTable.getLabel();
            if (tableLabel != null && tableLabel.equals(TalendQuoteUtils.removeQuotes(value))) {
              if (map.containsKey("String_Node_Str") && map.containsValue("String_Node_Str")) {
                nodeModeFlag=true;
              }
            }
          }
        }
      }
    }
  }
  return nodeModeFlag;
}

Fixed version (ground truth):
private boolean isRepository(INode node,IMetadataTable currentTable){
  boolean nodeModeFlag=false;
  for (  IElementParameter param : node.getElementParameters()) {
    if ((param.getFieldType() == EParameterFieldType.SCHEMA_TYPE || param.getFieldType() == EParameterFieldType.SCHEMA_REFERENCE) && (param.getContext() == null || param.getContext().equals(currentTable.getAttachedConnector()))) {
      IElementParameter schemaParam=param.getChildParameters().get("String_Node_Str");
      if (schemaParam.getValue() != null) {
        if (schemaParam.getValue().equals("String_Node_Str")) {
          nodeModeFlag=true;
          break;
        }
      }
    }
  }
  if (!nodeModeFlag) {
    IElementParameter schemaParam=node.getElementParameter("String_Node_Str");
    if (schemaParam != null) {
      List schemaType=(List)schemaParam.getValue();
      for (int i=0; i < schemaType.size(); i++) {
        HashMap map=(HashMap)schemaType.get(i);
        Set set=map.keySet();
        Iterator it=set.iterator();
        while (it.hasNext()) {
          String key=(String)it.next();
          if (key.equals("String_Node_Str")) {
            String value=(String)map.get(key);
            String tableLabel=this.outputMetaTable.getLabel();
            if (tableLabel != null && tableLabel.equals(TalendQuoteUtils.removeQuotes(value))) {
              if (map.containsKey("String_Node_Str") && map.containsValue("String_Node_Str")) {
                nodeModeFlag=true;
              }
            }
          }
        }
      }
    }
  }
  return nodeModeFlag;
}
Program: 125891
Project: 125891
Buggy source:
/** 
 * Makes sure if the hive server2 UI displays. If displaying it, then check the selection. Added by Marvin Wang on Mar 25, 2013.
 * @param distributionIndex
 * @param hiveVersionIndex
 */
protected void updateHiveServerAndMakeSelection(IHDistribution hiveDistribution,IHDistributionVersion hiveVersion){
  if (hiveDistribution == null) {
    hiveDistribution=getCurrentHiveDistribution(true);
  }
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hiveDistribution == null || hadoopDistributionService == null) {
    return;
  }
  IHDistributionVersion[] hdVersions=hiveDistribution.getHDVersions();
  if (hiveVersion == null && hdVersions.length > 0) {
    hiveVersion=hdVersions[0];
  }
  DatabaseConnection conn=getConnection();
  String[] hiveServersDisplay=HiveMetadataHelper.getHiveServersDisplay(hiveDistribution.getName(),hiveVersion.getVersion(),false);
  hiveServerVersionCombo.getCombo().setItems(hiveServersDisplay);
  String hiveServerKey=conn.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
  if (hiveServerKey != null) {
    HiveServerVersionInfo serverVersion=HiveServerVersionInfo.getByKey(hiveServerKey);
    if (serverVersion != null) {
      hiveServerVersionCombo.setText(serverVersion.getDisplayName());
    }
 else {
      hiveServerVersionCombo.select(0);
    }
  }
 else {
    hiveServerVersionCombo.select(0);
  }
}

Fixed version (ground truth):
/** 
 * Makes sure if the hive server2 UI displays. If displaying it, then check the selection. Added by Marvin Wang on Mar 25, 2013.
 * @param distributionIndex
 * @param hiveVersionIndex
 */
protected void updateHiveServerAndMakeSelection(IHDistribution hiveDistribution,IHDistributionVersion hiveVersion){
  if (hiveDistribution == null) {
    hiveDistribution=getCurrentHiveDistribution(true);
  }
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hiveDistribution == null || hadoopDistributionService == null) {
    return;
  }
  IHDistributionVersion[] hdVersions=hiveDistribution.getHDVersions();
  if (hiveVersion == null && hdVersions.length > 0) {
    hiveVersion=hdVersions[0];
  }
  DatabaseConnection conn=getConnection();
  String[] hiveServersDisplay=HiveMetadataHelper.getHiveServersDisplay(hiveDistribution.getName(),hiveVersion == null ? null : hiveVersion.getVersion(),false);
  hiveServerVersionCombo.getCombo().setItems(hiveServersDisplay);
  String hiveServerKey=conn.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
  if (hiveServerKey != null) {
    HiveServerVersionInfo serverVersion=HiveServerVersionInfo.getByKey(hiveServerKey);
    if (serverVersion != null) {
      hiveServerVersionCombo.setText(serverVersion.getDisplayName());
    }
 else {
      hiveServerVersionCombo.select(0);
    }
  }
 else {
    hiveServerVersionCombo.select(0);
  }
}
Program: 125892
Project: 125892
Buggy source:
protected void updateHiveModeAndMakeSelection(HiveModeInfo hiveMode){
  IHDistribution hiveDistribution=getCurrentHiveDistribution(true);
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hiveDistribution == null || hadoopDistributionService == null) {
    return;
  }
  IHDistributionVersion hiveVersion=hiveDistribution.getHDVersion(hiveVersionCombo.getText(),true);
  IHDistributionVersion[] hdVersions=hiveDistribution.getHDVersions();
  if (hiveVersion == null && hdVersions.length > 0) {
    hiveVersion=hdVersions[0];
  }
  HiveServerVersionInfo hiveServer=null;
  if (doSupportHive2()) {
    hiveServer=HiveServerVersionInfo.getByDisplay(hiveServerVersionCombo.getText());
  }
 else {
    hiveServer=HiveServerVersionInfo.HIVE_SERVER_1;
  }
  String[] hiveModesDisplay=HiveMetadataHelper.getHiveModesDisplay(hiveDistribution.getName(),hiveVersion.getVersion(),hiveServer.getKey(),false);
  hiveModeCombo.getCombo().setItems(hiveModesDisplay);
  if (hiveMode != null) {
    hiveModeCombo.setText(hiveMode.getDisplayName());
  }
 else {
    hiveModeCombo.select(0);
  }
}

Fixed version (ground truth):
protected void updateHiveModeAndMakeSelection(HiveModeInfo hiveMode){
  IHDistribution hiveDistribution=getCurrentHiveDistribution(true);
  IHadoopDistributionService hadoopDistributionService=getHadoopDistributionService();
  if (hiveDistribution == null || hadoopDistributionService == null) {
    return;
  }
  IHDistributionVersion hiveVersion=hiveDistribution.getHDVersion(hiveVersionCombo.getText(),true);
  IHDistributionVersion[] hdVersions=hiveDistribution.getHDVersions();
  if (hiveVersion == null && hdVersions.length > 0) {
    hiveVersion=hdVersions[0];
  }
  HiveServerVersionInfo hiveServer=HiveServerVersionInfo.HIVE_SERVER_1;
  if (doSupportHive2()) {
    hiveServer=HiveServerVersionInfo.getByDisplay(hiveServerVersionCombo.getText());
  }
  String[] hiveModesDisplay=HiveMetadataHelper.getHiveModesDisplay(hiveDistribution.getName(),hiveVersion == null ? null : hiveVersion.getVersion(),hiveServer == null ? null : hiveServer.getKey(),false);
  hiveModeCombo.getCombo().setItems(hiveModesDisplay);
  if (hiveMode != null) {
    hiveModeCombo.setText(hiveMode.getDisplayName());
  }
 else {
    hiveModeCombo.select(0);
  }
}
Program: 125893
Project: 125893
Buggy source:
public ArtifactsDeployer(){
  init();
}

Fixed version (ground truth):
public ArtifactsDeployer(){
}
Program: 125894
Project: 125894
Buggy source:
private static Object getValue(Object object,String... args){
  if (args.length > 0) {
    String arg=args[0];
    Object obj=((JSONObject)object).get(arg);
    String[] newArgs=(String[])ArrayUtils.remove(args,0);
    return getValue(obj,newArgs);
  }
 else {
    return object;
  }
}

Fixed version (ground truth):
private static Object getValue(Object object,String... args){
  if (args.length > 0 && object instanceof JSONObject) {
    String arg=args[0];
    Object obj=((JSONObject)object).get(arg);
    String[] newArgs=(String[])ArrayUtils.remove(args,0);
    return getValue(obj,newArgs);
  }
 else {
    return object;
  }
}