nus-yam/ex-repair huggingface dataset:
Program: 124797
Project: 124797
Buggy source:
@Override protected void collectConParameters(){
  collectConFieldContextParameters(isCurrentHadoopVersionSupportYarn());
  collectAuthFieldContextParameters(kerberosBtn.getSelection());
  collectKeyTabContextParameters(kerberosBtn.getSelection() && keytabBtn.getSelection());
}

Fixed version (ground truth):
@Override protected void collectConParameters(){
  collectConFieldContextParameters(isCurrentHadoopVersionSupportYarn());
  collectAuthFieldContextParameters(kerberosBtn.getSelection());
  collectKeyTabContextParameters(kerberosBtn.getSelection() && keytabBtn.getSelection());
  collectClouderaNavigatorFieldContextParameters(useClouderaNaviBtn.getSelection());
}
Program: 124804
Project: 124804
Buggy source:
public void addCondition(ComponentCondition c){
  if (c != null) {
    conditions.add(c);
  }
}

Fixed version (ground truth):
public void addCondition(ComponentCondition c){
  conditions.add(c);
}
Program: 124805
Project: 124805
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  return super.doSupportEmbeddedMode();
}
Program: 124806
Project: 124806
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  return super.doSupportEmbeddedMode();
}
Program: 124807
Project: 124807
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  return super.doSupportEmbeddedMode();
}
Program: 124808
Project: 124808
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  return super.doSupportEmbeddedMode();
}
Program: 124809
Project: 124809
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  return super.doSupportEmbeddedMode();
}
Program: 124810
Project: 124810
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}
Program: 124811
Project: 124811
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}
Program: 124812
Project: 124812
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}
Program: 124813
Project: 124813
Buggy source:
@Override public boolean doSupportStandaloneMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportStandaloneMode();
}

Fixed version (ground truth):
@Override public boolean doSupportStandaloneMode(){
  if (PluginChecker.isOnlyTopLoaded()) {
    return false;
  }
  return super.doSupportStandaloneMode();
}
Program: 124814
Project: 124814
Buggy source:
@Override public boolean doSupportEmbeddedMode(){
  if (EnvironmentUtils.isWindowsSystem()) {
    return false;
  }
  return super.doSupportEmbeddedMode();
}

Fixed version (ground truth):
@Override public boolean doSupportEmbeddedMode(){
  return super.doSupportEmbeddedMode();
}
Program: 124815
Project: 124815
Buggy source:
/** 
 * Execute a methode for a given distribution and version. This function must return a booelan
 * @param methodName the name of the method
 * @param distribution the name of the distribution
 * @param version the name of the version
 * @return
 * @throws Exception
 */
public static boolean executeBooleanMethod(String methodName,String distribution,String version) throws Exception {
  HadoopComponent distrib=DistributionFactory.buildDistribution(distribution,version);
  try {
    java.lang.reflect.Method m=distrib.getClass().getMethod(methodName,new Class<?>[0]);
    return (Boolean)m.invoke(distrib,new Object[0]);
  }
 catch (  NoSuchMethodException e) {
    throw new Exception("String_Node_Str" + distribution + "String_Node_Str"+ version+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Execute a methode for a given distribution and version. This function must return a booelan
 * @param methodName the name of the method
 * @param distribution the name of the distribution
 * @param version the name of the version
 * @return
 * @throws Exception
 */
public static boolean executeBooleanMethod(String methodName,String distribution,String version) throws Exception {
  HadoopComponent hadoopComponent=DistributionFactory.buildDistribution(distribution,version);
  return DistributionHelper.doSupportMethod(hadoopComponent,methodName);
}
Program: 124816
Project: 124816
Buggy source:
/** 
 * @return true if the distribution does support the Hive1 version in Stadalone mode. This method is made forHortonworks distribution that doesn't support it.
 */
public boolean doSupportHive1Standalone();

Fixed version (ground truth):
/** 
 * @return true if the distribution does support the Hive1 version in standalone mode. This method is made forHortonworks distribution that doesn't support it.
 */
public boolean doSupportHive1Standalone();
Program: 124817
Project: 124817
Buggy source:
public static Map<String,Boolean> doSupportMethods(IHDistributionVersion distributionVersion,String... methods){
  Map<String,Boolean> resultsMap=new HashMap<String,Boolean>();
  if (distributionVersion instanceof DistributionVersion && methods != null && methods.length > 0) {
    HadoopComponent dadoopComponent=((DistributionVersion)distributionVersion).hadoopComponent;
    if (dadoopComponent != null) {
      for (      String m : methods) {
        Method method=findMethod(dadoopComponent.getClass(),m);
        if (method != null) {
          try {
            method.setAccessible(true);
            Object is=method.invoke(dadoopComponent);
            if (is instanceof Boolean) {
              resultsMap.put(m,((Boolean)is));
            }
          }
 catch (          SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
          }
        }
      }
    }
  }
  return resultsMap;
}

Fixed version (ground truth):
public static Map<String,Boolean> doSupportMethods(HadoopComponent hadoopComponent,String... methods) throws Exception {
  Map<String,Boolean> resultsMap=new HashMap<String,Boolean>();
  if (hadoopComponent != null) {
    for (    String m : methods) {
      Method method=findMethod(hadoopComponent.getClass(),m);
      if (method != null) {
        try {
          method.setAccessible(true);
          Object is=method.invoke(hadoopComponent);
          if (is instanceof Boolean) {
            resultsMap.put(m,((Boolean)is));
          }
        }
 catch (        SecurityException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
        }
      }
 else {
        throw new NoSuchMethodException("String_Node_Str" + hadoopComponent.getDistributionName() + "String_Node_Str"+ hadoopComponent.getVersion()+ "String_Node_Str");
      }
    }
  }
  return resultsMap;
}
Program: 124818
Project: 124818
Buggy source:
@Override public Map<String,Boolean> doSupportMethods(IHDistributionVersion distributionVersion,String... methods){
  return DistributionHelper.doSupportMethods(distributionVersion,methods);
}

Fixed version (ground truth):
@Override public Map<String,Boolean> doSupportMethods(IHDistributionVersion distributionVersion,String... methods) throws Exception {
  return DistributionHelper.doSupportMethods(distributionVersion,methods);
}
Program: 124819
Project: 124819
Buggy source:
protected void doTestGetHiveServersDisplay(String hiveVersion,String hiveMode,String[] serverArr){
  String[] hiveServersDisplay=HiveMetadataHelper.getHiveServersDisplay(getDistribution(),hiveVersion,hiveMode,false);
  doTestArray("String_Node_Str",serverArr,hiveServersDisplay);
}

Fixed version (ground truth):
protected void doTestGetHiveServersDisplay(String hiveVersion,String[] serverArr){
  String[] hiveServersDisplay=HiveMetadataHelper.getHiveServersDisplay(getDistribution(),hiveVersion,false);
  doTestArray("String_Node_Str",serverArr,hiveServersDisplay);
}
Program: 124820
Project: 124820
Buggy source:
protected void doTestGetHiveModesDisplay(String hiveVersion,String[] modeArr){
  if (PluginChecker.isOnlyTopLoaded() && ArrayUtils.contains(modeArr,HiveModeInfo.EMBEDDED.getDisplayName())) {
    modeArr=ArrayUtils.removeElement(modeArr,HiveModeInfo.EMBEDDED.getDisplayName());
  }
  String[] hiveModesDisplay=HiveMetadataHelper.getHiveModesDisplay(getDistribution(),hiveVersion,false);
  doTestArray("String_Node_Str",modeArr,hiveModesDisplay);
}

Fixed version (ground truth):
protected void doTestGetHiveModesDisplay(String hiveVersion,String hiveServer,String[] modeArr){
  if (PluginChecker.isOnlyTopLoaded() && ArrayUtils.contains(modeArr,HiveModeInfo.EMBEDDED.getDisplayName())) {
    modeArr=ArrayUtils.removeElement(modeArr,HiveModeInfo.EMBEDDED.getDisplayName());
  }
  String[] hiveModesDisplay=HiveMetadataHelper.getHiveModesDisplay(getDistribution(),hiveVersion,hiveServer,false);
  doTestArray("String_Node_Str",modeArr,hiveModesDisplay);
}
Program: 124821
Project: 124821
Buggy source:
public static Set<DistributionModuleGroup> getModuleGroups(){
  Set<DistributionModuleGroup> hs=new HashSet<>();
  return hs;
}

Fixed version (ground truth):
public static Set<DistributionModuleGroup> getModuleGroups(){
  Set<DistributionModuleGroup> hs=new HashSet<>();
  hs.add(new DistributionModuleGroup(CDH550Constant.HDFS_MODULE_GROUP.getModuleName()));
  return hs;
}
Program: 124822
Project: 124822
Buggy source:
private void updatePortDecoration(){
  if (portWarningDecorator == null) {
    Image fieldDecorationWarningImage=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
    portWarningDecorator=new ControlDecoration(portText.getTextControl(),SWT.RIGHT | SWT.CENTER);
    portWarningDecorator.setMarginWidth(1);
    portWarningDecorator.setImage(fieldDecorationWarningImage);
    portWarningDecorator.setDescriptionText(Messages.getString("String_Node_Str"));
  }
  if (CassandraConnectionUtil.isOldVersion(getConnection())) {
    portWarningDecorator.hide();
  }
 else {
    portWarningDecorator.show();
  }
  String dbVersion=getConnection().getAttributes().get(INoSQLCommonAttributes.DB_VERSION);
  if (ICassandraConstants.DBVERSIONS[0].equals(dbVersion)) {
    if (ICassandraConstants.API_TYPES[0].equals(repositoryTranslator.getLabel(apiTypeCombo.getText()))) {
      portText.setText(ICassandraConstants.DATASTAX_PORT);
    }
 else {
      portText.setText(ICassandraConstants.DEFAULT_PORT);
    }
  }
}

Fixed version (ground truth):
private void updatePortDecoration(){
  if (portWarningDecorator == null) {
    Image fieldDecorationWarningImage=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
    portWarningDecorator=new ControlDecoration(portText.getTextControl(),SWT.RIGHT | SWT.CENTER);
    portWarningDecorator.setMarginWidth(1);
    portWarningDecorator.setImage(fieldDecorationWarningImage);
    portWarningDecorator.setDescriptionText(Messages.getString("String_Node_Str"));
  }
  if (CassandraConnectionUtil.isOldVersion(getConnection())) {
    portWarningDecorator.hide();
  }
 else {
    portWarningDecorator.show();
  }
  String dbVersion=getConnection().getAttributes().get(INoSQLCommonAttributes.DB_VERSION);
  if (ICassandraConstants.DBVERSIONS[0].equals(dbVersion)) {
    if (ICassandraConstants.API_TYPES[0].equals(repositoryTranslator.getLabel(apiTypeCombo.getText()))) {
      portText.setText(ICassandraConstants.DATASTAX_PORT);
    }
 else {
      portText.setText(ICassandraConstants.DEFAULT_PORT);
    }
  }
 else {
    portText.setText(ICassandraConstants.DEFAULT_PORT);
  }
}
Program: 124824
Project: 124824
Buggy source:
private void updatePortDecoration(){
  if (portWarningDecorator == null) {
    Image fieldDecorationWarningImage=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
    portWarningDecorator=new ControlDecoration(portText.getTextControl(),SWT.RIGHT | SWT.CENTER);
    portWarningDecorator.setMarginWidth(1);
    portWarningDecorator.setImage(fieldDecorationWarningImage);
    portWarningDecorator.setDescriptionText(Messages.getString("String_Node_Str"));
  }
  if (CassandraConnectionUtil.isOldVersion(getConnection())) {
    portWarningDecorator.hide();
  }
 else {
    portWarningDecorator.show();
  }
  String dbVersion=getConnection().getAttributes().get(INoSQLCommonAttributes.DB_VERSION);
  if (ICassandraConstants.DBVERSIONS[0].equals(dbVersion)) {
    if (ICassandraConstants.API_TYPES[0].equals(repositoryTranslator.getLabel(apiTypeCombo.getText()))) {
      portText.setText(ICassandraConstants.DATASTAX_PORT);
    }
 else {
      portText.setText(ICassandraConstants.DEFAULT_PORT);
    }
  }
}

Fixed version (ground truth):
private void updatePortDecoration(){
  if (portWarningDecorator == null) {
    Image fieldDecorationWarningImage=FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
    portWarningDecorator=new ControlDecoration(portText.getTextControl(),SWT.RIGHT | SWT.CENTER);
    portWarningDecorator.setMarginWidth(1);
    portWarningDecorator.setImage(fieldDecorationWarningImage);
    portWarningDecorator.setDescriptionText(Messages.getString("String_Node_Str"));
  }
  if (CassandraConnectionUtil.isOldVersion(getConnection())) {
    portWarningDecorator.hide();
  }
 else {
    portWarningDecorator.show();
  }
  String dbVersion=getConnection().getAttributes().get(INoSQLCommonAttributes.DB_VERSION);
  if (ICassandraConstants.DBVERSIONS[0].equals(dbVersion)) {
    if (ICassandraConstants.API_TYPES[0].equals(repositoryTranslator.getLabel(apiTypeCombo.getText()))) {
      portText.setText(ICassandraConstants.DATASTAX_PORT);
    }
 else {
      portText.setText(ICassandraConstants.DEFAULT_PORT);
    }
  }
 else {
    portText.setText(ICassandraConstants.DEFAULT_PORT);
  }
}
Program: 124826
Project: 124826
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  if (e.detail == SWT.CHECK) {
    try {
      TreeItem item=(TreeItem)e.item;
      boolean checked=item.getChecked();
      retrieving(item,checked);
    }
 catch (    Exception exception) {
      ExceptionHandler.process(exception);
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  super.widgetSelected(e);
  parentWizardPage.setPageComplete(false);
}
Program: 124827
Project: 124827
Buggy source:
@Override public void checkPerformed(final AbstractForm source){
  if (source.isStatusOnError()) {
    setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    setPageComplete(isRepositoryObjectEditable);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}

Fixed version (ground truth):
@Override public void checkPerformed(final AbstractForm source){
  if (source.isStatusOnError()) {
    setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    setPageComplete(!isRepositoryObjectEditable);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}
Program: 124828
Project: 124828
Buggy source:
@Override public void createControl(final Composite parent){
  NoSQLConnection connection=(NoSQLConnection)connectionItem.getConnection();
  String dbType=connection.getDbType();
  IWizardPageProvider wizPageProvider=NoSQLRepositoryFactory.getInstance().getWizardPageProvider(dbType);
  if (wizPageProvider == null) {
    return;
  }
  retrieveSchemaForm=wizPageProvider.createRetrieveSchemaForm(parent,connectionItem,creation,this);
  if (retrieveSchemaForm == null) {
    return;
  }
  retrieveSchemaForm.setReadOnly(!isRepositoryObjectEditable);
  AbstractForm.ICheckListener listener=new AbstractForm.ICheckListener(){
    @Override public void checkPerformed(    final AbstractForm source){
      if (source.isStatusOnError()) {
        setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        setPageComplete(isRepositoryObjectEditable);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
  retrieveSchemaForm.setListener(listener);
  setControl(retrieveSchemaForm);
  if (StringUtils.isNotEmpty(connectionItem.getProperty().getLabel())) {
    retrieveSchemaForm.checkFieldsValue();
  }
}

Fixed version (ground truth):
@Override public void createControl(final Composite parent){
  NoSQLConnection connection=(NoSQLConnection)connectionItem.getConnection();
  String dbType=connection.getDbType();
  IWizardPageProvider wizPageProvider=NoSQLRepositoryFactory.getInstance().getWizardPageProvider(dbType);
  if (wizPageProvider == null) {
    return;
  }
  retrieveSchemaForm=wizPageProvider.createRetrieveSchemaForm(parent,connectionItem,creation,this);
  if (retrieveSchemaForm == null) {
    return;
  }
  retrieveSchemaForm.setReadOnly(!isRepositoryObjectEditable);
  AbstractForm.ICheckListener listener=new AbstractForm.ICheckListener(){
    @Override public void checkPerformed(    final AbstractForm source){
      if (source.isStatusOnError()) {
        setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        setPageComplete(!isRepositoryObjectEditable);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
  retrieveSchemaForm.setListener(listener);
  setControl(retrieveSchemaForm);
  if (StringUtils.isNotEmpty(connectionItem.getProperty().getLabel())) {
    retrieveSchemaForm.checkFieldsValue();
  }
}
Program: 124830
Project: 124830
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  if (e.detail == SWT.CHECK) {
    try {
      TreeItem item=(TreeItem)e.item;
      boolean checked=item.getChecked();
      retrieving(item,checked);
    }
 catch (    Exception exception) {
      ExceptionHandler.process(exception);
    }
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  super.widgetSelected(e);
  parentWizardPage.setPageComplete(false);
}
Program: 124831
Project: 124831
Buggy source:
@Override public void checkPerformed(final AbstractForm source){
  if (source.isStatusOnError()) {
    setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    setPageComplete(isRepositoryObjectEditable);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}

Fixed version (ground truth):
@Override public void checkPerformed(final AbstractForm source){
  if (source.isStatusOnError()) {
    setPageComplete(false);
    setErrorMessage(source.getStatus());
  }
 else {
    setPageComplete(!isRepositoryObjectEditable);
    setErrorMessage(null);
    setMessage(source.getStatus(),source.getStatusLevel());
  }
}
Program: 124832
Project: 124832
Buggy source:
@Override public void createControl(final Composite parent){
  NoSQLConnection connection=(NoSQLConnection)connectionItem.getConnection();
  String dbType=connection.getDbType();
  IWizardPageProvider wizPageProvider=NoSQLRepositoryFactory.getInstance().getWizardPageProvider(dbType);
  if (wizPageProvider == null) {
    return;
  }
  retrieveSchemaForm=wizPageProvider.createRetrieveSchemaForm(parent,connectionItem,creation,this);
  if (retrieveSchemaForm == null) {
    return;
  }
  retrieveSchemaForm.setReadOnly(!isRepositoryObjectEditable);
  AbstractForm.ICheckListener listener=new AbstractForm.ICheckListener(){
    @Override public void checkPerformed(    final AbstractForm source){
      if (source.isStatusOnError()) {
        setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        setPageComplete(isRepositoryObjectEditable);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
  retrieveSchemaForm.setListener(listener);
  setControl(retrieveSchemaForm);
  if (StringUtils.isNotEmpty(connectionItem.getProperty().getLabel())) {
    retrieveSchemaForm.checkFieldsValue();
  }
}

Fixed version (ground truth):
@Override public void createControl(final Composite parent){
  NoSQLConnection connection=(NoSQLConnection)connectionItem.getConnection();
  String dbType=connection.getDbType();
  IWizardPageProvider wizPageProvider=NoSQLRepositoryFactory.getInstance().getWizardPageProvider(dbType);
  if (wizPageProvider == null) {
    return;
  }
  retrieveSchemaForm=wizPageProvider.createRetrieveSchemaForm(parent,connectionItem,creation,this);
  if (retrieveSchemaForm == null) {
    return;
  }
  retrieveSchemaForm.setReadOnly(!isRepositoryObjectEditable);
  AbstractForm.ICheckListener listener=new AbstractForm.ICheckListener(){
    @Override public void checkPerformed(    final AbstractForm source){
      if (source.isStatusOnError()) {
        setPageComplete(false);
        setErrorMessage(source.getStatus());
      }
 else {
        setPageComplete(!isRepositoryObjectEditable);
        setErrorMessage(null);
        setMessage(source.getStatus(),source.getStatusLevel());
      }
    }
  }
;
  retrieveSchemaForm.setListener(listener);
  setControl(retrieveSchemaForm);
  if (StringUtils.isNotEmpty(connectionItem.getProperty().getLabel())) {
    retrieveSchemaForm.checkFieldsValue();
  }
}
Program: 124834
Project: 124834
Buggy source:
private void checkServices(){
  Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties=new HashMap<EHadoopServiceType,HadoopServiceProperties>();
  HadoopServiceProperties nnProperties=new HadoopServiceProperties();
  initCommonProperties(nnProperties);
  nnProperties.setNameNode(getConnection().getNameNodeURI());
  serviceTypeToProperties.put(EHadoopServiceType.NAMENODE,nnProperties);
  HadoopServiceProperties rmORjtProperties=new HadoopServiceProperties();
  initCommonProperties(rmORjtProperties);
  if (getConnection().isUseYarn()) {
    rmORjtProperties.setResourceManager(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.RESOURCE_MANAGER,rmORjtProperties);
  }
 else {
    rmORjtProperties.setJobTracker(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.JOBTRACKER,rmORjtProperties);
  }
  if (getConnection().isUseCustomVersion()) {
    nnProperties.setUid(connectionItem.getProperty().getId());
    nnProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.COMMON.getName()));
    rmORjtProperties.setUid(connectionItem.getProperty().getId());
    rmORjtProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.MAP_REDUCE.getName()));
  }
  new CheckHadoopServicesDialog(getShell(),serviceTypeToProperties).open();
}

Fixed version (ground truth):
private void checkServices(){
  Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties=new HashMap<EHadoopServiceType,HadoopServiceProperties>();
  HadoopServiceProperties nnProperties=new HadoopServiceProperties();
  initCommonProperties(nnProperties);
  nnProperties.setNameNode(getConnection().getNameNodeURI());
  serviceTypeToProperties.put(EHadoopServiceType.NAMENODE,nnProperties);
  HadoopServiceProperties rmORjtProperties=new HadoopServiceProperties();
  initCommonProperties(rmORjtProperties);
  if (getConnection().isUseYarn()) {
    rmORjtProperties.setResourceManager(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.RESOURCE_MANAGER,rmORjtProperties);
  }
 else {
    rmORjtProperties.setJobTracker(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.JOBTRACKER,rmORjtProperties);
  }
  if (getConnection().isUseCustomVersion()) {
    nnProperties.setUid(connectionItem.getProperty().getId() + "String_Node_Str" + ECustomVersionGroup.COMMON.getName());
    nnProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.COMMON.getName()));
    rmORjtProperties.setUid(connectionItem.getProperty().getId() + "String_Node_Str" + ECustomVersionGroup.MAP_REDUCE.getName());
    rmORjtProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.MAP_REDUCE.getName()));
  }
  new CheckHadoopServicesDialog(getShell(),serviceTypeToProperties).open();
}
Program: 124835
Project: 124835
Buggy source:
/** 
 * is current hadoop version support JobHistoryPrincipal
 * @return
 */
protected boolean isCurrentHadoopVersionSupportJobHistoryPrincipal(){
  if (hadoopDistribution == null || hadoopVersison == null) {
    return false;
  }
  boolean isSupport=false;
  if (hadoopVersison == EHadoopVersion4Drivers.MICROSOFT_HD_INSIGHT_3_1 || hadoopVersison == EHadoopVersion4Drivers.MICROSOFT_HD_INSIGHT_3_2) {
    return false;
  }
 else {
    if (hadoopDistribution == EHadoopDistributions.CUSTOM) {
      return true;
    }
 else {
switch (hadoopVersison) {
case PIVOTAL_HD_1_0_1:
case PIVOTAL_HD_2_0:
case HDP_2_0:
case HDP_2_1:
case HDP_2_2:
case CLOUDERA_CDH4_YARN:
case CLOUDERA_CDH5:
case CLOUDERA_CDH5_1:
case CLOUDERA_CDH5_4:
case MAPR401:
case APACHE_2_4_0_EMR:
case EMR_4_0_0:
        isSupport=true;
      break;
default :
    isSupport=false;
}
}
}
return isSupport;
}

Fixed version (ground truth):
/** 
 * is current hadoop version support JobHistoryPrincipal
 * @return
 */
protected boolean isCurrentHadoopVersionSupportJobHistoryPrincipal(){
  if (hadoopDistribution == null || hadoopVersison == null) {
    return false;
  }
  boolean isSupport=false;
  if (hadoopVersison == EHadoopVersion4Drivers.MICROSOFT_HD_INSIGHT_3_1 || hadoopVersison == EHadoopVersion4Drivers.MICROSOFT_HD_INSIGHT_3_2) {
    return false;
  }
 else {
    if (hadoopDistribution == EHadoopDistributions.CUSTOM) {
      return true;
    }
 else {
switch (hadoopVersison) {
case PIVOTAL_HD_1_0_1:
case PIVOTAL_HD_2_0:
case HDP_2_0:
case HDP_2_1:
case HDP_2_2:
case HDP_2_3:
case CLOUDERA_CDH4_YARN:
case CLOUDERA_CDH5:
case CLOUDERA_CDH5_1:
case CLOUDERA_CDH5_4:
case MAPR401:
case APACHE_2_4_0_EMR:
case EMR_4_0_0:
        isSupport=true;
      break;
default :
    isSupport=false;
}
}
}
return isSupport;
}
Program: 124836
Project: 124836
Buggy source:
private void checkServices(){
  Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties=new HashMap<EHadoopServiceType,HadoopServiceProperties>();
  HadoopServiceProperties nnProperties=new HadoopServiceProperties();
  initCommonProperties(nnProperties);
  nnProperties.setNameNode(getConnection().getNameNodeURI());
  serviceTypeToProperties.put(EHadoopServiceType.NAMENODE,nnProperties);
  HadoopServiceProperties rmORjtProperties=new HadoopServiceProperties();
  initCommonProperties(rmORjtProperties);
  if (getConnection().isUseYarn()) {
    rmORjtProperties.setResourceManager(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.RESOURCE_MANAGER,rmORjtProperties);
  }
 else {
    rmORjtProperties.setJobTracker(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.JOBTRACKER,rmORjtProperties);
  }
  if (getConnection().isUseCustomVersion()) {
    nnProperties.setUid(connectionItem.getProperty().getId());
    nnProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.COMMON.getName()));
    rmORjtProperties.setUid(connectionItem.getProperty().getId());
    rmORjtProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.MAP_REDUCE.getName()));
  }
  new CheckHadoopServicesDialog(getShell(),serviceTypeToProperties).open();
}

Fixed version (ground truth):
private void checkServices(){
  Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties=new HashMap<EHadoopServiceType,HadoopServiceProperties>();
  HadoopServiceProperties nnProperties=new HadoopServiceProperties();
  initCommonProperties(nnProperties);
  nnProperties.setNameNode(getConnection().getNameNodeURI());
  serviceTypeToProperties.put(EHadoopServiceType.NAMENODE,nnProperties);
  HadoopServiceProperties rmORjtProperties=new HadoopServiceProperties();
  initCommonProperties(rmORjtProperties);
  if (getConnection().isUseYarn()) {
    rmORjtProperties.setResourceManager(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.RESOURCE_MANAGER,rmORjtProperties);
  }
 else {
    rmORjtProperties.setJobTracker(getConnection().getJobTrackerURI());
    serviceTypeToProperties.put(EHadoopServiceType.JOBTRACKER,rmORjtProperties);
  }
  if (getConnection().isUseCustomVersion()) {
    nnProperties.setUid(connectionItem.getProperty().getId() + "String_Node_Str" + ECustomVersionGroup.COMMON.getName());
    nnProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.COMMON.getName()));
    rmORjtProperties.setUid(connectionItem.getProperty().getId() + "String_Node_Str" + ECustomVersionGroup.MAP_REDUCE.getName());
    rmORjtProperties.setCustomJars(HCVersionUtil.getCustomVersionMap(getConnection()).get(ECustomVersionGroup.MAP_REDUCE.getName()));
  }
  new CheckHadoopServicesDialog(getShell(),serviceTypeToProperties).open();
}
Program: 124839
Project: 124839
Buggy source:
private static void addKerberos2Client(WebClient client,HCatalogConnection connection){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection != null && hcConnection.isEnableKerberos()) {
    KerberosAuthOutInterceptor kbInterceptor=new KerberosAuthOutInterceptor();
    AuthorizationPolicy policy=new AuthorizationPolicy();
    policy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_NEGOTIATE);
    kbInterceptor.setPolicy(policy);
    java.util.Map<String,String> properties=new HashMap<String,String>();
    kbInterceptor.setServicePrincipalName(StringUtils.trimToEmpty(connection.getKrbPrincipal()));
    kbInterceptor.setRealm(StringUtils.trimToEmpty(connection.getKrbRealm()));
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    if (hcConnection.isUseKeytab()) {
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str",hcConnection.getKeytabPrincipal());
      properties.put("String_Node_Str",hcConnection.getKeytab());
    }
    kbInterceptor.setLoginConfig(new KerberosPolicyConfig(properties));
    WebClient.getConfig(client).getOutInterceptors().add(kbInterceptor);
  }
}

Fixed version (ground truth):
private static void addKerberos2Client(WebClient client,HCatalogConnection connection){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection != null && hcConnection.isEnableKerberos()) {
    KerberosAuthOutInterceptor kbInterceptor=new KerberosAuthOutInterceptor();
    AuthorizationPolicy policy=new AuthorizationPolicy();
    policy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_NEGOTIATE);
    kbInterceptor.setPolicy(policy);
    java.util.Map<String,String> properties=new HashMap<String,String>();
    String krbPrincipal=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbPrincipal()));
    kbInterceptor.setServicePrincipalName(StringUtils.trimToEmpty(krbPrincipal));
    String krbRealm=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbRealm()));
    kbInterceptor.setRealm(StringUtils.trimToEmpty(krbRealm));
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    if (hcConnection.isUseKeytab()) {
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytabPrincipal()));
      properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytab()));
    }
    kbInterceptor.setLoginConfig(new KerberosPolicyConfig(properties));
    WebClient.getConfig(client).getOutInterceptors().add(kbInterceptor);
  }
}
Program: 124840
Project: 124840
Buggy source:
private static void addKerberos2Client(WebClient client,HCatalogConnection connection){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection != null && hcConnection.isEnableKerberos()) {
    KerberosAuthOutInterceptor kbInterceptor=new KerberosAuthOutInterceptor();
    AuthorizationPolicy policy=new AuthorizationPolicy();
    policy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_NEGOTIATE);
    kbInterceptor.setPolicy(policy);
    java.util.Map<String,String> properties=new HashMap<String,String>();
    kbInterceptor.setServicePrincipalName(StringUtils.trimToEmpty(connection.getKrbPrincipal()));
    kbInterceptor.setRealm(StringUtils.trimToEmpty(connection.getKrbRealm()));
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    if (hcConnection.isUseKeytab()) {
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str",hcConnection.getKeytabPrincipal());
      properties.put("String_Node_Str",hcConnection.getKeytab());
    }
    kbInterceptor.setLoginConfig(new KerberosPolicyConfig(properties));
    WebClient.getConfig(client).getOutInterceptors().add(kbInterceptor);
  }
}

Fixed version (ground truth):
private static void addKerberos2Client(WebClient client,HCatalogConnection connection){
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  if (hcConnection != null && hcConnection.isEnableKerberos()) {
    KerberosAuthOutInterceptor kbInterceptor=new KerberosAuthOutInterceptor();
    AuthorizationPolicy policy=new AuthorizationPolicy();
    policy.setAuthorizationType(HttpAuthHeader.AUTH_TYPE_NEGOTIATE);
    kbInterceptor.setPolicy(policy);
    java.util.Map<String,String> properties=new HashMap<String,String>();
    String krbPrincipal=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbPrincipal()));
    kbInterceptor.setServicePrincipalName(StringUtils.trimToEmpty(krbPrincipal));
    String krbRealm=ConnectionContextHelper.getParamValueOffContext(connection,StringUtils.trimToEmpty(connection.getKrbRealm()));
    kbInterceptor.setRealm(StringUtils.trimToEmpty(krbRealm));
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    properties.put("String_Node_Str","String_Node_Str");
    if (hcConnection.isUseKeytab()) {
      properties.put("String_Node_Str","String_Node_Str");
      properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytabPrincipal()));
      properties.put("String_Node_Str",ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getKeytab()));
    }
    kbInterceptor.setLoginConfig(new KerberosPolicyConfig(properties));
    WebClient.getConfig(client).getOutInterceptors().add(kbInterceptor);
  }
}
Program: 124841
Project: 124841
Buggy source:
/** 
 * Get the appropriate implementation of   {@link IExtractSchemaService} for the given {@code path} of file. Thismethod should be improved if there are more types of file to support in the future. <p> DOC ycbai Comment method "getService".
 * @param connectionBean
 * @param path
 * @return
 */
public static IExtractSchemaService<HDFSConnection> getService(HDFSConnectionBean connectionBean,ClassLoader classLoader,Object path){
  IExtractSchemaService<HDFSConnection> service=null;
  boolean isSequenceFile=true;
  try {
    Object fs=HadoopServerUtil.getDFS(connectionBean,classLoader);
    Object conf=HadoopServerUtil.getConfiguration(connectionBean,classLoader);
    ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{fs,path,conf},Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader));
  }
 catch (  Exception e) {
    isSequenceFile=false;
  }
  if (isSequenceFile) {
    service=new ExtractSequenceFileSchemaService(classLoader);
  }
 else   if (ExtractAVROFileSchemaService.isAnAVROFormattedFile(String.valueOf(path))) {
    service=new ExtractAVROFileSchemaService(classLoader);
  }
 else {
    service=new ExtractTextFileSchemaService(classLoader);
  }
  return service;
}

Fixed version (ground truth):
/** 
 * Get the appropriate implementation of   {@link IExtractSchemaService} for the given {@code path} of file. Thismethod should be improved if there are more types of file to support in the future. <p> DOC ycbai Comment method "getService".
 * @param connectionBean
 * @param path
 * @return
 */
public static IExtractSchemaService<HDFSConnection> getService(HDFSConnectionBean connectionBean,ClassLoader classLoader,Object path){
  IExtractSchemaService<HDFSConnection> service=null;
  boolean isSequenceFile=true;
  ClassLoader oldClassLoader=Thread.currentThread().getContextClassLoader();
  try {
    Object fs=HadoopServerUtil.getDFS(connectionBean,classLoader);
    Object conf=HadoopServerUtil.getConfiguration(connectionBean,classLoader);
    Thread.currentThread().setContextClassLoader(classLoader);
    ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{fs,path,conf},Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader));
  }
 catch (  Exception e) {
    isSequenceFile=false;
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldClassLoader);
  }
  if (isSequenceFile) {
    service=new ExtractSequenceFileSchemaService(classLoader);
  }
 else   if (ExtractAVROFileSchemaService.isAnAVROFormattedFile(String.valueOf(path))) {
    service=new ExtractAVROFileSchemaService(classLoader);
  }
 else {
    service=new ExtractTextFileSchemaService(classLoader);
  }
  return service;
}
Program: 124842
Project: 124842
Buggy source:
/** 
 * Get the appropriate implementation of   {@link IExtractSchemaService} for the given {@code path} of file. Thismethod should be improved if there are more types of file to support in the future. <p> DOC ycbai Comment method "getService".
 * @param connectionBean
 * @param path
 * @return
 */
public static IExtractSchemaService<HDFSConnection> getService(HDFSConnectionBean connectionBean,ClassLoader classLoader,Object path){
  IExtractSchemaService<HDFSConnection> service=null;
  boolean isSequenceFile=true;
  try {
    Object fs=HadoopServerUtil.getDFS(connectionBean,classLoader);
    Object conf=HadoopServerUtil.getConfiguration(connectionBean,classLoader);
    ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{fs,path,conf},Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader));
  }
 catch (  Exception e) {
    isSequenceFile=false;
  }
  if (isSequenceFile) {
    service=new ExtractSequenceFileSchemaService(classLoader);
  }
 else   if (ExtractAVROFileSchemaService.isAnAVROFormattedFile(String.valueOf(path))) {
    service=new ExtractAVROFileSchemaService(classLoader);
  }
 else {
    service=new ExtractTextFileSchemaService(classLoader);
  }
  return service;
}

Fixed version (ground truth):
/** 
 * Get the appropriate implementation of   {@link IExtractSchemaService} for the given {@code path} of file. Thismethod should be improved if there are more types of file to support in the future. <p> DOC ycbai Comment method "getService".
 * @param connectionBean
 * @param path
 * @return
 */
public static IExtractSchemaService<HDFSConnection> getService(HDFSConnectionBean connectionBean,ClassLoader classLoader,Object path){
  IExtractSchemaService<HDFSConnection> service=null;
  boolean isSequenceFile=true;
  ClassLoader oldClassLoader=Thread.currentThread().getContextClassLoader();
  try {
    Object fs=HadoopServerUtil.getDFS(connectionBean,classLoader);
    Object conf=HadoopServerUtil.getConfiguration(connectionBean,classLoader);
    Thread.currentThread().setContextClassLoader(classLoader);
    ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{fs,path,conf},Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader),Class.forName("String_Node_Str",true,classLoader));
  }
 catch (  Exception e) {
    isSequenceFile=false;
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldClassLoader);
  }
  if (isSequenceFile) {
    service=new ExtractSequenceFileSchemaService(classLoader);
  }
 else   if (ExtractAVROFileSchemaService.isAnAVROFormattedFile(String.valueOf(path))) {
    service=new ExtractAVROFileSchemaService(classLoader);
  }
 else {
    service=new ExtractTextFileSchemaService(classLoader);
  }
  return service;
}
Program: 124843
Project: 124843
Buggy source:
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  HCatalogConnection connection=HCatalogFactory.eINSTANCE.createHCatalogConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  HadoopSubConnectionItem connectionItem=HCatalogFactory.eINSTANCE.createHCatalogConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  setParameters(connection,initParams);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}

Fixed version (ground truth):
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  HCatalogConnection connection=HCatalogFactory.eINSTANCE.createHCatalogConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  initializeConnectionParameters(connection);
  HadoopSubConnectionItem connectionItem=HCatalogFactory.eINSTANCE.createHCatalogConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  setParameters(connection,initParams);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}
Program: 124844
Project: 124844
Buggy source:
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  HDFSConnection connection=HDFSFactory.eINSTANCE.createHDFSConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  HadoopSubConnectionItem connectionItem=HDFSFactory.eINSTANCE.createHDFSConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}

Fixed version (ground truth):
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  HDFSConnection connection=HDFSFactory.eINSTANCE.createHDFSConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  initializeConnectionParameters(connection);
  HadoopSubConnectionItem connectionItem=HDFSFactory.eINSTANCE.createHDFSConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}
Program: 124845
Project: 124845
Buggy source:
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  OozieConnection connection=OozieFactory.eINSTANCE.createOozieConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  HadoopSubConnectionItem connectionItem=OozieFactory.eINSTANCE.createOozieConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  setParameters(connection,initParams);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}

Fixed version (ground truth):
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  OozieConnection connection=OozieFactory.eINSTANCE.createOozieConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  HadoopSubConnectionItem connectionItem=OozieFactory.eINSTANCE.createOozieConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  setParameters(connection,initParams);
  initializeConnectionParameters(connection);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}
Program: 124846
Project: 124846
Buggy source:
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  HCatalogConnection connection=HCatalogFactory.eINSTANCE.createHCatalogConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  HadoopSubConnectionItem connectionItem=HCatalogFactory.eINSTANCE.createHCatalogConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  setParameters(connection,initParams);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}

Fixed version (ground truth):
@Override public ConnectionItem create(Map<String,Map<String,String>> initParams) throws CoreException {
  HCatalogConnection connection=HCatalogFactory.eINSTANCE.createHCatalogConnection();
  Property connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
  setPropertyParameters(connectionProperty);
  initializeConnectionParameters(connection);
  HadoopSubConnectionItem connectionItem=HCatalogFactory.eINSTANCE.createHCatalogConnectionItem();
  connectionItem.setProperty(connectionProperty);
  connectionItem.setConnection(connection);
  setParameters(connection,initParams);
  appendToHadoopCluster(connectionItem);
  return connectionItem;
}