Program: 63347
Project: 63347
Buggy source:
@Override public int run(String[] args) throws Exception {
  Options options=new Options();
  options.addOption(OPTION_CUBE_NAME);
  options.addOption(OPTION_PARTITION_FILE_PATH);
  options.addOption(OPTION_HTABLE_NAME);
  parseOptions(options,args);
  Path partitionFilePath=new Path(getOptionValue(OPTION_PARTITION_FILE_PATH));
  String cubeName=getOptionValue(OPTION_CUBE_NAME).toUpperCase();
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  CubeManager cubeMgr=CubeManager.getInstance(config);
  CubeInstance cube=cubeMgr.getCube(cubeName);
  CubeDesc cubeDesc=cube.getDescriptor();
  String tableName=getOptionValue(OPTION_HTABLE_NAME).toUpperCase();
  HTableDescriptor tableDesc=new HTableDescriptor(TableName.valueOf(tableName));
  tableDesc.setValue(HTableDescriptor.SPLIT_POLICY,ConstantSizeRegionSplitPolicy.class.getName());
  Configuration conf=HBaseConfiguration.create(getConf());
  HBaseAdmin admin=new HBaseAdmin(conf);
  try {
    if (User.isHBaseSecurityEnabled(conf)) {
      tableDesc.addCoprocessor("String_Node_Str");
    }
    for (    HBaseColumnFamilyDesc cfDesc : cubeDesc.getHBaseMapping().getColumnFamily()) {
      HColumnDescriptor cf=new HColumnDescriptor(cfDesc.getName());
      cf.setMaxVersions(1);
      if (LZOSupportnessChecker.getSupportness()) {
        log.info("String_Node_Str");
        cf.setCompressionType(Algorithm.LZO);
      }
 else {
        log.info("String_Node_Str");
      }
      cf.setDataBlockEncoding(DataBlockEncoding.FAST_DIFF);
      cf.setInMemory(true);
      cf.setBlocksize(4 * 1024 * 1024);
      tableDesc.addFamily(cf);
    }
    byte[][] splitKeys=getSplits(conf,partitionFilePath);
    if (admin.tableExists(tableName)) {
      throw new RuntimeException("String_Node_Str" + tableName + "String_Node_Str");
    }
    try {
      initHTableCoprocessor(tableDesc);
      log.info("String_Node_Str" + tableName + "String_Node_Str");
    }
 catch (    Exception ex) {
      log.error("String_Node_Str" + tableName,ex);
      log.error("String_Node_Str");
    }
    admin.createTable(tableDesc,splitKeys);
    log.info("String_Node_Str" + tableName + "String_Node_Str");
    return 0;
  }
 catch (  Exception e) {
    printUsage(options);
    e.printStackTrace(System.err);
    log.error(e.getLocalizedMessage(),e);
    return 2;
  }
 finally {
    admin.close();
  }
}

Fixed version (ground truth):
@Override public int run(String[] args) throws Exception {
  Options options=new Options();
  options.addOption(OPTION_CUBE_NAME);
  options.addOption(OPTION_PARTITION_FILE_PATH);
  options.addOption(OPTION_HTABLE_NAME);
  parseOptions(options,args);
  Path partitionFilePath=new Path(getOptionValue(OPTION_PARTITION_FILE_PATH));
  String cubeName=getOptionValue(OPTION_CUBE_NAME).toUpperCase();
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  CubeManager cubeMgr=CubeManager.getInstance(config);
  CubeInstance cube=cubeMgr.getCube(cubeName);
  CubeDesc cubeDesc=cube.getDescriptor();
  String tableName=getOptionValue(OPTION_HTABLE_NAME).toUpperCase();
  HTableDescriptor tableDesc=new HTableDescriptor(TableName.valueOf(tableName));
  tableDesc.setValue(HTableDescriptor.SPLIT_POLICY,ConstantSizeRegionSplitPolicy.class.getName());
  Configuration conf=HBaseConfiguration.create(getConf());
  HBaseAdmin admin=new HBaseAdmin(conf);
  try {
    if (User.isHBaseSecurityEnabled(conf)) {
      tableDesc.addCoprocessor("String_Node_Str");
    }
    for (    HBaseColumnFamilyDesc cfDesc : cubeDesc.getHBaseMapping().getColumnFamily()) {
      HColumnDescriptor cf=new HColumnDescriptor(cfDesc.getName());
      cf.setMaxVersions(1);
      if (LZOSupportnessChecker.getSupportness()) {
        log.info("String_Node_Str");
        cf.setCompressionType(Algorithm.LZO);
      }
 else {
        log.info("String_Node_Str");
      }
      cf.setDataBlockEncoding(DataBlockEncoding.FAST_DIFF);
      cf.setInMemory(false);
      cf.setBlocksize(4 * 1024 * 1024);
      tableDesc.addFamily(cf);
    }
    byte[][] splitKeys=getSplits(conf,partitionFilePath);
    if (admin.tableExists(tableName)) {
      throw new RuntimeException("String_Node_Str" + tableName + "String_Node_Str");
    }
    try {
      initHTableCoprocessor(tableDesc);
      log.info("String_Node_Str" + tableName + "String_Node_Str");
    }
 catch (    Exception ex) {
      log.error("String_Node_Str" + tableName,ex);
      log.error("String_Node_Str");
    }
    admin.createTable(tableDesc,splitKeys);
    log.info("String_Node_Str" + tableName + "String_Node_Str");
    return 0;
  }
 catch (  Exception e) {
    printUsage(options);
    e.printStackTrace(System.err);
    log.error(e.getLocalizedMessage(),e);
    return 2;
  }
 finally {
    admin.close();
  }
}