Program: 63291
Project: 63291
Buggy source:
private List<JobStep> createBuildCubeSegmentSteps(JobInstance jobInstance) throws IOException {
  int groupRowkeyColumnsCount=cube.getDescriptor().getRowkey().getNCuboidBuildLevels();
  int totalRowkeyColumnsCount=cube.getDescriptor().getRowkey().getRowKeyColumns().length;
  int stepSeqNum=0;
  List<JobStep> result=Lists.newArrayList();
  if (this.engineConfig.isFlatTableByHive()) {
    result.add(createIntermediateHiveTableStep(jobInstance,stepSeqNum++));
  }
  result.add(createFactDistinctColumnsStep(jobInstance,stepSeqNum++));
  result.add(createBuildDictionaryStep(jobInstance,stepSeqNum++));
  final String cuboidRootPath=jobWorkingDir + "String_Node_Str" + cubeName+ "String_Node_Str";
  final String cuboidTmpRootPath=jobWorkingDir + "String_Node_Str" + cubeName+ "String_Node_Str";
  final boolean incBuildMerge=cube.needMergeImmediatelyAfterBuild();
  String[] cuboidOutputTempPath=getCuboidOutputPaths(incBuildMerge ? cuboidTmpRootPath : cuboidRootPath,totalRowkeyColumnsCount,groupRowkeyColumnsCount);
  result.add(createBaseCuboidStep(jobInstance,stepSeqNum++,cuboidOutputTempPath));
  for (int i=1; i <= groupRowkeyColumnsCount; i++) {
    int dimNum=totalRowkeyColumnsCount - i;
    result.add(createNDimensionCuboidStep(jobInstance,stepSeqNum++,cuboidOutputTempPath,dimNum,totalRowkeyColumnsCount));
  }
  if (incBuildMerge) {
    List<String> pathToMerge=Lists.newArrayList();
    for (    CubeSegment segment : cube.getSegments(CubeSegmentStatusEnum.READY)) {
      pathToMerge.add(getPathToMerge(jobInstance,segment));
    }
    pathToMerge.add(cuboidTmpRootPath + "String_Node_Str");
    result.add(createMergeCuboidDataStep(jobInstance,stepSeqNum++,formatPaths(pathToMerge),cuboidRootPath));
  }
  String cuboidPath=incBuildMerge ? cuboidRootPath : cuboidRootPath + "String_Node_Str";
  result.add(createRangeRowkeyDistributionStep(jobInstance,stepSeqNum++,cuboidPath));
  result.add(createCreateHTableStep(jobInstance,stepSeqNum++));
  result.add(createConvertCuboidToHfileStep(jobInstance,stepSeqNum++,cuboidPath));
  result.add(createBulkLoadStep(jobInstance,stepSeqNum++));
  try {
    log.debug(JsonUtil.writeValueAsIndentString(jobInstance));
  }
 catch (  Exception e) {
    log.error(e.getMessage());
  }
  return result;
}

Fixed version (ground truth):
private List<JobStep> createBuildCubeSegmentSteps(JobInstance jobInstance) throws IOException {
  int groupRowkeyColumnsCount=cube.getDescriptor().getRowkey().getNCuboidBuildLevels();
  int totalRowkeyColumnsCount=cube.getDescriptor().getRowkey().getRowKeyColumns().length;
  int stepSeqNum=0;
  List<JobStep> result=Lists.newArrayList();
  if (this.engineConfig.isFlatTableByHive()) {
    result.add(createIntermediateHiveTableStep(jobInstance,stepSeqNum++));
  }
  result.add(createFactDistinctColumnsStep(jobInstance,stepSeqNum++));
  result.add(createBuildDictionaryStep(jobInstance,stepSeqNum++));
  final String cuboidRootPath=jobWorkingDir + "String_Node_Str" + cubeName+ "String_Node_Str";
  final String cuboidTmpRootPath=jobWorkingDir + "String_Node_Str" + cubeName+ "String_Node_Str";
  final boolean incBuildMerge=cube.needMergeImmediatelyAfterBuild(cubeSegment);
  String[] cuboidOutputTempPath=getCuboidOutputPaths(incBuildMerge ? cuboidTmpRootPath : cuboidRootPath,totalRowkeyColumnsCount,groupRowkeyColumnsCount);
  result.add(createBaseCuboidStep(jobInstance,stepSeqNum++,cuboidOutputTempPath));
  for (int i=1; i <= groupRowkeyColumnsCount; i++) {
    int dimNum=totalRowkeyColumnsCount - i;
    result.add(createNDimensionCuboidStep(jobInstance,stepSeqNum++,cuboidOutputTempPath,dimNum,totalRowkeyColumnsCount));
  }
  if (incBuildMerge) {
    List<String> pathToMerge=Lists.newArrayList();
    for (    CubeSegment segment : cube.getSegments(CubeSegmentStatusEnum.READY)) {
      pathToMerge.add(getPathToMerge(jobInstance,segment));
    }
    pathToMerge.add(cuboidTmpRootPath + "String_Node_Str");
    result.add(createMergeCuboidDataStep(jobInstance,stepSeqNum++,formatPaths(pathToMerge),cuboidRootPath));
  }
  String cuboidPath=incBuildMerge ? cuboidRootPath : cuboidRootPath + "String_Node_Str";
  result.add(createRangeRowkeyDistributionStep(jobInstance,stepSeqNum++,cuboidPath));
  result.add(createCreateHTableStep(jobInstance,stepSeqNum++));
  result.add(createConvertCuboidToHfileStep(jobInstance,stepSeqNum++,cuboidPath));
  result.add(createBulkLoadStep(jobInstance,stepSeqNum++));
  try {
    log.debug(JsonUtil.writeValueAsIndentString(jobInstance));
  }
 catch (  Exception e) {
    log.error(e.getMessage());
  }
  return result;
}