Program: 63134
Project: 63134
Buggy source:
@Override protected ExecuteResult doWork(ExecutableContext context) throws ExecuteException {
  final CubeManager cubeManager=CubeManager.getInstance(context.getConfig());
  final CubeInstance cube=cubeManager.getCube(getCubeName());
  final CubeSegment segment=cube.getSegmentById(getSegmentId());
  String sourceRecordsSize=executableManager.getOutput(getCreateFlatTableStepId()).getExtra().get(ExecutableConstants.SOURCE_RECORDS_SIZE);
  Preconditions.checkState(StringUtils.isNotEmpty(sourceRecordsSize),"String_Node_Str");
  long sourceSize=Long.parseLong(sourceRecordsSize);
  String sourceRecordsCount=executableManager.getOutput(getBaseCuboidStepId()).getExtra().get(ExecutableConstants.SOURCE_RECORDS_COUNT);
  Preconditions.checkState(StringUtils.isNotEmpty(sourceRecordsCount),"String_Node_Str");
  long sourceCount=Long.parseLong(sourceRecordsCount);
  long size=0;
  boolean segmentReady=true;
  if (!StringUtils.isBlank(getConvertToHfileStepId())) {
    String cubeSizeString=executableManager.getOutput(getConvertToHfileStepId()).getExtra().get(ExecutableConstants.HDFS_BYTES_WRITTEN);
    Preconditions.checkState(StringUtils.isNotEmpty(cubeSizeString),"String_Node_Str");
    size=Long.parseLong(cubeSizeString) / 1024;
  }
 else {
    segmentReady=false;
  }
  segment.setLastBuildJobID(getCubingJobId());
  segment.setLastBuildTime(System.currentTimeMillis());
  segment.setSizeKB(size);
  segment.setSourceRecords(sourceCount);
  segment.setSourceRecordsSize(sourceSize);
  try {
    if (segmentReady) {
      cubeManager.promoteNewlyBuiltSegments(cube,segment);
    }
 else {
      cubeManager.updateCube(cube);
    }
    return new ExecuteResult(ExecuteResult.State.SUCCEED,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    return new ExecuteResult(ExecuteResult.State.ERROR,e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
@Override protected ExecuteResult doWork(ExecutableContext context) throws ExecuteException {
  final CubeManager cubeManager=CubeManager.getInstance(context.getConfig());
  final CubeInstance cube=cubeManager.getCube(getCubeName());
  final CubeSegment segment=cube.getSegmentById(getSegmentId());
  Output baseCuboidOutput=executableManager.getOutput(getBaseCuboidStepId());
  String sourceRecordsCount=baseCuboidOutput.getExtra().get(ExecutableConstants.SOURCE_RECORDS_COUNT);
  Preconditions.checkState(StringUtils.isNotEmpty(sourceRecordsCount),"String_Node_Str");
  long sourceCount=Long.parseLong(sourceRecordsCount);
  String sourceRecordsSize=baseCuboidOutput.getExtra().get(ExecutableConstants.SOURCE_RECORDS_SIZE);
  Preconditions.checkState(StringUtils.isNotEmpty(sourceRecordsSize),"String_Node_Str");
  long sourceSize=Long.parseLong(sourceRecordsSize);
  long size=0;
  boolean segmentReady=true;
  if (!StringUtils.isBlank(getConvertToHfileStepId())) {
    String cubeSizeString=executableManager.getOutput(getConvertToHfileStepId()).getExtra().get(ExecutableConstants.HDFS_BYTES_WRITTEN);
    Preconditions.checkState(StringUtils.isNotEmpty(cubeSizeString),"String_Node_Str");
    size=Long.parseLong(cubeSizeString) / 1024;
  }
 else {
    segmentReady=false;
  }
  segment.setLastBuildJobID(getCubingJobId());
  segment.setLastBuildTime(System.currentTimeMillis());
  segment.setSizeKB(size);
  segment.setSourceRecords(sourceCount);
  segment.setSourceRecordsSize(sourceSize);
  try {
    if (segmentReady) {
      cubeManager.promoteNewlyBuiltSegments(cube,segment);
    }
 else {
      cubeManager.updateCube(cube);
    }
    return new ExecuteResult(ExecuteResult.State.SUCCEED,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    return new ExecuteResult(ExecuteResult.State.ERROR,e.getLocalizedMessage());
  }
}