Program: 48319
Project: 48319
Buggy source:
/** 
 * Set HBASE_REGIONSERVER_OPTS for ambari hbase regionserver
 * @param configList
 * @param group
 */
private void setHbaseAmbariRegionServerOpts(List<ApiConfiguration> configList,NodeGroupInfo group){
  String configurationType="String_Node_Str";
  Map<String,Object> conf=group.getConfiguration();
  if (conf == null) {
    conf=new HashMap<String,Object>();
    group.setConfiguration(conf);
  }
  Map<String,Object> confHbaseEnv=(Map<String,Object>)conf.get(configurationType);
  if (confHbaseEnv == null) {
    confHbaseEnv=new HashMap<String,Object>();
    conf.put(configurationType,confHbaseEnv);
  }
  if (confHbaseEnv.get("String_Node_Str") == null) {
    long hbaseHeapsizeMhz=HbaseRegionServerOptsUtil.getHeapSizeMhz((long)group.getMemorySize(),group.getRoles().size());
    confHbaseEnv.put("String_Node_Str",String.valueOf(hbaseHeapsizeMhz) + "String_Node_Str");
  }
  if (confHbaseEnv.get("String_Node_Str") == null)   confHbaseEnv.put("String_Node_Str","String_Node_Str");
  if (confHbaseEnv.get("String_Node_Str") == null) {
    String hbase_env_template=null;
    for (    ApiConfiguration tmp : configList) {
      if (tmp.getApiConfigurationInfo().getType().contains(configurationType)) {
        hbase_env_template=tmp.getApiConfigurationInfo().getPropertyValue();
        hbase_env_template=hbase_env_template.replaceAll("String_Node_Str","String_Node_Str");
        hbase_env_template=hbase_env_template + HbaseRegionServerOptsUtil.getAmbariHbaseRegionServerStringParameter();
        break;
      }
    }
    confHbaseEnv.put("String_Node_Str",hbase_env_template);
    logger.info("String_Node_Str" + confHbaseEnv.get("String_Node_Str"));
    logger.info("String_Node_Str" + confHbaseEnv.get("String_Node_Str"));
    logger.info("String_Node_Str" + confHbaseEnv.get("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * Set HBASE_REGIONSERVER_OPTS for ambari hbase regionserver
 * @param configList
 * @param group
 */
private void setHbaseAmbariRegionServerOpts(List<ApiConfiguration> configList,NodeGroupInfo group){
  String configurationType="String_Node_Str";
  Map<String,Object> conf=group.getConfiguration();
  if (conf == null) {
    conf=new HashMap<String,Object>();
    group.setConfiguration(conf);
  }
  Map<String,Object> confHbaseEnv=(Map<String,Object>)conf.get(configurationType);
  if (confHbaseEnv == null) {
    confHbaseEnv=new HashMap<String,Object>();
    conf.put(configurationType,confHbaseEnv);
  }
  if (confHbaseEnv.get("String_Node_Str") == null) {
    long hbaseHeapsizeMhz=HbaseRegionServerOptsUtil.getHeapSizeMhz(group.getMemorySize(),group.getRoles().size());
    confHbaseEnv.put("String_Node_Str",String.valueOf(hbaseHeapsizeMhz) + "String_Node_Str");
  }
  if (confHbaseEnv.get("String_Node_Str") == null)   confHbaseEnv.put("String_Node_Str","String_Node_Str");
  if (confHbaseEnv.get("String_Node_Str") == null) {
    String hbase_env_template=null;
    for (    ApiConfiguration tmp : configList) {
      if (tmp.getApiConfigurationInfo().getType().contains(configurationType)) {
        hbase_env_template=tmp.getApiConfigurationInfo().getPropertyValue();
        hbase_env_template=hbase_env_template.replaceAll("String_Node_Str","String_Node_Str");
        hbase_env_template=hbase_env_template + HbaseRegionServerOptsUtil.getAmbariHbaseRegionServerStringParameter();
        break;
      }
    }
    confHbaseEnv.put("String_Node_Str",hbase_env_template);
    logger.info("String_Node_Str" + confHbaseEnv.get("String_Node_Str"));
    logger.info("String_Node_Str" + confHbaseEnv.get("String_Node_Str"));
    logger.info("String_Node_Str" + confHbaseEnv.get("String_Node_Str"));
  }
}