Program: 63299
Project: 63299
Buggy source:
private void updateCubeSegmentInfoOnSucceed(JobInstance jobInstance,JobEngineConfig engineConfig) throws CubeIntegrityException, IOException {
  if (jobInstance.getStatus().equals(JobStatusEnum.FINISHED)) {
    validate(jobInstance);
    log.info("String_Node_Str" + jobInstance.getRelatedSegment() + "String_Node_Str"+ jobInstance.getRelatedCube());
    long cubeSize=0;
    JobStep convertToHFileStep=jobInstance.findStep(JobConstants.STEP_NAME_CONVERT_CUBOID_TO_HFILE);
    if (null != convertToHFileStep) {
      String cubeSizeString=convertToHFileStep.getInfo(JobInstance.HDFS_BYTES_WRITTEN);
      if (cubeSizeString == null || cubeSizeString.equals("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      cubeSize=Long.parseLong(cubeSizeString) / 1024;
    }
 else {
      log.info("String_Node_Str" + JobConstants.STEP_NAME_CONVERT_CUBOID_TO_HFILE + "String_Node_Str");
    }
    CubeManager cubeMgr=CubeManager.getInstance(engineConfig.getConfig());
    CubeInstance cubeInstance=cubeMgr.getCube(jobInstance.getRelatedCube());
    long sourceCount=0;
    long sourceSize=0;
switch (jobInstance.getType()) {
case BUILD:
      JobStep baseCuboidStep=jobInstance.findStep(JobConstants.STEP_NAME_BUILD_BASE_CUBOID);
    if (null != baseCuboidStep) {
      String sourceRecordsCount=baseCuboidStep.getInfo(JobInstance.SOURCE_RECORDS_COUNT);
      if (sourceRecordsCount == null || sourceRecordsCount.equals("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      sourceCount=Long.parseLong(sourceRecordsCount);
    }
 else {
      log.info("String_Node_Str" + JobConstants.STEP_NAME_BUILD_BASE_CUBOID + "String_Node_Str");
    }
  JobStep createFlatTableStep=jobInstance.findStep(JobConstants.STEP_NAME_CREATE_FLAT_HIVE_TABLE);
if (null != createFlatTableStep) {
  String sourceRecordsSize=createFlatTableStep.getInfo(JobInstance.SOURCE_RECORDS_SIZE);
  if (sourceRecordsSize == null || sourceRecordsSize.equals("String_Node_Str")) {
    throw new RuntimeException("String_Node_Str");
  }
  sourceSize=Long.parseLong(sourceRecordsSize);
}
 else {
  log.info("String_Node_Str" + JobConstants.STEP_NAME_CREATE_FLAT_HIVE_TABLE + "String_Node_Str");
}
if (cubeInstance.incrementalBuildOnHll()) {
for (CubeSegment seg : cubeInstance.getMergingSegments()) {
  sourceCount+=seg.getSourceRecords();
  sourceSize+=seg.getSourceRecordsSize();
}
}
break;
case MERGE:
for (CubeSegment seg : cubeInstance.getMergingSegments()) {
sourceCount+=seg.getSourceRecords();
sourceSize+=seg.getSourceRecordsSize();
}
break;
}
cubeMgr.updateSegmentOnJobSucceed(cubeInstance,jobInstance.getType(),jobInstance.getRelatedSegment(),jobInstance.getUuid(),jobInstance.getExecEndTime(),cubeSize,sourceCount,sourceSize);
log.info("String_Node_Str" + jobInstance.getRelatedSegment() + "String_Node_Str"+ jobInstance.getRelatedCube());
}
}

Fixed version (ground truth):
private void updateCubeSegmentInfoOnSucceed(JobInstance jobInstance,JobEngineConfig engineConfig) throws CubeIntegrityException, IOException {
  if (jobInstance.getStatus().equals(JobStatusEnum.FINISHED)) {
    validate(jobInstance);
    log.info("String_Node_Str" + jobInstance.getRelatedSegment() + "String_Node_Str"+ jobInstance.getRelatedCube());
    long cubeSize=0;
    JobStep convertToHFileStep=jobInstance.findStep(JobConstants.STEP_NAME_CONVERT_CUBOID_TO_HFILE);
    if (null != convertToHFileStep) {
      String cubeSizeString=convertToHFileStep.getInfo(JobInstance.HDFS_BYTES_WRITTEN);
      if (cubeSizeString == null || cubeSizeString.equals("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      cubeSize=Long.parseLong(cubeSizeString) / 1024;
    }
 else {
      log.info("String_Node_Str" + JobConstants.STEP_NAME_CONVERT_CUBOID_TO_HFILE + "String_Node_Str");
    }
    CubeManager cubeMgr=CubeManager.getInstance(engineConfig.getConfig());
    CubeInstance cubeInstance=cubeMgr.getCube(jobInstance.getRelatedCube());
    long sourceCount=0;
    long sourceSize=0;
switch (jobInstance.getType()) {
case BUILD:
      JobStep baseCuboidStep=jobInstance.findStep(JobConstants.STEP_NAME_BUILD_BASE_CUBOID);
    if (null != baseCuboidStep) {
      String sourceRecordsCount=baseCuboidStep.getInfo(JobInstance.SOURCE_RECORDS_COUNT);
      if (sourceRecordsCount == null || sourceRecordsCount.equals("String_Node_Str")) {
        throw new RuntimeException("String_Node_Str");
      }
      sourceCount=Long.parseLong(sourceRecordsCount);
    }
 else {
      log.info("String_Node_Str" + JobConstants.STEP_NAME_BUILD_BASE_CUBOID + "String_Node_Str");
    }
  JobStep createFlatTableStep=jobInstance.findStep(JobConstants.STEP_NAME_CREATE_FLAT_HIVE_TABLE);
if (null != createFlatTableStep) {
  String sourceRecordsSize=createFlatTableStep.getInfo(JobInstance.SOURCE_RECORDS_SIZE);
  if (sourceRecordsSize == null || sourceRecordsSize.equals("String_Node_Str")) {
    throw new RuntimeException("String_Node_Str");
  }
  sourceSize=Long.parseLong(sourceRecordsSize);
}
 else {
  log.info("String_Node_Str" + JobConstants.STEP_NAME_CREATE_FLAT_HIVE_TABLE + "String_Node_Str");
}
CubeSegment segmentById=cubeInstance.getSegmentById(jobInstance.getUuid());
if (cubeInstance.needMergeImmediately(segmentById)) {
for (CubeSegment seg : cubeInstance.getMergingSegments()) {
sourceCount+=seg.getSourceRecords();
sourceSize+=seg.getSourceRecordsSize();
}
}
break;
case MERGE:
for (CubeSegment seg : cubeInstance.getMergingSegments()) {
sourceCount+=seg.getSourceRecords();
sourceSize+=seg.getSourceRecordsSize();
}
break;
}
cubeMgr.updateSegmentOnJobSucceed(cubeInstance,jobInstance.getType(),jobInstance.getRelatedSegment(),jobInstance.getUuid(),jobInstance.getExecEndTime(),cubeSize,sourceCount,sourceSize);
log.info("String_Node_Str" + jobInstance.getRelatedSegment() + "String_Node_Str"+ jobInstance.getRelatedCube());
}
}