nus-yam/ex-repair huggingface dataset:
Program: 124644
Project: 124644
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: 124645
Project: 124645
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: 124649
Project: 124649
Buggy source:
protected void setMaprTicketPropertiesConfig(HadoopServiceProperties serviceProperties){
  boolean setMapRHomeDir=serviceProperties.isSetMaprTHomeDir();
  String mapRHomeDir=serviceProperties.getMaprTHomeDir();
  boolean setMapRHadoopLogin=serviceProperties.isSetHadoopLogin();
  String mapRHadoopLogin=serviceProperties.getMaprTHadoopLogin();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHadoopLogin ? mapRHadoopLogin : "String_Node_Str");
}

Fixed version (ground truth):
protected void setMaprTicketPropertiesConfig(HadoopServiceProperties serviceProperties){
  boolean setMapRHomeDir=serviceProperties.isSetMaprTHomeDir();
  String mapRHomeDir=serviceProperties.getMaprTHomeDir();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
}
Program: 124651
Project: 124651
Buggy source:
protected void setMaprTicketPropertiesConfig(IMetadataConnection metadataConn) throws Exception {
  boolean setMapRHomeDir=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHOMEDIR));
  String mapRHomeDir=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHOMEDIR);
  boolean setMapRHadoopLogin=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHADOOPLOGIN));
  String mapRHadoopLogin=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHADOOPLOGIN);
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHadoopLogin ? mapRHadoopLogin : "String_Node_Str");
}

Fixed version (ground truth):
protected void setMaprTicketPropertiesConfig(IMetadataConnection metadataConn) throws Exception {
  boolean setMapRHomeDir=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHOMEDIR));
  String mapRHomeDir=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHOMEDIR);
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
}
Program: 124653
Project: 124653
Buggy source:
private static void setMaprTicketPropertiesConfig(HadoopClusterConnection hcConnection){
  boolean setMapRHomeDir=hcConnection.isSetMaprTHomeDir();
  String mapRHomeDir=hcConnection.getMaprTHomeDir();
  boolean setMapRHadoopLogin=hcConnection.isSetHadoopLogin();
  String mapRHadoopLogin=hcConnection.getMaprTHadoopLogin();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHadoopLogin ? mapRHadoopLogin : "String_Node_Str");
}

Fixed version (ground truth):
private static void setMaprTicketPropertiesConfig(HadoopClusterConnection hcConnection){
  boolean setMapRHomeDir=hcConnection.isSetMaprTHomeDir();
  String mapRHomeDir=hcConnection.getMaprTHomeDir();
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
}
Program: 124655
Project: 124655
Buggy source:
protected void setMaprTicketPropertiesConfig(IMetadataConnection metadataConn) throws Exception {
  boolean setMapRHomeDir=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHOMEDIR));
  String mapRHomeDir=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHOMEDIR);
  boolean setMapRHadoopLogin=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHADOOPLOGIN));
  String mapRHadoopLogin=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHADOOPLOGIN);
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHadoopLogin ? mapRHadoopLogin : "String_Node_Str");
}

Fixed version (ground truth):
protected void setMaprTicketPropertiesConfig(IMetadataConnection metadataConn) throws Exception {
  boolean setMapRHomeDir=Boolean.valueOf((String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_SETMAPRHOMEDIR));
  String mapRHomeDir=(String)metadataConn.getParameter(ConnParameterKeys.CONN_PARA_KEY_MAPRTICKET_MAPRHOMEDIR);
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str",setMapRHomeDir ? mapRHomeDir : "String_Node_Str");
}
Program: 124658
Project: 124658
Buggy source:
private void updateHadoopProperties(Object hbaseConfiguration,IMetadataConnection metadataConnection) throws Exception {
  String hadoopProperties=(String)metadataConnection.getParameter(ConnParameterKeys.CONN_PARA_KEY_HBASE_PROPERTIES);
  List<Map<String,Object>> hadoopPropertiesList=HadoopRepositoryUtil.getHadoopPropertiesList(hadoopProperties);
  for (  Map<String,Object> hadoopPros : hadoopPropertiesList) {
    ReflectionUtils.invokeMethod(hbaseConfiguration,"String_Node_Str",new Object[]{hadoopPros.get("String_Node_Str"),ConnectionContextHelper.getParamValueOffContext(metadataConnection,String.valueOf(hadoopPros.get("String_Node_Str")))});
  }
}

Fixed version (ground truth):
private void updateHadoopProperties(Object hbaseConfiguration,IMetadataConnection metadataConnection) throws Exception {
  String setZnodeParentStr=(String)metadataConnection.getParameter(ConnParameterKeys.CONN_PARA_KEY_HBASE_SET_ZNODE_PARENT);
  String znodeParent=(String)metadataConnection.getParameter(ConnParameterKeys.CONN_PARA_KEY_HBASE_ZNODE_PARENT);
  boolean selected_Znode_Parent=Boolean.valueOf(setZnodeParentStr);
  if (selected_Znode_Parent) {
    ReflectionUtils.invokeMethod(hbaseConfiguration,"String_Node_Str",new Object[]{"String_Node_Str",ConnectionContextHelper.getParamValueOffContext(metadataConnection,znodeParent)});
  }
 else {
    String hadoopProperties=(String)metadataConnection.getParameter(ConnParameterKeys.CONN_PARA_KEY_HBASE_PROPERTIES);
    List<Map<String,Object>> hadoopPropertiesList=HadoopRepositoryUtil.getHadoopPropertiesList(hadoopProperties);
    for (    Map<String,Object> hadoopPros : hadoopPropertiesList) {
      ReflectionUtils.invokeMethod(hbaseConfiguration,"String_Node_Str",new Object[]{hadoopPros.get("String_Node_Str"),ConnectionContextHelper.getParamValueOffContext(metadataConnection,String.valueOf(hadoopPros.get("String_Node_Str")))});
    }
  }
}
Program: 124659
Project: 124659
Buggy source:
@Override protected String[] getDistributionVersionsDisplay(){
  return 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"};
}

Fixed version (ground truth):
@Override protected String[] getDistributionVersionsDisplay(){
  return 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","String_Node_Str"};
}
Program: 124660
Project: 124660
Buggy source:
@Override protected String[] getDistributionVersionsDisplay(){
  return new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
}

Fixed version (ground truth):
@Override protected String[] getDistributionVersionsDisplay(){
  return 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"};
}
Program: 124661
Project: 124661
Buggy source:
@Override protected String[] getDistributionVersionsDisplay(){
  return 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"};
}

Fixed version (ground truth):
@Override protected String[] getDistributionVersionsDisplay(){
  return 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","String_Node_Str"};
}
Program: 124662
Project: 124662
Buggy source:
/** 
 * DOC ycbai Comment method "getHCConnectionItemFromRepositoryNode". Get the HadoopClusterConnectionItem from RepositoryNode recursively.
 * @param node
 * @return
 */
public static HadoopClusterConnectionItem getHCConnectionItemFromRepositoryNode(IRepositoryNode node){
  IRepositoryViewObject viewObject=node.getObject();
  ERepositoryObjectType repositoryObjectType=viewObject != null ? viewObject.getRepositoryObjectType() : null;
  if (viewObject != null && repositoryObjectType != null && (repositoryObjectType.equals(ERepositoryObjectType.METADATA_CONNECTIONS) || repositoryObjectType.equals(HadoopClusterRepositoryNodeType.HADOOPCLUSTER))) {
    final Property property=viewObject.getProperty();
    if (property != null) {
      Item item=property.getItem();
      if (item instanceof HadoopClusterConnectionItem) {
        return (HadoopClusterConnectionItem)item;
      }
 else       if (item instanceof ConnectionItem) {
        return getRelativeHadoopClusterItem(item);
      }
    }
  }
 else   if (isHadoopFolderNode(node)) {
    return getHCConnectionItemFromRepositoryNode(node.getParent());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC ycbai Comment method "getHCConnectionItemFromRepositoryNode". Get the HadoopClusterConnectionItem from RepositoryNode recursively.
 * @param node
 * @return
 */
public static HadoopClusterConnectionItem getHCConnectionItemFromRepositoryNode(IRepositoryNode node){
  IRepositoryViewObject viewObject=node.getObject();
  ERepositoryObjectType repositoryObjectType=viewObject != null ? viewObject.getRepositoryObjectType() : null;
  if (viewObject != null && repositoryObjectType != null && (repositoryObjectType.equals(ERepositoryObjectType.METADATA_CONNECTIONS) || repositoryObjectType.equals(HadoopClusterRepositoryNodeType.HADOOPCLUSTER) || isHadoopSubType(repositoryObjectType))) {
    final Property property=viewObject.getProperty();
    if (property != null) {
      Item item=property.getItem();
      if (item instanceof HadoopClusterConnectionItem) {
        return (HadoopClusterConnectionItem)item;
      }
 else       if (item instanceof ConnectionItem) {
        return getRelativeHadoopClusterItem(item);
      }
    }
  }
 else   if (isHadoopFolderNode(node)) {
    return getHCConnectionItemFromRepositoryNode(node.getParent());
  }
  return null;
}
Program: 124663
Project: 124663
Buggy source:
public String getMaprTPassword(){
  return this.maprTPassword;
}

Fixed version (ground truth):
public String getMaprTPassword(){
  return getRealValue(this.maprTPassword);
}
Program: 124664
Project: 124664
Buggy source:
public String getMaprTDuration(){
  return this.maprTDuration;
}

Fixed version (ground truth):
public String getMaprTDuration(){
  return getRealValue(this.maprTDuration);
}
Program: 124665
Project: 124665
Buggy source:
public String getMaprTHadoopLogin(){
  return this.maprTHadoopLogin;
}

Fixed version (ground truth):
public String getMaprTHadoopLogin(){
  return getRealValue(this.maprTHadoopLogin);
}
Program: 124666
Project: 124666
Buggy source:
public String getMaprTHomeDir(){
  return this.maprTHomeDir;
}

Fixed version (ground truth):
public String getMaprTHomeDir(){
  return getRealValue(this.maprTHomeDir);
}
Program: 124667
Project: 124667
Buggy source:
public String getMaprTCluster(){
  return this.maprTCluster;
}

Fixed version (ground truth):
public String getMaprTCluster(){
  return getRealValue(this.maprTCluster);
}
Program: 124668
Project: 124668
Buggy source:
@Override public boolean isInContextMode(ConnectionItem connItem){
  if (connItem == null) {
    return false;
  }
  boolean isContextMode=false;
  Connection connection=connItem.getConnection();
  if (isHadoopClusterItem(connItem)) {
    isContextMode=connection.isContextMode();
  }
 else {
    Item hadoopClusterItem=getHadoopClusterBySubitemId(connItem.getProperty().getId());
    Connection hcConnection=null;
    if (hadoopClusterItem != null) {
      hcConnection=((ConnectionItem)hadoopClusterItem).getConnection();
    }
    isContextMode=connection.isContextMode() || (hcConnection != null && hcConnection.isContextMode());
  }
  return isContextMode;
}

Fixed version (ground truth):
@Override public boolean isInContextMode(Connection connection){
  if (connection == null) {
    return false;
  }
  boolean isContextMode=false;
  if (connection instanceof HadoopClusterConnection) {
    isContextMode=connection.isContextMode();
  }
 else {
    Connection hcConnection=getHadoopClusterConnectionBySubConnection(connection);
    isContextMode=connection.isContextMode() || (hcConnection != null && hcConnection.isContextMode());
  }
  return isContextMode;
}
Program: 124669
Project: 124669
Buggy source:
@Override protected IPath getTopLevelNodePath(RepositoryNode repoNode){
  IPath topLevelNodeWorkspaceRelativePath=null;
  if ((repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      String projectName=root.getProject().getTechnicalLabel();
      topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(root.getRootRepositoryNode(HadoopClusterRepositoryNodeType.HADOOPCLUSTER).getContentType().getFolder());
    }
  }
 else   if (repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) {
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      String projectName=root.getProject().getTechnicalLabel();
      topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
    }
  }
  return topLevelNodeWorkspaceRelativePath;
}

Fixed version (ground truth):
@Override protected IPath getTopLevelNodePath(RepositoryNode repoNode){
  IPath topLevelNodeWorkspaceRelativePath=null;
  if ((repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      String projectName=root.getProject().getTechnicalLabel();
      topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(root.getRootRepositoryNode(HadoopClusterRepositoryNodeType.HADOOPCLUSTER).getContentType().getFolder());
    }
  }
  return topLevelNodeWorkspaceRelativePath;
}
Program: 124671
Project: 124671
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  super.widgetSelected(e);
  parentWizardPage.setPageComplete(false);
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  super.widgetSelected(e);
}
Program: 124672
Project: 124672
Buggy source:
@Override protected void addUtilsButtonListeners(){
  super.addUtilsButtonListeners();
  if (schemaTree != null) {
    schemaTree.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        super.widgetSelected(e);
        parentWizardPage.setPageComplete(false);
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void addUtilsButtonListeners(){
  super.addUtilsButtonListeners();
  if (schemaTree != null) {
    schemaTree.addSelectionListener(new SelectionAdapter(){
      @Override public void widgetSelected(      SelectionEvent e){
        super.widgetSelected(e);
      }
    }
);
  }
}
Program: 124673
Project: 124673
Buggy source:
@Override protected void addFieldsListeners(){
  filterText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      schemaViewer.refresh();
    }
  }
);
  schemaTree.addListener(SWT.Expand,new Listener(){
    @Override public void handleEvent(    Event event){
      TreeItem treeItem=(TreeItem)event.item;
      for (      TreeItem item : treeItem.getItems()) {
        if (item.getData() != null) {
          INoSQLSchemaNode node=(INoSQLSchemaNode)item.getData();
          if (node != null && node.getSchemaType() == ENoSQLSchemaType.TABLE) {
            if (isExistTable(node,true)) {
              item.setChecked(true);
            }
 else {
              item.setChecked(false);
            }
          }
 else {
            item.setGrayed(item.getChecked());
          }
        }
      }
    }
  }
);
  schemaTree.addSelectionListener(new SelectionAdapter(){
    @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 protected void addFieldsListeners(){
  filterText.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      schemaViewer.refresh();
    }
  }
);
  schemaTree.addListener(SWT.Expand,new Listener(){
    @Override public void handleEvent(    Event event){
      TreeItem treeItem=(TreeItem)event.item;
      for (      TreeItem item : treeItem.getItems()) {
        if (item.getData() != null) {
          INoSQLSchemaNode node=(INoSQLSchemaNode)item.getData();
          if (node != null && node.getSchemaType() == ENoSQLSchemaType.TABLE) {
            if (isExistTable(node,true)) {
              item.setChecked(true);
            }
 else {
              item.setChecked(false);
            }
          }
 else {
            item.setGrayed(item.getChecked());
          }
        }
      }
    }
  }
);
  schemaTree.addSelectionListener(new SelectionAdapter(){
    @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);
        }
        boolean pageC=pageComplete();
        if (pageC) {
          parentWizardPage.setPageComplete(false);
        }
      }
    }
  }
);
}
Program: 124674
Project: 124674
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  updateForm();
  if (isReadOnly() != readOnly) {
    adaptFormToReadOnly();
  }
  if (visible) {
    adaptFormToEditable();
    updateStatus(getStatusLevel(),getStatus());
  }
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  updateForm();
  if (isContextMode()) {
    adaptFormToEditable();
  }
  if (isReadOnly() != readOnly) {
    adaptFormToReadOnly();
  }
  if (visible) {
    updateStatus(getStatusLevel(),getStatus());
  }
}
Program: 124678
Project: 124678
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  updateForm();
  if (isReadOnly() != readOnly) {
    adaptFormToReadOnly();
  }
  if (visible) {
    adaptFormToEditable();
    updateStatus(getStatusLevel(),getStatus());
  }
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  updateForm();
  if (isContextMode()) {
    adaptFormToEditable();
  }
  if (isReadOnly() != readOnly) {
    adaptFormToReadOnly();
  }
  if (visible) {
    updateStatus(getStatusLevel(),getStatus());
  }
}
Program: 124681
Project: 124681
Buggy source:
private void init(ConnectionItem item){
  setConnectionItem(item);
  clusterConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(getConnection());
  distribution=clusterConnection.getDistribution();
  version=clusterConnection.getDfVersion();
  enableKerberos=clusterConnection.isEnableKerberos();
  EHadoopVersion4Drivers version4Drivers=EHadoopVersion4Drivers.indexOfByVersion(version);
  if (version4Drivers != null) {
    enableGroup=version4Drivers.isSupportGroup();
  }
 else {
    enableGroup=EAuthenticationMode.UGI.getName().equals(clusterConnection.getAuthMode());
  }
  isHDI=isHDI(clusterConnection);
  setupForm(true);
}

Fixed version (ground truth):
private void init(ConnectionItem item){
  setConnectionItem(item);
  clusterConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(getConnection());
  distribution=clusterConnection.getDistribution();
  version=clusterConnection.getDfVersion();
  enableKerberos=clusterConnection.isEnableKerberos();
  if (!enableKerberos && (isCurrentHadoopVersionSupportGroup() || EAuthenticationMode.UGI.getName().equals(clusterConnection.getAuthMode()))) {
    enableGroup=true;
  }
  isHDI=isHDI(clusterConnection);
  setupForm(true);
}
Program: 124682
Project: 124682
Buggy source:
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  updateForm();
  if (isReadOnly() != readOnly) {
    adaptFormToReadOnly();
  }
  if (visible) {
    adaptFormToEditable();
    updateStatus(getStatusLevel(),getStatus());
  }
}

Fixed version (ground truth):
@Override public void setVisible(boolean visible){
  super.setVisible(visible);
  updateForm();
  if (isContextMode()) {
    adaptFormToEditable();
  }
  if (isReadOnly() != readOnly) {
    adaptFormToReadOnly();
  }
  if (visible) {
    updateStatus(getStatusLevel(),getStatus());
  }
}
Program: 124686
Project: 124686
Buggy source:
@Override public void run(IProgressMonitor monitor) throws CoreException {
  connectionItem.setConnection(temConnection);
  saveMetaData();
  RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
  closeLockStrategy();
  temConnection=null;
}

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

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

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

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

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

Fixed version (ground truth):
@Override public boolean performFinish(){
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  IWorkspaceRunnable operation=new IWorkspaceRunnable(){
    @Override public void run(    IProgressMonitor monitor) throws CoreException {
      saveMetaData();
      Display.getDefault().asyncExec(new Runnable(){
        @Override public void run(){
          RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
          closeLockStrategy();
        }
      }
);
    }
  }
;
  try {
    workspace.run(operation,null);
  }
 catch (  CoreException e) {
    ExceptionHandler.process(e);
  }
 finally {
    performClean();
  }
  return true;
}
Program: 124692
Project: 124692
Buggy source:
@Override protected IPath getTopLevelNodePath(RepositoryNode repoNode){
  if ((repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
    IPath topLevelNodeWorkspaceRelativePath=null;
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      String projectName=root.getProject().getTechnicalLabel();
      topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(root.getRootRepositoryNode(HadoopClusterRepositoryNodeType.HADOOPCLUSTER).getContentType().getFolder());
    }
    return topLevelNodeWorkspaceRelativePath;
  }
  return null;
}

Fixed version (ground truth):
@Override protected IPath getTopLevelNodePath(RepositoryNode repoNode){
  IPath topLevelNodeWorkspaceRelativePath=null;
  if ((repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      String projectName=root.getProject().getTechnicalLabel();
      topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(root.getRootRepositoryNode(HadoopClusterRepositoryNodeType.HADOOPCLUSTER).getContentType().getFolder());
    }
  }
 else   if (repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) {
    IProjectRepositoryNode root=repoNode.getRoot();
    if (root != null) {
      String projectName=root.getProject().getTechnicalLabel();
      topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
    }
  }
  return topLevelNodeWorkspaceRelativePath;
}
Program: 124696
Project: 124696
Buggy source:
private void addHadoopPropertiesFields(){
  hadoopPropertiesComposite=new Composite(this,SWT.NONE);
  GridLayout hadoopPropertiesLayout=new GridLayout(1,false);
  hadoopPropertiesLayout.marginWidth=0;
  hadoopPropertiesLayout.marginHeight=0;
  hadoopPropertiesComposite.setLayout(hadoopPropertiesLayout);
  hadoopPropertiesComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  propertiesDialog=new HadoopPropertiesDialog(getShell(),getHadoopProperties()){
    @Override protected List<Map<String,Object>> getLatestInitProperties(){
      return getHadoopProperties();
    }
    @Override public void applyProperties(    List<Map<String,Object>> properties){
      getConnection().setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(properties));
    }
  }
;
  propertiesDialog.createPropertiesFields(hadoopPropertiesComposite);
}

Fixed version (ground truth):
private void addHadoopPropertiesFields(){
  hadoopPropertiesComposite=new Composite(this,SWT.NONE);
  GridLayout hadoopPropertiesLayout=new GridLayout(1,false);
  hadoopPropertiesLayout.marginWidth=0;
  hadoopPropertiesLayout.marginHeight=0;
  hadoopPropertiesComposite.setLayout(hadoopPropertiesLayout);
  hadoopPropertiesComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  propertiesDialog=new HadoopPropertiesDialog(getShell(),getHadoopProperties()){
    @Override protected boolean isReadOnly(){
      return !isEditable();
    }
    @Override protected List<Map<String,Object>> getLatestInitProperties(){
      return getHadoopProperties();
    }
    @Override public void applyProperties(    List<Map<String,Object>> properties){
      getConnection().setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(properties));
    }
  }
;
  propertiesDialog.createPropertiesFields(hadoopPropertiesComposite);
}
Program: 124698
Project: 124698
Buggy source:
protected void addHadoopPropertiesFields(){
  T connection=getConnection();
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  String hadoopPropertiesOfCluster=StringUtils.trimToEmpty(hcConnection.getHadoopProperties());
  String hadoopProperties=connection.getHadoopProperties();
  List<Map<String,Object>> hadoopPropertiesListOfCluster=HadoopRepositoryUtil.getHadoopPropertiesList(hadoopPropertiesOfCluster);
  List<Map<String,Object>> hadoopPropertiesList=HadoopRepositoryUtil.getHadoopPropertiesList(hadoopProperties);
  propertiesDialog=new HadoopPropertiesDialog(getShell(),hadoopPropertiesListOfCluster,hadoopPropertiesList){
    @Override public void applyProperties(    List<Map<String,Object>> properties){
      getConnection().setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(properties));
    }
  }
;
  propertiesDialog.createPropertiesFields(this);
}

Fixed version (ground truth):
protected void addHadoopPropertiesFields(){
  T connection=getConnection();
  HadoopClusterConnection hcConnection=HCRepositoryUtil.getRelativeHadoopClusterConnection(connection);
  String hadoopPropertiesOfCluster=StringUtils.trimToEmpty(hcConnection.getHadoopProperties());
  List<Map<String,Object>> hadoopPropertiesListOfCluster=HadoopRepositoryUtil.getHadoopPropertiesList(hadoopPropertiesOfCluster);
  propertiesDialog=new HadoopPropertiesDialog(getShell(),hadoopPropertiesListOfCluster,getHadoopProperties()){
    @Override protected boolean isReadOnly(){
      return !isEditable();
    }
    @Override protected List<Map<String,Object>> getLatestInitProperties(){
      return getHadoopProperties();
    }
    @Override public void applyProperties(    List<Map<String,Object>> properties){
      getConnection().setHadoopProperties(HadoopRepositoryUtil.getHadoopPropertiesJsonStr(properties));
    }
  }
;
  propertiesDialog.createPropertiesFields(this);
}
Program: 124699
Project: 124699
Buggy source:
protected void updateHadoopPropertiesFields(boolean isEditable){
  refreshHadoopProperties(isEditable);
  updatePropertiesFileds(isEditable);
}

Fixed version (ground truth):
protected void updateHadoopPropertiesFields(boolean isEditable){
  propertiesDialog.updateStatusLabel(getHadoopProperties());
}
Program: 124709
Project: 124709
Buggy source:
@Override protected boolean isValidResourceDelta(IResourceDelta delta){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=null;
    if ((repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) || (repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER)) {
      IProjectRepositoryNode root=repoNode.getRoot();
      if (root != null) {
        String projectName=root.getProject().getTechnicalLabel();
        topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
      }
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean isValidResourceDelta(IResourceDelta delta){
  VisitResourceHelper visitHelper=new VisitResourceHelper(delta);
  boolean merged=ProjectRepositoryNode.getInstance().getMergeRefProject();
  Set<RepositoryNode> topLevelNodes=getTopNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=null;
    if (repoNode.getContentType() == ERepositoryObjectType.METADATA_CONNECTIONS) {
      IProjectRepositoryNode root=repoNode.getRoot();
      if (root != null) {
        String projectName=root.getProject().getTechnicalLabel();
        topLevelNodeWorkspaceRelativePath=Path.fromPortableString('/' + projectName).append(repoNode.getContentType().getFolder());
      }
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
 else     if (repoNode.getContentType() == HadoopClusterRepositoryNodeType.HADOOPCLUSTER) {
      topLevelNodeWorkspaceRelativePath=getWorkspaceTopNodePath(repoNode);
      topLevelNodeToPathMap.put(repoNode,topLevelNodeWorkspaceRelativePath);
    }
    if (topLevelNodeWorkspaceRelativePath != null && visitHelper.valid(topLevelNodeWorkspaceRelativePath,merged)) {
      return true;
    }
  }
  return false;
}
Program: 124710
Project: 124710
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);
    }
  }
 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.DB_VERSION_CASSANDRA_2_0_0.equals(dbVersion)) {
    if (ICassandraConstants.API_TYPE_DATASTAX.equals(repositoryTranslator.getLabel(apiTypeCombo.getText()))) {
      portText.setText(ICassandraConstants.DATASTAX_PORT);
    }
 else {
      portText.setText(ICassandraConstants.DEFAULT_PORT);
    }
  }
 else   if (ICassandraConstants.DB_VERSION_CASSANDRA_3_0.equals(dbVersion) || ICassandraConstants.DB_VERSION_CASSANDRA_2_2.equals(dbVersion)) {
    portText.setText(ICassandraConstants.DATASTAX_PORT);
  }
 else {
    portText.setText(ICassandraConstants.DEFAULT_PORT);
  }
}
Program: 124714
Project: 124714
Buggy source:
@Override protected void initConnectionParameters(Map<String,String> initMap,HadoopClusterConnectionItem hcConnectionItem){
  super.initConnectionParameters(initMap,hcConnectionItem);
  HadoopClusterConnection hcConnection=(HadoopClusterConnection)hcConnectionItem.getConnection();
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS,hcConnection.getParameters().get(ECustomVersionGroup.HIVE.getName()));
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE,EDatabaseConnTemplate.HIVE.getDBTypeName());
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_DB_PRODUCT,EDatabaseTypeName.HIVE.getProduct());
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_DB_PORT,EDatabaseConnTemplate.HIVE.getDefaultPort());
}

Fixed version (ground truth):
@Override protected void initConnectionParameters(Map<String,String> initMap,HadoopClusterConnectionItem hcConnectionItem){
  super.initConnectionParameters(initMap,hcConnectionItem);
  HadoopClusterConnection hcConnection=(HadoopClusterConnection)hcConnectionItem.getConnection();
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_HADOOP_CUSTOM_JARS,hcConnection.getParameters().get(ECustomVersionGroup.HIVE.getName()));
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE,EDatabaseConnTemplate.HIVE.getDBTypeName());
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_DB_PRODUCT,EDatabaseTypeName.HIVE.getProduct());
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_DB_PORT,EDatabaseConnTemplate.HIVE.getDefaultPort());
  initMap.put(ConnParameterKeys.CONN_PARA_KEY_USERNAME,ConnectionContextHelper.getParamValueOffContext(hcConnection,hcConnection.getUserName()));
}
Program: 124717
Project: 124717
Buggy source:
public DistributionBean[] getDistributions(){
  if (getServiceName() == null) {
    return new DistributionBean[0];
  }
  final ComponentType type=getComponentType();
  BundleContext bc=FrameworkUtil.getBundle(DistributionFactory.class).getBundleContext();
  Collection<ServiceReference<? extends HadoopComponent>> distributions=new LinkedList<>();
  try {
    Class<? extends HadoopComponent> clazz=(Class<? extends HadoopComponent>)Class.forName(getServiceName());
    distributions.addAll(bc.getServiceReferences(clazz,null));
  }
 catch (  InvalidSyntaxException|ClassNotFoundException e) {
    CommonExceptionHandler.process(e);
    return new DistributionBean[0];
  }
  Map<String,DistributionBean> disctributionsMap=new HashMap<String,DistributionBean>();
  for (  ServiceReference<? extends HadoopComponent> sr : distributions) {
    HadoopComponent hc=bc.getService(sr);
    final String distribution=hc.getDistribution();
    final String distributionName=hc.getDistributionName();
    DistributionBean disctributionBean=disctributionsMap.get(distribution);
    if (disctributionBean == null) {
      disctributionBean=new DistributionBean(type,distribution,distributionName);
      disctributionsMap.put(distribution,disctributionBean);
    }
 else {
      if (!distribution.equals(disctributionBean.name) || !distributionName.equals(disctributionBean.displayName)) {
        CommonExceptionHandler.warn("String_Node_Str" + disctributionBean);
        continue;
      }
    }
    final String version=hc.getVersion();
    DistributionVersion versionBean=new DistributionVersion(hc,disctributionBean,version,hc.getVersionName(type));
    versionBean.addModuleGroups(hc.getModuleGroups(type));
    versionBean.displayCondition=hc.getDisplayCondition(type);
    disctributionBean.addVersion(versionBean);
    disctributionBean.setDefaultVersion(versionBean);
    disctributionBean.addCondition(hc.getDisplayCondition(type));
  }
  List<DistributionBean> distributionsList=new ArrayList<DistributionBean>(disctributionsMap.values());
  Collections.sort(distributionsList,new Comparator<DistributionBean>(){
    @Override public int compare(    DistributionBean b1,    DistributionBean b2){
      if (Constant.DISTRIBUTION_CUSTOM.equals(b1.name)) {
        return 1;
      }
      if (Constant.DISTRIBUTION_CUSTOM.equals(b2.name)) {
        return -1;
      }
      return b1.name.compareTo(b2.name);
    }
  }
);
  return distributionsList.toArray(new DistributionBean[0]);
}

Fixed version (ground truth):
public DistributionBean[] getDistributions(){
  if (distributionBeans == null) {
synchronized (DistributionsManager.class) {
      if (distributionBeans == null) {
        distributionBeans=getDistributionsDelegate();
      }
    }
  }
  return distributionBeans;
}