nus-yam/ex-repair huggingface dataset:
Program: 124587
Project: 124587
Buggy source:
@Test public void testModuleGroups() throws Exception {
  Map<String,String> results=new HashMap<>();
  results.put(CDH5100Constant.SPARK_MODULE_GROUP.getModuleName(),"String_Node_Str");
  results.put(CDH5100Constant.HDFS_MODULE_GROUP.getModuleName(),"String_Node_Str");
  results.put(CDH5100Constant.MAPREDUCE_MODULE_GROUP.getModuleName(),"String_Node_Str");
  Set<DistributionModuleGroup> moduleGroups=CDH5100SparkStreamingModuleGroup.getModuleGroups();
  assertEquals(3,moduleGroups.size());
  moduleGroups.iterator();
  for (  DistributionModuleGroup module : moduleGroups) {
    assertTrue("String_Node_Str" + module.getModuleName(),results.containsKey(module.getModuleName()));
    if (results.get(module.getModuleName()) == null) {
      assertTrue("String_Node_Str" + module.getModuleName() + "String_Node_Str",results.get(module.getModuleName()) == null);
    }
 else {
      assertTrue("String_Node_Str" + module.getModuleName() + "String_Node_Str"+ results.get(module.getModuleName())+ "String_Node_Str",results.get(module.getModuleName()) != null);
      assertEquals(results.get(module.getModuleName()),module.getRequiredIf().getConditionString());
    }
  }
}

Fixed version (ground truth):
@Test public void testModuleGroups() throws Exception {
  Map<String,Set<String>> results=new HashMap<>();
  Set<String> hs1=new HashSet<>();
  hs1.add("String_Node_Str");
  results.put(CDH5100Constant.SPARK_MODULE_GROUP.getModuleName(),hs1);
  Set<String> hs2=new HashSet<>();
  hs2.add("String_Node_Str");
  results.put(CDH5100Constant.SPARK2_MODULE_GROUP.getModuleName(),hs2);
  Set<String> hs3=new HashSet<>();
  hs3.add("String_Node_Str");
  results.put(CDH5100Constant.HDFS_MODULE_GROUP_SPARK1_6.getModuleName(),hs3);
  Set<String> hs4=new HashSet<>();
  hs4.add("String_Node_Str");
  results.put(CDH5100Constant.HDFS_MODULE_GROUP_SPARK2_1.getModuleName(),hs4);
  Set<String> hs5=new HashSet<>();
  hs5.add("String_Node_Str");
  hs5.add("String_Node_Str");
  results.put(CDH5100Constant.HDFS_MODULE_GROUP_COMMON.getModuleName(),hs5);
  Set<String> hs6=new HashSet<>();
  hs6.add("String_Node_Str");
  hs6.add("String_Node_Str");
  results.put(CDH5100Constant.MAPREDUCE_MODULE_GROUP.getModuleName(),hs6);
  Set<DistributionModuleGroup> moduleGroups=CDH5100SparkStreamingModuleGroup.getModuleGroups();
  assertEquals(8,moduleGroups.size());
  moduleGroups.iterator();
  for (  DistributionModuleGroup module : moduleGroups) {
    assertTrue("String_Node_Str" + module.getModuleName(),results.containsKey(module.getModuleName()));
    if (results.get(module.getModuleName()) == null) {
      assertTrue("String_Node_Str" + module.getModuleName() + "String_Node_Str",results.get(module.getModuleName()) == null);
    }
 else {
      assertTrue("String_Node_Str" + module.getModuleName() + "String_Node_Str"+ results.get(module.getModuleName())+ "String_Node_Str",results.get(module.getModuleName()) != null);
      assertTrue(results.get(module.getModuleName()).contains(module.getRequiredIf().getConditionString()));
    }
  }
}
Program: 124589
Project: 124589
Buggy source:
private List<MetadataColumn> extractTheColumns(NoSQLConnection connection,String cypher) throws NoSQLExtractSchemaException {
  List<MetadataColumn> metadataColumns=new ArrayList<MetadataColumn>();
  try {
    ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
    Object db=Neo4jConnectionUtil.getDB(connection);
    if (db == null) {
      return metadataColumns;
    }
    Iterator<Map<String,Object>> resultIterator=Neo4jConnectionUtil.getResultIterator(connection,cypher);
    if (resultIterator == null) {
      return metadataColumns;
    }
    List<String> columnLabels=new ArrayList<String>();
    int rowNum=0;
    while (resultIterator.hasNext()) {
      if (rowNum > COUNT_ROWS) {
        break;
      }
      rowNum++;
      Map<String,Object> row=resultIterator.next();
      for (      Entry<String,Object> column : row.entrySet()) {
        String key=column.getKey();
        Object value=column.getValue();
        if (StringUtils.isEmpty(key) || value == null) {
          continue;
        }
        addMetadataColumns(classLoader,db,key,value,metadataColumns,columnLabels,Neo4jConnectionUtil.isVersion1(connection));
      }
    }
  }
 catch (  Exception e) {
    throw new NoSQLExtractSchemaException(e);
  }
  return metadataColumns;
}

Fixed version (ground truth):
private List<MetadataColumn> extractTheColumns(NoSQLConnection connection,String cypher) throws NoSQLExtractSchemaException {
  List<MetadataColumn> metadataColumns=new ArrayList<MetadataColumn>();
  Object db=null;
  try {
    ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
    Neo4jConnectionUtil.closeConnections();
    db=Neo4jConnectionUtil.getDB(connection);
    if (db == null) {
      return metadataColumns;
    }
    Iterator<Map<String,Object>> resultIterator=Neo4jConnectionUtil.getResultIterator(connection,cypher,db);
    if (resultIterator == null) {
      return metadataColumns;
    }
    List<String> columnLabels=new ArrayList<String>();
    int rowNum=0;
    while (resultIterator.hasNext()) {
      if (rowNum > COUNT_ROWS) {
        break;
      }
      rowNum++;
      Map<String,Object> row=resultIterator.next();
      for (      Entry<String,Object> column : row.entrySet()) {
        String key=column.getKey();
        Object value=column.getValue();
        if (StringUtils.isEmpty(key) || value == null) {
          continue;
        }
        addMetadataColumns(classLoader,db,key,value,metadataColumns,columnLabels,Neo4jConnectionUtil.isVersion1(connection));
      }
    }
  }
 catch (  Exception e) {
    throw new NoSQLExtractSchemaException(e);
  }
 finally {
    if (db != null) {
      Neo4jConnectionUtil.shutdownNeo4JDb(db);
    }
  }
  return metadataColumns;
}
Program: 124590
Project: 124590
Buggy source:
public static synchronized boolean checkConnection(NoSQLConnection connection) throws NoSQLServerException {
  boolean canConnect=true;
  final ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
  try {
    final Object db=getDB(connection);
    boolean isRemote=Boolean.valueOf(connection.getAttributes().get(INeo4jAttributes.REMOTE_SERVER));
    if (isRemote) {
      NoSQLReflection.invokeMethod(db,"String_Node_Str",new Object[0]);
    }
 else {
      if (isVersion1(connection)) {
        doCheck(db,classLoader);
      }
 else {
        new ExecutionUnitWithTransaction(){
          @Override protected Object run() throws Exception {
            doCheck(db,classLoader);
            return null;
          }
        }
.execute(db);
      }
    }
  }
 catch (  Exception e) {
    canConnect=false;
    resetAll();
    throw new NoSQLServerException(Messages.getString("String_Node_Str"),e);
  }
  return canConnect;
}

Fixed version (ground truth):
public static synchronized boolean checkConnection(NoSQLConnection connection) throws NoSQLServerException {
  boolean canConnect=true;
  final ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
  Object dbConnection=null;
  try {
    final Object db=getDB(connection);
    dbConnection=db;
    boolean isRemote=Boolean.valueOf(connection.getAttributes().get(INeo4jAttributes.REMOTE_SERVER));
    if (isRemote) {
      NoSQLReflection.invokeMethod(db,"String_Node_Str",new Object[0]);
    }
 else {
      if (isVersion1(connection)) {
        doCheck(db,classLoader);
      }
 else {
        new ExecutionUnitWithTransaction(){
          @Override protected Object run() throws Exception {
            doCheck(db,classLoader);
            return null;
          }
        }
.execute(db);
      }
    }
  }
 catch (  Exception e) {
    canConnect=false;
    resetAll();
    throw new NoSQLServerException(Messages.getString("String_Node_Str"),e);
  }
 finally {
    if (dbConnection != null) {
      shutdownNeo4JDb(dbConnection);
    }
  }
  return canConnect;
}
Program: 124591
Project: 124591
Buggy source:
private static void shutdownNeo4JDb(final Object db){
  try {
    NoSQLReflection.invokeMethod(db,"String_Node_Str",new Object[0]);
  }
 catch (  NoSQLReflectionException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void shutdownNeo4JDb(final Object db){
  try {
    NoSQLReflection.invokeMethod(db,"String_Node_Str",new Object[0]);
  }
 catch (  NoSQLReflectionException e) {
    e.printStackTrace();
  }
}
Program: 124593
Project: 124593
Buggy source:
public static synchronized Iterator<Map<String,Object>> getResultIterator(NoSQLConnection connection,String cypher) throws NoSQLServerException {
  Iterator<Map<String,Object>> resultIterator=null;
  Object db=getDB(connection);
  ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
  String isRemoteAttr=connection.getAttributes().get(INeo4jAttributes.REMOTE_SERVER);
  boolean isRemote=isRemoteAttr == null ? false : Boolean.valueOf(isRemoteAttr);
  try {
    if (isRemote) {
      Object queryResult=NoSQLReflection.invokeMethod(getQueryEngine(db,classLoader),"String_Node_Str",new Object[]{cypher,null},String.class,Map.class);
      resultIterator=(Iterator<Map<String,Object>>)NoSQLReflection.invokeMethod(queryResult,"String_Node_Str",new Object[0]);
    }
 else {
      Object executionResult=NoSQLReflection.invokeMethod(getExecutionEngine(db,classLoader),"String_Node_Str",new Object[]{cypher});
      resultIterator=(Iterator<Map<String,Object>>)NoSQLReflection.invokeMethod(executionResult,"String_Node_Str",new Object[0]);
    }
  }
 catch (  NoSQLReflectionException e) {
    throw new NoSQLServerException(e);
  }
  return resultIterator;
}

Fixed version (ground truth):
public static synchronized Iterator<Map<String,Object>> getResultIterator(NoSQLConnection connection,String cypher,Object db1) throws NoSQLServerException {
  Iterator<Map<String,Object>> resultIterator=null;
  Object db=db1;
  try {
    db=getDB(connection,true);
    ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
    String isRemoteAttr=connection.getAttributes().get(INeo4jAttributes.REMOTE_SERVER);
    boolean isRemote=isRemoteAttr == null ? false : Boolean.valueOf(isRemoteAttr);
    if (isRemote) {
      Object queryResult=NoSQLReflection.invokeMethod(getQueryEngine(db,classLoader),"String_Node_Str",new Object[]{cypher,null},String.class,Map.class);
      resultIterator=(Iterator<Map<String,Object>>)NoSQLReflection.invokeMethod(queryResult,"String_Node_Str",new Object[0]);
    }
 else {
      Object executionResult=NoSQLReflection.invokeMethod(getExecutionEngine(db,classLoader),"String_Node_Str",new Object[]{cypher});
      resultIterator=(Iterator<Map<String,Object>>)NoSQLReflection.invokeMethod(executionResult,"String_Node_Str",new Object[0]);
    }
  }
 catch (  NoSQLReflectionException e) {
    throw new NoSQLServerException(e);
  }
  return resultIterator;
}
Program: 124597
Project: 124597
Buggy source:
@Override protected void updateEditableStatus(boolean isEditable){
  whcHostnameText.setEditable(isEditable);
  whcPortText.setEditable(isEditable);
  whcPortText.setEditable(isEditable);
  whcUsernameText.setEditable(isEditable);
  whcJobResultFolderText.setEditable(isEditable);
  hdiUsernameText.setEditable(isEditable);
  hdiPasswordText.setEditable(isEditable);
  azureHostnameText.setEditable(isEditable);
  azureContainerText.setEditable(isEditable);
  azureUsernameText.setEditable(isEditable);
  azurePasswordText.setEditable(isEditable);
  azureDeployBlobText.setEditable(isEditable);
  ((HadoopClusterForm)this.getParent()).updateEditableStatus(isEditable);
}

Fixed version (ground truth):
@Override protected void updateEditableStatus(boolean isEditable){
  whcHostnameText.setEditable(isEditable);
  whcPortText.setEditable(isEditable);
  whcPortText.setEditable(isEditable);
  whcUsernameText.setEditable(isEditable);
  hdiUsernameText.setEditable(isEditable);
  hdiPasswordText.setEditable(isEditable);
  azureHostnameText.setEditable(isEditable);
  azureContainerText.setEditable(isEditable);
  azureUsernameText.setEditable(isEditable);
  azurePasswordText.setEditable(isEditable);
  azureDeployBlobText.setEditable(isEditable);
  ((HadoopClusterForm)this.getParent()).updateEditableStatus(isEditable);
}
Program: 124598
Project: 124598
Buggy source:
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  whcHostnameText.setReadOnly(readOnly);
  whcPortText.setReadOnly(readOnly);
  whcUsernameText.setEnabled(!readOnly);
  whcJobResultFolderText.setReadOnly(readOnly);
  hdiUsernameText.setReadOnly(readOnly);
  hdiPasswordText.setReadOnly(readOnly);
  azureHostnameText.setReadOnly(readOnly);
  azureContainerText.setReadOnly(readOnly);
  azureUsernameText.setReadOnly(readOnly);
  azurePasswordText.setReadOnly(readOnly);
  azureDeployBlobText.setReadOnly(readOnly);
}

Fixed version (ground truth):
@Override protected void adaptFormToReadOnly(){
  readOnly=isReadOnly();
  whcHostnameText.setReadOnly(readOnly);
  whcPortText.setReadOnly(readOnly);
  whcUsernameText.setEnabled(!readOnly);
  hdiUsernameText.setReadOnly(readOnly);
  hdiPasswordText.setReadOnly(readOnly);
  azureHostnameText.setReadOnly(readOnly);
  azureContainerText.setReadOnly(readOnly);
  azureUsernameText.setReadOnly(readOnly);
  azurePasswordText.setReadOnly(readOnly);
  azureDeployBlobText.setReadOnly(readOnly);
}
Program: 124599
Project: 124599
Buggy source:
private void addWebHCatFields(){
  Group whcGroup=Form.createGroup(this,4,Messages.getString("String_Node_Str"),110);
  whcGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  whcHostnameText=new LabelledText(whcGroup,Messages.getString("String_Node_Str"),1);
  whcPortText=new LabelledText(whcGroup,Messages.getString("String_Node_Str"),1);
  whcUsernameText=new LabelledText(whcGroup,Messages.getString("String_Node_Str"),1);
  whcJobResultFolderText=new LabelledText(whcGroup,Messages.getString("String_Node_Str"),1);
}

Fixed version (ground truth):
private void addWebHCatFields(){
  Group whcGroup=Form.createGroup(this,4,Messages.getString("String_Node_Str"),110);
  whcGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  whcHostnameText=new LabelledText(whcGroup,Messages.getString("String_Node_Str"),1);
  whcPortText=new LabelledText(whcGroup,Messages.getString("String_Node_Str"),1);
  whcUsernameText=new LabelledText(whcGroup,Messages.getString("String_Node_Str"),1);
}
Program: 124600
Project: 124600
Buggy source:
@Test public void test_doSupportService_non_DistributionVersion(){
  Assert.assertFalse(DistributionHelper.doSupportService(new IHDistributionVersion(){
    @Override public IHDistribution getDistribution(){
      return null;
    }
    @Override public String getVersion(){
      return null;
    }
    @Override public String getDisplayVersion(){
      return null;
    }
    @Override public String getDefaultConfig(    String... keys){
      return null;
    }
    @Override public List<ModuleNeeded> getModulesNeeded(){
      return null;
    }
  }
,null));
}

Fixed version (ground truth):
@Test public void test_doSupportService_non_DistributionVersion(){
  Assert.assertFalse(DistributionHelper.doSupportService(new IHDistributionVersion(){
    @Override public IHDistribution getDistribution(){
      return null;
    }
    @Override public String getVersion(){
      return null;
    }
    @Override public String getDisplayVersion(){
      return null;
    }
    @Override public String getDefaultConfig(    String... keys){
      return null;
    }
    @Override public List<ModuleNeeded> getModulesNeeded(){
      return null;
    }
    @Override public boolean doSupportOozie(){
      return true;
    }
  }
,null));
}
Program: 124602
Project: 124602
Buggy source:
private void initCommonProperties(HadoopServiceProperties properties){
  properties.setItem(this.connectionItem);
  HadoopClusterConnection connection=getConnection();
  ContextType contextType=null;
  if (getConnection().isContextMode()) {
    contextType=ConnectionContextHelper.getContextTypeForContextMode(connection,connection.getContextName(),false);
  }
  properties.setContextType(contextType);
  properties.setRelativeHadoopClusterId(connectionItem.getProperty().getId());
  properties.setRelativeHadoopClusterLabel(connectionItem.getProperty().getLabel());
  properties.setDistribution(connection.getDistribution());
  properties.setVersion(connection.getDfVersion());
  properties.setUseKrb(connection.isEnableKerberos());
}

Fixed version (ground truth):
private void initCommonProperties(HadoopServiceProperties properties){
  HadoopClusterConnection connection=getConnection();
  ContextType contextType=null;
  if (getConnection().isContextMode()) {
    contextType=ConnectionContextHelper.getContextTypeForContextMode(connection,connection.getContextName(),false);
  }
  properties.setContextType(contextType);
  properties.setRelativeHadoopClusterId(connectionItem.getProperty().getId());
  properties.setRelativeHadoopClusterLabel(connectionItem.getProperty().getLabel());
  properties.setDistribution(connection.getDistribution());
  properties.setVersion(connection.getDfVersion());
  properties.setUseKrb(connection.isEnableKerberos());
}
Program: 124603
Project: 124603
Buggy source:
public List<ModuleNeeded> getModulesNeeded(){
  if (modulesNeeded.isEmpty()) {
synchronized (DistributionVersion.class) {
      if (modulesNeeded.isEmpty()) {
        for (        DistributionVersionModule vm : modules) {
          modulesNeeded.addAll(vm.getModulesNeeded());
        }
      }
    }
  }
  return modulesNeeded;
}

Fixed version (ground truth):
@Override public List<ModuleNeeded> getModulesNeeded(){
  if (modulesNeeded.isEmpty()) {
synchronized (DistributionVersion.class) {
      if (modulesNeeded.isEmpty()) {
        for (        DistributionVersionModule vm : modules) {
          modulesNeeded.addAll(vm.getModulesNeeded());
        }
      }
    }
  }
  return modulesNeeded;
}
Program: 124604
Project: 124604
Buggy source:
public String getDefaultConfig(String... keys){
  return hadoopComponent != null ? hadoopComponent.getDefaultConfig(keys) : null;
}

Fixed version (ground truth):
@Override public String getDefaultConfig(String... keys){
  return hadoopComponent != null ? hadoopComponent.getDefaultConfig(keys) : null;
}
Program: 124605
Project: 124605
Buggy source:
private List<String> getDistributionVersions(IHDistribution distribution){
  return Arrays.asList(distribution.getVersionsDisplay());
}

Fixed version (ground truth):
private List<String> getDistributionVersions(IHDistribution distribution){
  return new ArrayList<String>(Arrays.asList(distribution.getVersionsDisplay()));
}
Program: 124606
Project: 124606
Buggy source:
private void updateVersionPart(IHDistribution distribution){
  if (distribution == null) {
    return;
  }
  GridData distriData=(GridData)hadoopDistributionCombo.getCombo().getLayoutData();
  if (distribution.useCustom()) {
    hadoopVersionCombo.setHideWidgets(true);
    distriData.horizontalSpan=1;
    hideControl(customButton,false);
    hideControl(useYarnButton,false);
    hideControl(customGroup,false);
  }
 else {
    hadoopVersionCombo.setHideWidgets(false);
    distriData.horizontalSpan=2;
    hideControl(customButton,true);
    hideControl(useYarnButton,true);
    hideControl(customGroup,true);
    List<String> items=getDistributionVersions(distribution);
    if (distribution.getName().equals("String_Node_Str")) {
      items.remove("String_Node_Str");
    }
    String[] versions=new String[items.size()];
    items.toArray(versions);
    hadoopVersionCombo.getCombo().setItems(versions);
    if (versions.length > 0) {
      hadoopVersionCombo.getCombo().select(0);
    }
  }
}

Fixed version (ground truth):
private void updateVersionPart(IHDistribution distribution){
  if (distribution == null) {
    return;
  }
  GridData distriData=(GridData)hadoopDistributionCombo.getCombo().getLayoutData();
  if (distribution.useCustom()) {
    hadoopVersionCombo.setHideWidgets(true);
    distriData.horizontalSpan=1;
    hideControl(customButton,false);
    hideControl(useYarnButton,false);
    hideControl(customGroup,false);
  }
 else {
    hadoopVersionCombo.setHideWidgets(false);
    distriData.horizontalSpan=2;
    hideControl(customButton,true);
    hideControl(useYarnButton,true);
    hideControl(customGroup,true);
    List<String> items=getDistributionVersions(distribution);
    Iterator<String> iter=items.iterator();
    while (iter.hasNext()) {
      String version=iter.next();
      IHDistributionVersion distributionVersion=distribution.getHDVersion(version,true);
      if (!distributionVersion.doSupportOozie()) {
        iter.remove();
      }
    }
    String[] versions=new String[items.size()];
    items.toArray(versions);
    hadoopVersionCombo.getCombo().setItems(versions);
    if (versions.length > 0) {
      hadoopVersionCombo.getCombo().select(0);
    }
  }
}
Program: 124607
Project: 124607
Buggy source:
@Override protected boolean hideAction(RepositoryNode node){
  HadoopClusterConnectionItem hcConnectionItem=HCRepositoryUtil.getHCConnectionItemFromRepositoryNode(node);
  if (hcConnectionItem != null) {
    HadoopClusterConnection hcConnection=(HadoopClusterConnection)hcConnectionItem.getConnection();
    EHadoopDistributions distribution=EHadoopDistributions.getDistributionByName(hcConnection.getDistribution(),false);
    EHadoopVersion4Drivers version4Drivers=EHadoopVersion4Drivers.indexOfByVersion(hcConnection.getDfVersion());
    if (EHadoopVersion4Drivers.APACHE_1_0_3_EMR.equals(version4Drivers) || EHadoopVersion4Drivers.APACHE_2_4_0_EMR.equals(version4Drivers) || EHadoopVersion4Drivers.EMR_4_0_0.equals(version4Drivers)|| EHadoopVersion4Drivers.APACHE_1_0_0.equals(version4Drivers)|| EHadoopVersion4Drivers.PIVOTAL_HD_1_0_1.equals(version4Drivers)) {
      return true;
    }
    if (distribution == EHadoopDistributions.MICROSOFT_HD_INSIGHT || distribution == EHadoopDistributions.GOOGLE_CLOUD_DATAPROC) {
      return true;
    }
    DistributionBean distributionBean=HadoopDistributionsHelper.HADOOP.getDistribution(hcConnection.getDistribution(),false);
    if (distributionBean != null) {
      DistributionVersion distributionVersion=distributionBean.getVersion(hcConnection.getDfVersion(),false);
      boolean isSupportOozie=distributionVersion.hadoopComponent.doSupportOozie();
      return !isSupportOozie;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean hideAction(RepositoryNode node){
  HadoopClusterConnectionItem hcConnectionItem=HCRepositoryUtil.getHCConnectionItemFromRepositoryNode(node);
  if (hcConnectionItem != null) {
    HadoopClusterConnection hcConnection=(HadoopClusterConnection)hcConnectionItem.getConnection();
    DistributionBean distributionBean=HadoopDistributionsHelper.HADOOP.getDistribution(hcConnection.getDistribution(),false);
    if (distributionBean != null) {
      DistributionVersion distributionVersion=distributionBean.getVersion(hcConnection.getDfVersion(),false);
      boolean isSupportOozie=distributionVersion.hadoopComponent.doSupportOozie();
      return !isSupportOozie;
    }
  }
  return false;
}
Program: 124610
Project: 124610
Buggy source:
@Test public void testGetHadoopDistributionsDisplay_withCustom__Sorted(){
  String[] hadoopDistributionsDisplay=HadoopDistributionsHelper.HADOOP.getDistributionsDisplay(true);
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},hadoopDistributionsDisplay);
}

Fixed version (ground truth):
@Test public void testGetHadoopDistributionsDisplay_withCustom__Sorted(){
  String[] hadoopDistributionsDisplay=HadoopDistributionsHelper.HADOOP.getDistributionsDisplay(true);
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},hadoopDistributionsDisplay);
}
Program: 124611
Project: 124611
Buggy source:
@Test public void testGetHadoopDistributionsDisplay_Sorted(){
  String[] hadoopDistributionsDisplay=HadoopDistributionsHelper.HADOOP.getDistributionsDisplay(false);
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},hadoopDistributionsDisplay);
}

Fixed version (ground truth):
@Test public void testGetHadoopDistributionsDisplay_Sorted(){
  String[] hadoopDistributionsDisplay=HadoopDistributionsHelper.HADOOP.getDistributionsDisplay(false);
  Assert.assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},hadoopDistributionsDisplay);
}
Program: 124613
Project: 124613
Buggy source:
public CheckHadoopServicesDialog(Shell parentShell,Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties){
  super(parentShell);
  setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MIN| SWT.APPLICATION_MODAL);
  this.serviceTypeToProperties=serviceTypeToProperties;
}

Fixed version (ground truth):
public CheckHadoopServicesDialog(Shell parentShell,Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties){
  super(parentShell);
  setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MIN| SWT.APPLICATION_MODAL| SWT.MAX);
  this.serviceTypeToProperties=serviceTypeToProperties;
}
Program: 124615
Project: 124615
Buggy source:
public CheckHadoopServicesDialog(Shell parentShell,Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties){
  super(parentShell);
  setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MIN| SWT.APPLICATION_MODAL);
  this.serviceTypeToProperties=serviceTypeToProperties;
}

Fixed version (ground truth):
public CheckHadoopServicesDialog(Shell parentShell,Map<EHadoopServiceType,HadoopServiceProperties> serviceTypeToProperties){
  super(parentShell);
  setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MIN| SWT.APPLICATION_MODAL| SWT.MAX);
  this.serviceTypeToProperties=serviceTypeToProperties;
}
Program: 124616
Project: 124616
Buggy source:
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public String getName(){
  if (eContainer() != null && eContainer() instanceof PigMapData) {
    return "String_Node_Str" + ((PigMapData)eContainer()).getConnections().indexOf(this);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated NOT
 */
public String getName(){
  if (eContainer() != null && eContainer() instanceof PigMapData) {
    PigMapData mapData=(PigMapData)eContainer();
    String nodeName="String_Node_Str";
    if (mapData.eContainer() instanceof NodeType) {
      NodeType nodeType=(NodeType)mapData.eContainer();
      for (      Object objectParam : nodeType.getElementParameter()) {
        if (objectParam instanceof ElementParameterType) {
          ElementParameterType elemParam=(ElementParameterType)objectParam;
          if (elemParam.getValue() != null) {
            if ("String_Node_Str".equals(elemParam.getName()) || elemParam.getName() == null) {
              nodeName=elemParam.getValue() + "String_Node_Str";
              break;
            }
          }
        }
      }
    }
    return nodeName + "String_Node_Str" + mapData.getConnections().indexOf(this);
  }
  return null;
}
Program: 124619
Project: 124619
Buggy source:
/** 
 * DOC PLV Comment method "setUp".
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  replicaSet=new ArrayList<HashMap<String,Object>>();
  HashMap<String,Object> mapObject=new HashMap<String,Object>();
  mapObject.put(KEY,VALUE);
  replicaSet.add(mapObject);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  contextReplicaSet="String_Node_Str";
  builtInReplicaSet="String_Node_Str";
}
Program: 124620
Project: 124620
Buggy source:
/** 
 * Test method for  {@link org.talend.repository.nosql.db.util.mongodb.MongoDBConnectionUtil#getReplicaSetList(java.lang.String,boolean)}.
 */
@Test public void testGetReplicaSetList(){
  try {
    boolean includeQuotes=false;
    JSONArray jsonArr=new JSONArray();
    for (    HashMap<String,Object> map : replicaSet) {
      JSONObject object=new JSONObject();
      Iterator it=map.keySet().iterator();
      while (it.hasNext()) {
        String key=(String)it.next();
        object.put(key,map.get(key));
      }
      jsonArr.put(object);
    }
    String replicaSetJsonStr=jsonArr.toString();
    List<HashMap<String,Object>> replicaSetList=MongoDBConnectionUtil.getReplicaSetList(replicaSetJsonStr,includeQuotes);
    Assert.assertNotNull(replicaSetList);
    Assert.assertSame(replicaSetList.size(),1);
    HashMap<String,Object> mapObject=replicaSetList.get(0);
    Assert.assertEquals(mapObject.get(KEY),VALUE);
    includeQuotes=true;
    replicaSetList=MongoDBConnectionUtil.getReplicaSetList(replicaSetJsonStr,includeQuotes);
    mapObject=replicaSetList.get(0);
    Assert.assertEquals(mapObject.get(KEY),QUOTATION_MARK + VALUE + QUOTATION_MARK);
  }
 catch (  JSONException e) {
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testGetReplicaSetList() throws Exception {
  boolean isContextMode=true;
  List<HashMap<String,Object>> replicaSetList=MongoDBConnectionUtil.getReplicaSetList(contextReplicaSet,!isContextMode);
  validateResult(replicaSetList,isContextMode);
  isContextMode=false;
  replicaSetList=MongoDBConnectionUtil.getReplicaSetList(builtInReplicaSet,!isContextMode);
  validateResult(replicaSetList,isContextMode);
}
Program: 124621
Project: 124621
Buggy source:
@Test public void testCreateContextParameters() throws Exception {
  List<IContextParameter> varList=handler.createContextParameters("String_Node_Str",noSqlConnection,paramSet);
  int i=0;
  for (  IContextParameter contextParameter : varList) {
    if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      i++;
    }
 else     if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      i++;
    }
  }
  assertTrue(i == 2);
}

Fixed version (ground truth):
@Test public void testCreateContextParameters() throws Exception {
  List<IContextParameter> varList=handler.createContextParameters("String_Node_Str",noSqlConnection,paramSet);
  int i=0;
  for (  IContextParameter contextParameter : varList) {
    if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      assertEquals(contextParameter.getType(),JavaTypesManager.STRING.getId());
      i++;
    }
 else     if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      assertEquals(contextParameter.getType(),JavaTypesManager.INTEGER.getId());
      i++;
    }
  }
  assertTrue(i == 2);
}
Program: 124624
Project: 124624
Buggy source:
/** 
 * DOC PLV Comment method "setUp".
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  replicaSet=new ArrayList<HashMap<String,Object>>();
  HashMap<String,Object> mapObject=new HashMap<String,Object>();
  mapObject.put(KEY,VALUE);
  replicaSet.add(mapObject);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  contextReplicaSet="String_Node_Str";
  builtInReplicaSet="String_Node_Str";
}
Program: 124625
Project: 124625
Buggy source:
/** 
 * Test method for  {@link org.talend.repository.nosql.db.util.mongodb.MongoDBConnectionUtil#getReplicaSetList(java.lang.String,boolean)}.
 */
@Test public void testGetReplicaSetList(){
  try {
    boolean includeQuotes=false;
    JSONArray jsonArr=new JSONArray();
    for (    HashMap<String,Object> map : replicaSet) {
      JSONObject object=new JSONObject();
      Iterator it=map.keySet().iterator();
      while (it.hasNext()) {
        String key=(String)it.next();
        object.put(key,map.get(key));
      }
      jsonArr.put(object);
    }
    String replicaSetJsonStr=jsonArr.toString();
    List<HashMap<String,Object>> replicaSetList=MongoDBConnectionUtil.getReplicaSetList(replicaSetJsonStr,includeQuotes);
    Assert.assertNotNull(replicaSetList);
    Assert.assertSame(replicaSetList.size(),1);
    HashMap<String,Object> mapObject=replicaSetList.get(0);
    Assert.assertEquals(mapObject.get(KEY),VALUE);
    includeQuotes=true;
    replicaSetList=MongoDBConnectionUtil.getReplicaSetList(replicaSetJsonStr,includeQuotes);
    mapObject=replicaSetList.get(0);
    Assert.assertEquals(mapObject.get(KEY),QUOTATION_MARK + VALUE + QUOTATION_MARK);
  }
 catch (  JSONException e) {
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testGetReplicaSetList() throws Exception {
  boolean isContextMode=true;
  List<HashMap<String,Object>> replicaSetList=MongoDBConnectionUtil.getReplicaSetList(contextReplicaSet,!isContextMode);
  validateResult(replicaSetList,isContextMode);
  isContextMode=false;
  replicaSetList=MongoDBConnectionUtil.getReplicaSetList(builtInReplicaSet,!isContextMode);
  validateResult(replicaSetList,isContextMode);
}
Program: 124626
Project: 124626
Buggy source:
@Test public void testCreateContextParameters() throws Exception {
  List<IContextParameter> varList=handler.createContextParameters("String_Node_Str",noSqlConnection,paramSet);
  int i=0;
  for (  IContextParameter contextParameter : varList) {
    if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      i++;
    }
 else     if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      i++;
    }
  }
  assertTrue(i == 2);
}

Fixed version (ground truth):
@Test public void testCreateContextParameters() throws Exception {
  List<IContextParameter> varList=handler.createContextParameters("String_Node_Str",noSqlConnection,paramSet);
  int i=0;
  for (  IContextParameter contextParameter : varList) {
    if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      assertEquals(contextParameter.getType(),JavaTypesManager.STRING.getId());
      i++;
    }
 else     if (contextParameter.getValue().equals("String_Node_Str")) {
      assertEquals("String_Node_Str",contextParameter.getName());
      assertEquals(contextParameter.getType(),JavaTypesManager.INTEGER.getId());
      i++;
    }
  }
  assertTrue(i == 2);
}
Program: 124627
Project: 124627
Buggy source:
/** 
 * DOC PLV Comment method "revertPropertiesForContextMode".
 * @param connectionItem
 * @param contextType
 * @param attributes
 */
public void revertPropertiesForContextMode(ContextType contextType){
  EMap<String,String> connAttributes=connection.getAttributes();
  if (connAttributes == null) {
    return;
  }
  for (  String attributeName : attributes) {
    String originalValue=ContextParameterUtils.getOriginalValue(contextType,connAttributes.get(attributeName));
    connAttributes.put(attributeName,originalValue);
  }
  connection.setContextMode(false);
  connection.setContextId(ConnectionContextHelper.EMPTY);
}

Fixed version (ground truth):
/** 
 * DOC PLV Comment method "revertPropertiesForContextMode".
 * @param connectionItem
 * @param contextType
 * @param attributes
 */
public void revertPropertiesForContextMode(ContextType contextType){
  EMap<String,String> connAttributes=connection.getAttributes();
  if (connAttributes == null) {
    return;
  }
  for (  String attributeName : attributes) {
    if (attributeName.equals(IMongoDBAttributes.REPLICA_SET)) {
      String replicaSets=connAttributes.get(IMongoDBAttributes.REPLICA_SET);
      try {
        JSONArray jsa=new JSONArray(replicaSets);
        for (int i=0; i < jsa.length(); i++) {
          JSONObject jso=jsa.getJSONObject(i);
          String hostValue=jso.getString(IMongoConstants.REPLICA_HOST_KEY);
          String portValue=jso.getString(IMongoConstants.REPLICA_PORT_KEY);
          String originalHostValue=ContextParameterUtils.getOriginalValue(contextType,hostValue);
          String originalPortValue=ContextParameterUtils.getOriginalValue(contextType,portValue);
          jso.put(IMongoConstants.REPLICA_HOST_KEY,originalHostValue);
          jso.put(IMongoConstants.REPLICA_PORT_KEY,originalPortValue);
        }
        connAttributes.put(IMongoDBAttributes.REPLICA_SET,jsa.toString());
      }
 catch (      JSONException e) {
        ExceptionHandler.process(e);
      }
    }
 else {
      String originalValue=ContextParameterUtils.getOriginalValue(contextType,connAttributes.get(attributeName));
      connAttributes.put(attributeName,originalValue);
    }
  }
  connection.setContextMode(false);
  connection.setContextId(ConnectionContextHelper.EMPTY);
}
Program: 124628
Project: 124628
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  updateReplicaField();
  checkFieldsValue();
  getConnection().getAttributes().put(IMongoDBAttributes.USE_REPLICA_SET,String.valueOf(checkUseReplicaBtn.getSelection()));
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  updateAttributes();
  updateReplicaField();
  checkFieldsValue();
  getConnection().getAttributes().put(IMongoDBAttributes.USE_REPLICA_SET,String.valueOf(checkUseReplicaBtn.getSelection()));
}
Program: 124629
Project: 124629
Buggy source:
@Override protected void updateAttributes(){
  super.updateAttributes();
  attributes.add(INoSQLCommonAttributes.HOST);
  attributes.add(INoSQLCommonAttributes.PORT);
  attributes.add(INoSQLCommonAttributes.DATABASE);
  if (checkRequireAuthBtn.getSelection()) {
    attributes.add(INoSQLCommonAttributes.USERNAME);
    attributes.add(INoSQLCommonAttributes.PASSWORD);
  }
}

Fixed version (ground truth):
@Override protected void updateAttributes(){
  super.updateAttributes();
  attributes.add(INoSQLCommonAttributes.DATABASE);
  if (checkUseReplicaBtn.getSelection()) {
    attributes.add(IMongoDBAttributes.REPLICA_SET);
  }
 else {
    attributes.add(INoSQLCommonAttributes.HOST);
    attributes.add(INoSQLCommonAttributes.PORT);
  }
  if (checkRequireAuthBtn.getSelection()) {
    attributes.add(INoSQLCommonAttributes.USERNAME);
    attributes.add(INoSQLCommonAttributes.PASSWORD);
  }
}
Program: 124630
Project: 124630
Buggy source:
private void updateReplicaField(){
  boolean hide=checkUseReplicaBtn.getSelection();
  setHideWidgets(connComposite,hide);
  serverText.setHideWidgets(hide);
  portText.setHideWidgets(hide);
  setHideWidgets(replicaComposite,!hide);
  connectionGroup.getParent().layout();
}

Fixed version (ground truth):
private void updateReplicaField(){
  boolean hide=checkUseReplicaBtn.getSelection();
  setHideWidgets(connComposite,hide);
  serverText.setHideWidgets(hide);
  portText.setHideWidgets(hide);
  setHideWidgets(replicaComposite,!hide);
  replicaTableView.setReadOnly(isContextMode());
  connectionGroup.getParent().layout();
}
Program: 124632
Project: 124632
Buggy source:
@Override protected void collectConParameters(){
  collectReplicaParameters(!checkUseReplicaBtn.getSelection());
  collectAuthParams(checkRequireAuthBtn.getSelection());
}

Fixed version (ground truth):
@Override protected void collectConParameters(){
  collectReplicaParameters(checkUseReplicaBtn.getSelection());
  collectAuthParams(checkRequireAuthBtn.getSelection());
}
Program: 124633
Project: 124633
Buggy source:
private void collectReplicaParameters(boolean isNeed){
  addContextParams(EHadoopParamName.Server,isNeed);
  addContextParams(EHadoopParamName.Port,isNeed);
  addContextParams(EHadoopParamName.Database,true);
}

Fixed version (ground truth):
private void collectReplicaParameters(boolean isReplica){
  clearContextParams();
  addContextParams(EHadoopParamName.Database,true);
  if (isReplica) {
    addContextParams(EHadoopParamName.ReplicaSets,true);
  }
 else {
    addContextParams(EHadoopParamName.Server,true);
    addContextParams(EHadoopParamName.Port,true);
  }
}
Program: 124634
Project: 124634
Buggy source:
private void initReplicaField(){
  String replica=getConnection().getAttributes().get(IMongoDBAttributes.REPLICA_SET);
  try {
    if (StringUtils.isNotEmpty(replica)) {
      JSONArray jsonArr=new JSONArray(replica);
      for (int i=0; i < jsonArr.length(); i++) {
        HashMap<String,Object> map=new HashMap<String,Object>();
        JSONObject object=jsonArr.getJSONObject(i);
        Iterator<Object> it=object.keys();
        while (it.hasNext()) {
          String key=(String)it.next();
          map.put(key,object.get(key));
        }
        replicaList.add(map);
      }
    }
  }
 catch (  JSONException e) {
  }
}

Fixed version (ground truth):
private void initReplicaField(){
  replicaList.clear();
  String replica=getConnection().getAttributes().get(IMongoDBAttributes.REPLICA_SET);
  try {
    if (StringUtils.isNotEmpty(replica)) {
      JSONArray jsonArr=new JSONArray(replica);
      for (int i=0; i < jsonArr.length(); i++) {
        HashMap<String,Object> map=new HashMap<String,Object>();
        JSONObject object=jsonArr.getJSONObject(i);
        Iterator<Object> it=object.keys();
        while (it.hasNext()) {
          String key=(String)it.next();
          map.put(key,object.get(key));
        }
        replicaList.add(map);
      }
    }
  }
 catch (  JSONException e) {
  }
}
Program: 124635
Project: 124635
Buggy source:
@Override protected void initializeFields(){
  NoSQLConnection conn=getConnection();
  String dbVersion=conn.getAttributes().get(INoSQLCommonAttributes.DB_VERSION);
  String server=conn.getAttributes().get(INoSQLCommonAttributes.HOST);
  String port=conn.getAttributes().get(INoSQLCommonAttributes.PORT);
  String database=conn.getAttributes().get(INoSQLCommonAttributes.DATABASE);
  String user=conn.getAttributes().get(INoSQLCommonAttributes.USERNAME);
  String passwd=conn.getValue(conn.getAttributes().get(INoSQLCommonAttributes.PASSWORD),false);
  boolean isUseRequireAuth=Boolean.parseBoolean(conn.getAttributes().get(INoSQLCommonAttributes.REQUIRED_AUTHENTICATION));
  boolean isUseReplicaSet=Boolean.parseBoolean(conn.getAttributes().get(IMongoDBAttributes.USE_REPLICA_SET));
  if (validText(dbVersion)) {
    dbVersionCombo.setText(repositoryTranslator.getLabel(dbVersion));
  }
 else {
    dbVersionCombo.select(0);
  }
  serverText.setText(server == null ? IMongoConstants.DEFAULT_HOST : server);
  portText.setText(port == null ? IMongoConstants.DEFAULT_PORT : port);
  databaseText.setText(database == null ? "String_Node_Str" : database);
  checkRequireAuthBtn.setSelection(isUseRequireAuth);
  checkUseReplicaBtn.setSelection(isUseReplicaSet);
  if (checkRequireAuthBtn.getSelection()) {
    userText.setText(user == null ? "String_Node_Str" : user);
    pwdText.setText(passwd == null ? "String_Node_Str" : passwd);
  }
  updateReplicaField();
  updateAuthGroup();
}

Fixed version (ground truth):
@Override protected void initializeFields(){
  NoSQLConnection conn=getConnection();
  String dbVersion=conn.getAttributes().get(INoSQLCommonAttributes.DB_VERSION);
  String server=conn.getAttributes().get(INoSQLCommonAttributes.HOST);
  String port=conn.getAttributes().get(INoSQLCommonAttributes.PORT);
  String database=conn.getAttributes().get(INoSQLCommonAttributes.DATABASE);
  String user=conn.getAttributes().get(INoSQLCommonAttributes.USERNAME);
  String passwd=conn.getValue(conn.getAttributes().get(INoSQLCommonAttributes.PASSWORD),false);
  boolean isUseRequireAuth=Boolean.parseBoolean(conn.getAttributes().get(INoSQLCommonAttributes.REQUIRED_AUTHENTICATION));
  boolean isUseReplicaSet=Boolean.parseBoolean(conn.getAttributes().get(IMongoDBAttributes.USE_REPLICA_SET));
  if (validText(dbVersion)) {
    dbVersionCombo.setText(repositoryTranslator.getLabel(dbVersion));
  }
 else {
    dbVersionCombo.select(0);
  }
  serverText.setText(server == null ? IMongoConstants.DEFAULT_HOST : server);
  portText.setText(port == null ? IMongoConstants.DEFAULT_PORT : port);
  databaseText.setText(database == null ? "String_Node_Str" : database);
  checkRequireAuthBtn.setSelection(isUseRequireAuth);
  checkUseReplicaBtn.setSelection(isUseReplicaSet);
  if (checkRequireAuthBtn.getSelection()) {
    userText.setText(user == null ? "String_Node_Str" : user);
    pwdText.setText(passwd == null ? "String_Node_Str" : passwd);
  }
  initReplicaField();
  if (replicaTableView != null) {
    replicaTableView.getModel().registerDataList(replicaList);
  }
  updateReplicaField();
  updateAuthGroup();
}
Program: 124636
Project: 124636
Buggy source:
@Override protected void collectNoSqlAttributesForContext(){
  getConnection().getAttributes().put(INoSQLCommonAttributes.DATABASE,databaseText.getText());
  if (!checkUseReplicaBtn.getSelection()) {
    getConnection().getAttributes().put(INoSQLCommonAttributes.HOST,serverText.getText());
    getConnection().getAttributes().put(INoSQLCommonAttributes.PORT,portText.getText());
  }
  if (checkRequireAuthBtn.getSelection()) {
    getConnection().getAttributes().put(INoSQLCommonAttributes.USERNAME,userText.getText());
    getConnection().getAttributes().put(INoSQLCommonAttributes.PASSWORD,pwdText.getText());
  }
}

Fixed version (ground truth):
@Override protected void collectNoSqlAttributesForContext(){
  getConnection().getAttributes().put(INoSQLCommonAttributes.DATABASE,databaseText.getText());
  if (!checkUseReplicaBtn.getSelection()) {
    getConnection().getAttributes().put(INoSQLCommonAttributes.HOST,serverText.getText());
    getConnection().getAttributes().put(INoSQLCommonAttributes.PORT,portText.getText());
  }
 else {
    List<HashMap<String,Object>> currentReplicaList=replicaTableView.getModel().getBeansList();
    JSONArray jsa=new JSONArray(currentReplicaList);
    getConnection().getAttributes().put(IMongoDBAttributes.REPLICA_SET,jsa.toString());
  }
  if (checkRequireAuthBtn.getSelection()) {
    getConnection().getAttributes().put(INoSQLCommonAttributes.USERNAME,userText.getText());
    getConnection().getAttributes().put(INoSQLCommonAttributes.PASSWORD,pwdText.getText());
  }
}
Program: 124637
Project: 124637
Buggy source:
@Override public void setPropertiesForContextMode(String prefixName,Connection connection,Set<IConnParamName> paramSet){
  if (connection == null) {
    return;
  }
  if (connection instanceof NoSQLConnection) {
    NoSQLConnection noSqlConn=(NoSQLConnection)connection;
    String originalVariableName=prefixName + ConnectionContextHelper.LINE;
    String noSqlVariableName=null;
    for (    IConnParamName param : paramSet) {
      if (param instanceof EHadoopParamName) {
        EHadoopParamName noSqlParam=(EHadoopParamName)param;
        originalVariableName=prefixName + ConnectionContextHelper.LINE;
        noSqlVariableName=originalVariableName + noSqlParam;
        matchContextForAttribues(noSqlConn,noSqlParam,noSqlVariableName);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setPropertiesForContextMode(String prefixName,Connection connection,Set<IConnParamName> paramSet){
  if (connection == null) {
    return;
  }
  if (connection instanceof NoSQLConnection) {
    String noSqlVariableName=null;
    NoSQLConnection noSqlConn=(NoSQLConnection)connection;
    String originalVariableName=prefixName + ConnectionContextHelper.LINE;
    for (    IConnParamName param : paramSet) {
      if (param instanceof EHadoopParamName) {
        EHadoopParamName noSqlParam=(EHadoopParamName)param;
        originalVariableName=prefixName + ConnectionContextHelper.LINE;
        if (noSqlParam == EHadoopParamName.ReplicaSets) {
          noSqlVariableName=originalVariableName;
        }
 else {
          noSqlVariableName=originalVariableName + noSqlParam;
        }
        matchContextForAttribues(noSqlConn,noSqlParam,noSqlVariableName);
      }
    }
  }
}
Program: 124643
Project: 124643
Buggy source:
/** 
 * DOC PLV Comment method "setUp".
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  replicaSet=new ArrayList<HashMap<String,Object>>();
  HashMap<String,Object> mapObject=new HashMap<String,Object>();
  mapObject.put(KEY,VALUE);
  replicaSet.add(mapObject);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  contextReplicaSet="String_Node_Str";
  builtInReplicaSet="String_Node_Str";
}