nus-yam/ex-repair huggingface dataset:
Program: 63160
Project: 63160
Buggy source:
@RequestMapping(value="String_Node_Str",method={RequestMethod.POST}) @ResponseBody public Map<String,String[]> loadHiveTable(@PathVariable String tables,@PathVariable String project) throws IOException {
  String[] arr=cubeMgmtService.reloadHiveTable(tables);
  cubeMgmtService.syncTableToProject(tables,project);
  Map<String,String[]> result=new HashMap<String,String[]>();
  result.put("String_Node_Str",arr);
  return result;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method={RequestMethod.POST}) @ResponseBody public Map<String,String[]> loadHiveTable(@PathVariable String tables,@PathVariable String project) throws IOException {
  String[] arr=cubeMgmtService.reloadHiveTable(tables);
  cubeMgmtService.syncTableToProject(tables,project);
  Map<String,String[]> result=new HashMap<String,String[]>();
  result.put("String_Node_Str",arr);
  result.put("String_Node_Str",new String[]{});
  return result;
}
Program: 63161
Project: 63161
Buggy source:
private String getCubingJobId(){
  return CUBING_JOB_ID;
}

Fixed version (ground truth):
private String getCubingJobId(){
  return getParam(CUBING_JOB_ID);
}
Program: 63162
Project: 63162
Buggy source:
private String getCubingJobId(){
  return CUBING_JOB_ID;
}

Fixed version (ground truth):
private String getCubingJobId(){
  return getParam(CUBING_JOB_ID);
}
Program: 63164
Project: 63164
Buggy source:
protected void onExecuteError(Throwable exception,ExecutableContext executableContext){
  jobService.addJobInfo(getId(),END_TIME,Long.toString(System.currentTimeMillis()));
  jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,exception.getLocalizedMessage());
}

Fixed version (ground truth):
protected void onExecuteError(Throwable exception,ExecutableContext executableContext){
  if (!isDiscarded()) {
    jobService.addJobInfo(getId(),END_TIME,Long.toString(System.currentTimeMillis()));
    jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,exception.getLocalizedMessage());
  }
}
Program: 63165
Project: 63165
Buggy source:
protected void onExecuteFinished(ExecuteResult result,ExecutableContext executableContext){
  jobService.addJobInfo(getId(),END_TIME,Long.toString(System.currentTimeMillis()));
  if (result.succeed()) {
    jobService.updateJobOutput(getId(),ExecutableState.SUCCEED,null,result.output());
  }
 else   if (result.state() == ExecuteResult.State.STOPPED) {
    jobService.updateJobOutput(getId(),ExecutableState.STOPPED,null,result.output());
  }
 else {
    jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,result.output());
  }
}

Fixed version (ground truth):
protected void onExecuteFinished(ExecuteResult result,ExecutableContext executableContext){
  jobService.addJobInfo(getId(),END_TIME,Long.toString(System.currentTimeMillis()));
  if (!isDiscarded()) {
    if (result.succeed()) {
      jobService.updateJobOutput(getId(),ExecutableState.SUCCEED,null,result.output());
    }
 else     if (result.state() == ExecuteResult.State.DISCARDED) {
      jobService.updateJobOutput(getId(),ExecutableState.DISCARDED,null,result.output());
    }
 else {
      jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,result.output());
    }
  }
}
Program: 63166
Project: 63166
Buggy source:
@Override protected void onExecuteFinished(ExecuteResult result,ExecutableContext executableContext){
  if (result.succeed()) {
    List<? extends Executable> jobs=getTasks();
    boolean allSucceed=true;
    boolean hasError=false;
    for (    Executable task : jobs) {
      final ExecutableState status=task.getStatus();
      if (status == ExecutableState.ERROR) {
        hasError=true;
      }
      if (status != ExecutableState.SUCCEED) {
        allSucceed=false;
      }
    }
    if (allSucceed) {
      jobService.updateJobOutput(getId(),ExecutableState.SUCCEED,null,null);
    }
 else     if (hasError) {
      jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,null);
    }
 else {
      jobService.updateJobOutput(getId(),ExecutableState.READY,null,null);
    }
  }
 else   if (result.state() == ExecuteResult.State.STOPPED) {
    if (getStatus() == ExecutableState.STOPPED) {
    }
 else {
      jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,null);
    }
  }
 else {
    jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,null);
  }
}

Fixed version (ground truth):
@Override protected void onExecuteFinished(ExecuteResult result,ExecutableContext executableContext){
  if (result.state() == ExecuteResult.State.DISCARDED) {
    jobService.updateJobOutput(getId(),ExecutableState.DISCARDED,null,null);
  }
 else   if (isDiscarded()) {
  }
 else   if (result.succeed()) {
    List<? extends Executable> jobs=getTasks();
    boolean allSucceed=true;
    boolean hasError=false;
    for (    Executable task : jobs) {
      final ExecutableState status=task.getStatus();
      if (status == ExecutableState.ERROR) {
        hasError=true;
      }
      if (status != ExecutableState.SUCCEED) {
        allSucceed=false;
      }
    }
    if (allSucceed) {
      jobService.updateJobOutput(getId(),ExecutableState.SUCCEED,null,null);
    }
 else     if (hasError) {
      jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,null);
    }
 else {
      jobService.updateJobOutput(getId(),ExecutableState.READY,null,null);
    }
  }
 else {
    jobService.updateJobOutput(getId(),ExecutableState.ERROR,null,null);
  }
}
Program: 63167
Project: 63167
Buggy source:
@Override protected ExecuteResult doWork(ExecutableContext context) throws ExecuteException {
  try {
    Thread.sleep(5000);
  }
 catch (  InterruptedException e) {
  }
  if (isStopped()) {
    return new ExecuteResult(ExecuteResult.State.STOPPED,"String_Node_Str");
  }
 else {
    return new ExecuteResult(ExecuteResult.State.SUCCEED,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected ExecuteResult doWork(ExecutableContext context) throws ExecuteException {
  try {
    Thread.sleep(5000);
  }
 catch (  InterruptedException e) {
  }
  if (isDiscarded()) {
    return new ExecuteResult(ExecuteResult.State.STOPPED,"String_Node_Str");
  }
 else {
    return new ExecuteResult(ExecuteResult.State.SUCCEED,"String_Node_Str");
  }
}
Program: 63168
Project: 63168
Buggy source:
@Test public void testDiscard() throws Exception {
  DefaultChainedExecutable job=new DefaultChainedExecutable();
  BaseTestExecutable task1=new SelfStopExecutable();
  job.addTask(task1);
  jobService.addJob(job);
  waitForJobStatus(job.getId(),ExecutableState.RUNNING,500);
  jobService.discardJob(job.getId());
  waitForJobFinish(job.getId());
  assertEquals(ExecutableState.DISCARDED,jobService.getOutput(job.getId()).getState());
  assertEquals(ExecutableState.DISCARDED,jobService.getOutput(task1.getId()).getState());
}

Fixed version (ground truth):
@Test public void testDiscard() throws Exception {
  DefaultChainedExecutable job=new DefaultChainedExecutable();
  BaseTestExecutable task1=new SelfStopExecutable();
  job.addTask(task1);
  jobService.addJob(job);
  waitForJobStatus(job.getId(),ExecutableState.RUNNING,500);
  jobService.discardJob(job.getId());
  waitForJobFinish(job.getId());
  assertEquals(ExecutableState.DISCARDED,jobService.getOutput(job.getId()).getState());
  assertEquals(ExecutableState.DISCARDED,jobService.getOutput(task1.getId()).getState());
  Thread.sleep(5000);
  System.out.println(job);
}
Program: 63170
Project: 63170
Buggy source:
private UpdateCubeInfoAfterBuildExecutable createUpdateCubeInfoStep(String createFlatTableStepId,String baseCuboidStepId,String convertToHFileStepId){
  final UpdateCubeInfoAfterBuildExecutable updateCubeInfoStep=new UpdateCubeInfoAfterBuildExecutable();
  updateCubeInfoStep.setName(ExecutableConstants.STEP_NAME_UPDATE_CUBE_INFO);
  updateCubeInfoStep.setCubeName(getCubeName());
  updateCubeInfoStep.setSegmentId(segment.getUuid());
  updateCubeInfoStep.setCreateFlatTableStepId(createFlatTableStepId);
  updateCubeInfoStep.setBaseCuboidStepId(baseCuboidStepId);
  updateCubeInfoStep.setConvertToHFileStepId(convertToHFileStepId);
  return updateCubeInfoStep;
}

Fixed version (ground truth):
private UpdateCubeInfoAfterBuildExecutable createUpdateCubeInfoStep(String createFlatTableStepId,String baseCuboidStepId,String convertToHFileStepId,String jobId){
  final UpdateCubeInfoAfterBuildExecutable updateCubeInfoStep=new UpdateCubeInfoAfterBuildExecutable();
  updateCubeInfoStep.setName(ExecutableConstants.STEP_NAME_UPDATE_CUBE_INFO);
  updateCubeInfoStep.setCubeName(getCubeName());
  updateCubeInfoStep.setSegmentId(segment.getUuid());
  updateCubeInfoStep.setCreateFlatTableStepId(createFlatTableStepId);
  updateCubeInfoStep.setBaseCuboidStepId(baseCuboidStepId);
  updateCubeInfoStep.setConvertToHFileStepId(convertToHFileStepId);
  updateCubeInfoStep.setCubingJobId(jobId);
  return updateCubeInfoStep;
}
Program: 63171
Project: 63171
Buggy source:
private UpdateCubeInfoAfterMergeExecutable createUpdateCubeInfoAfterMergeStep(List<String> mergingSegmentIds,String convertToHFileStepId){
  UpdateCubeInfoAfterMergeExecutable result=new UpdateCubeInfoAfterMergeExecutable();
  result.setName(ExecutableConstants.STEP_NAME_UPDATE_CUBE_INFO);
  result.setCubeName(getCubeName());
  result.setSegmentId(segment.getUuid());
  result.setMergingSegmentIds(mergingSegmentIds);
  result.setConvertToHFileStepId(convertToHFileStepId);
  return result;
}

Fixed version (ground truth):
private UpdateCubeInfoAfterMergeExecutable createUpdateCubeInfoAfterMergeStep(List<String> mergingSegmentIds,String convertToHFileStepId,String jobId){
  UpdateCubeInfoAfterMergeExecutable result=new UpdateCubeInfoAfterMergeExecutable();
  result.setName(ExecutableConstants.STEP_NAME_UPDATE_CUBE_INFO);
  result.setCubeName(getCubeName());
  result.setSegmentId(segment.getUuid());
  result.setMergingSegmentIds(mergingSegmentIds);
  result.setConvertToHFileStepId(convertToHFileStepId);
  result.setCubingJobId(jobId);
  return result;
}
Program: 63172
Project: 63172
Buggy source:
private String getPathToMerge(CubeSegment segment){
  return getJobWorkingDir(segment.getUuid()) + "String_Node_Str" + getCubeName()+ "String_Node_Str";
}

Fixed version (ground truth):
private String getPathToMerge(CubeSegment segment){
  return getJobWorkingDir(segment.getLastBuildJobID()) + "String_Node_Str" + getCubeName()+ "String_Node_Str";
}
Program: 63173
Project: 63173
Buggy source:
public CubingJob mergeJob(){
  checkPreconditions();
  CubingJob result=initialJob("String_Node_Str");
  final String jobId=result.getId();
  List<CubeSegment> mergingSegments=segment.getCubeInstance().getMergingSegments(segment);
  Preconditions.checkState(mergingSegments != null && mergingSegments.size() > 1,"String_Node_Str");
  String[] cuboidPaths=new String[mergingSegments.size()];
  for (int i=0; i < mergingSegments.size(); i++) {
    cuboidPaths[i]=getPathToMerge(mergingSegments.get(i));
  }
  final String formattedPath=StringUtils.join(cuboidPaths,"String_Node_Str");
  final String mergedCuboidPath=getJobWorkingDir(jobId) + "String_Node_Str" + getCubeName()+ "String_Node_Str";
  result.addTask(createMergeCuboidDataStep(formattedPath,mergedCuboidPath));
  result.addTask(createRangeRowkeyDistributionStep(mergedCuboidPath));
  result.addTask(createCreateHTableStep());
  final MapReduceExecutable convertCuboidToHfileStep=createConvertCuboidToHfileStep(mergedCuboidPath,jobId);
  result.addTask(convertCuboidToHfileStep);
  result.addTask(createBulkLoadStep(jobId));
  final List<String> mergingSegmentIds=Lists.transform(mergingSegments,new Function<CubeSegment,String>(){
    @Nullable @Override public String apply(    CubeSegment input){
      return input.getUuid();
    }
  }
);
  result.addTask(createUpdateCubeInfoAfterMergeStep(mergingSegmentIds,convertCuboidToHfileStep.getId()));
  return result;
}

Fixed version (ground truth):
public CubingJob mergeJob(){
  checkPreconditions();
  CubingJob result=initialJob("String_Node_Str");
  final String jobId=result.getId();
  List<CubeSegment> mergingSegments=segment.getCubeInstance().getMergingSegments(segment);
  Preconditions.checkState(mergingSegments != null && mergingSegments.size() > 1,"String_Node_Str");
  String[] cuboidPaths=new String[mergingSegments.size()];
  for (int i=0; i < mergingSegments.size(); i++) {
    cuboidPaths[i]=getPathToMerge(mergingSegments.get(i));
  }
  final String formattedPath=StringUtils.join(cuboidPaths,"String_Node_Str");
  final String mergedCuboidPath=getJobWorkingDir(jobId) + "String_Node_Str" + getCubeName()+ "String_Node_Str";
  result.addTask(createMergeCuboidDataStep(formattedPath,mergedCuboidPath));
  result.addTask(createRangeRowkeyDistributionStep(mergedCuboidPath));
  result.addTask(createCreateHTableStep());
  final MapReduceExecutable convertCuboidToHfileStep=createConvertCuboidToHfileStep(mergedCuboidPath,jobId);
  result.addTask(convertCuboidToHfileStep);
  result.addTask(createBulkLoadStep(jobId));
  final List<String> mergingSegmentIds=Lists.transform(mergingSegments,new Function<CubeSegment,String>(){
    @Nullable @Override public String apply(    CubeSegment input){
      return input.getUuid();
    }
  }
);
  result.addTask(createUpdateCubeInfoAfterMergeStep(mergingSegmentIds,convertCuboidToHfileStep.getId(),jobId));
  return result;
}
Program: 63176
Project: 63176
Buggy source:
private CubeSegment findSegmentWithUuid(String jobID,CubeInstance cubeInstance){
  for (  CubeSegment segment : cubeInstance.getSegments()) {
    if (segment.getUuid().equalsIgnoreCase(jobID)) {
      return segment;
    }
  }
  throw new IllegalStateException("String_Node_Str" + jobID);
}

Fixed version (ground truth):
private CubeSegment findSegmentWithUuid(String jobID,CubeInstance cubeInstance){
  for (  CubeSegment segment : cubeInstance.getSegments()) {
    if (segment.getLastBuildJobID().equalsIgnoreCase(jobID)) {
      return segment;
    }
  }
  throw new IllegalStateException("String_Node_Str" + jobID);
}
Program: 63179
Project: 63179
Buggy source:
public void updateJobOutput(String jobId,ExecutableState newStatus,Map<String,String> info,String output){
  try {
    final JobOutputPO jobOutput=jobDao.getJobOutput(jobId);
    ExecutableState oldStatus=ExecutableState.valueOf(jobOutput.getStatus());
    if (newStatus != null && oldStatus == newStatus) {
      if (!ExecutableState.isValidStateTransfer(oldStatus,newStatus)) {
        throw new IllegalStateTranferException("String_Node_Str" + oldStatus + "String_Node_Str"+ newStatus);
      }
      jobOutput.setStatus(newStatus.toString());
    }
    if (info != null) {
      jobOutput.setInfo(info);
    }
    if (output != null) {
      jobOutput.setContent(output);
    }
    jobDao.updateJobOutput(jobOutput);
    logger.info("String_Node_Str" + jobId + "String_Node_Str"+ oldStatus+ "String_Node_Str"+ newStatus);
  }
 catch (  PersistentException e) {
    logger.error("String_Node_Str" + jobId + "String_Node_Str"+ newStatus.toString());
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public void updateJobOutput(String jobId,ExecutableState newStatus,Map<String,String> info,String output){
  try {
    final JobOutputPO jobOutput=jobDao.getJobOutput(jobId);
    ExecutableState oldStatus=ExecutableState.valueOf(jobOutput.getStatus());
    if (newStatus != null && oldStatus != newStatus) {
      if (!ExecutableState.isValidStateTransfer(oldStatus,newStatus)) {
        throw new IllegalStateTranferException("String_Node_Str" + oldStatus + "String_Node_Str"+ newStatus);
      }
      jobOutput.setStatus(newStatus.toString());
    }
    if (info != null) {
      jobOutput.setInfo(info);
    }
    if (output != null) {
      jobOutput.setContent(output);
    }
    jobDao.updateJobOutput(jobOutput);
    logger.info("String_Node_Str" + jobId + "String_Node_Str"+ oldStatus+ "String_Node_Str"+ newStatus);
  }
 catch (  PersistentException e) {
    logger.error("String_Node_Str" + jobId + "String_Node_Str"+ newStatus.toString());
    throw new RuntimeException(e);
  }
}
Program: 63180
Project: 63180
Buggy source:
@Override public void apply(List<IRealization> realizations,OLAPContext olapContext){
  if (olapContext.isWeekMatch.containsKey(realizations.get(0))) {
    CubeInstance cube=(CubeInstance)realizations.get(0);
    adjustOLAPContext(cube,olapContext);
  }
}

Fixed version (ground truth):
@Override public void apply(List<IRealization> realizations,OLAPContext olapContext){
  if (realizations.size() > 0) {
    if (olapContext.isWeekMatch.containsKey(realizations.get(0))) {
      CubeInstance cube=(CubeInstance)realizations.get(0);
      adjustOLAPContext(cube,olapContext);
    }
  }
}
Program: 63181
Project: 63181
Buggy source:
/** 
 * Get hive SQL of the cube
 * @param cubeName Cube Name
 * @return
 * @throws UnknownHostException
 * @throws IOException
 */
@RequestMapping(value="String_Node_Str",method={RequestMethod.GET}) @ResponseBody public GeneralResponse getSql(@PathVariable String cubeName,@PathVariable String segmentName){
  String sql=null;
  try {
    sql=cubeService.getJobManager().previewFlatHiveQL(cubeName,segmentName);
  }
 catch (  JobException e) {
    logger.error(e.getLocalizedMessage(),e);
    throw new InternalErrorException(e.getLocalizedMessage());
  }
catch (  UnknownHostException e) {
    logger.error(e.getLocalizedMessage(),e);
    throw new InternalErrorException(e.getLocalizedMessage());
  }
  GeneralResponse repsonse=new GeneralResponse();
  repsonse.setProperty("String_Node_Str",sql);
  return repsonse;
}

Fixed version (ground truth):
/** 
 * Get hive SQL of the cube
 * @param cubeName Cube Name
 * @return
 * @throws UnknownHostException
 * @throws IOException
 */
@RequestMapping(value="String_Node_Str",method={RequestMethod.GET}) @ResponseBody public GeneralResponse getSql(@PathVariable String cubeName,@PathVariable String segmentName){
  CubeInstance cube=cubeService.getCubeManager().getCube(cubeName);
  CubeDesc cubeDesc=cube.getDescriptor();
  CubeSegment cubeSegment=cube.getSegment(segmentName,SegmentStatusEnum.READY);
  CubeJoinedFlatTableDesc flatTableDesc=new CubeJoinedFlatTableDesc(cubeDesc,cubeSegment);
  String sql=JoinedFlatTable.generateSelectDataStatement(flatTableDesc);
  GeneralResponse repsonse=new GeneralResponse();
  repsonse.setProperty("String_Node_Str",sql);
  return repsonse;
}
Program: 63182
Project: 63182
Buggy source:
/** 
 * @param error
 * @return
 */
private String omitMessage(List<String> errors){
  StringBuffer buffer=new StringBuffer();
  for (Iterator<String> iterator=errors.iterator(); iterator.hasNext(); ) {
    String string=(String)iterator.next();
    buffer.append(string);
    buffer.append("String_Node_Str");
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * @return
 */
private String omitMessage(List<String> errors){
  StringBuffer buffer=new StringBuffer();
  for (Iterator<String> iterator=errors.iterator(); iterator.hasNext(); ) {
    String string=(String)iterator.next();
    buffer.append(string);
    buffer.append("String_Node_Str");
  }
  return buffer.toString();
}
Program: 63183
Project: 63183
Buggy source:
public KylinConfig getKylinConfig(){
  KylinConfig kylinConfig=KylinConfig.getInstanceFromEnv();
  if (kylinConfig == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return kylinConfig;
}

Fixed version (ground truth):
public final KylinConfig getKylinConfig(){
  KylinConfig kylinConfig=KylinConfig.getInstanceFromEnv();
  if (kylinConfig == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return kylinConfig;
}
Program: 63184
Project: 63184
Buggy source:
public CubeManager getCubeManager(){
  return CubeManager.getInstance(getConfig());
}

Fixed version (ground truth):
public final CubeManager getCubeManager(){
  return CubeManager.getInstance(getConfig());
}
Program: 63185
Project: 63185
Buggy source:
public ProjectManager getProjectManager(){
  return ProjectManager.getInstance(getConfig());
}

Fixed version (ground truth):
public final ProjectManager getProjectManager(){
  return ProjectManager.getInstance(getConfig());
}
Program: 63186
Project: 63186
Buggy source:
public MetadataManager getMetadataManager(){
  return MetadataManager.getInstance(getConfig());
}

Fixed version (ground truth):
public final MetadataManager getMetadataManager(){
  return MetadataManager.getInstance(getConfig());
}
Program: 63187
Project: 63187
Buggy source:
public CubeDescManager getCubeDescManager(){
  return CubeDescManager.getInstance(getConfig());
}

Fixed version (ground truth):
public final CubeDescManager getCubeDescManager(){
  return CubeDescManager.getInstance(getConfig());
}
Program: 63188
Project: 63188
Buggy source:
/** 
 * Update a cube status from disable to ready.
 * @return
 * @throws CubeIntegrityException
 * @throws IOException
 * @throws JobException
 */
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public CubeInstance enableCube(CubeInstance cube) throws IOException, CubeIntegrityException, JobException {
  String cubeName=cube.getName();
  RealizationStatusEnum ostatus=cube.getStatus();
  if (!cube.getStatus().equals(RealizationStatusEnum.DISABLED)) {
    throw new InternalErrorException("String_Node_Str" + cubeName + "String_Node_Str"+ ostatus);
  }
  if (cube.getSegments(SegmentStatusEnum.READY).size() == 0) {
    throw new InternalErrorException("String_Node_Str" + cubeName + "String_Node_Str");
  }
  List<JobInstance> jobInstances=this.getJobManager().listJobs(cube.getName(),null);
  for (  JobInstance jobInstance : jobInstances) {
    if (jobInstance.getStatus() == JobStatusEnum.PENDING || jobInstance.getStatus() == JobStatusEnum.RUNNING) {
      throw new JobException("String_Node_Str");
    }
  }
  if (!cube.getDescriptor().calculateSignature().equals(cube.getDescriptor().getSignature())) {
    this.releaseAllSegments(cube);
  }
  cube.setStatus(RealizationStatusEnum.READY);
  try {
    return getCubeManager().updateCube(cube);
  }
 catch (  IOException e) {
    cube.setStatus(ostatus);
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Update a cube status from disable to ready.
 * @return
 * @throws CubeIntegrityException
 * @throws IOException
 * @throws JobException
 */
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public CubeInstance enableCube(CubeInstance cube) throws IOException, CubeIntegrityException, JobException {
  String cubeName=cube.getName();
  RealizationStatusEnum ostatus=cube.getStatus();
  if (!cube.getStatus().equals(RealizationStatusEnum.DISABLED)) {
    throw new InternalErrorException("String_Node_Str" + cubeName + "String_Node_Str"+ ostatus);
  }
  if (cube.getSegments(SegmentStatusEnum.READY).size() == 0) {
    throw new InternalErrorException("String_Node_Str" + cubeName + "String_Node_Str");
  }
  final List<BuildCubeJob> buildCubeJobs=listAllCubingJobs(cube.getName(),null,EnumSet.of(ExecutableState.READY,ExecutableState.RUNNING));
  if (!buildCubeJobs.isEmpty()) {
    throw new JobException("String_Node_Str");
  }
  if (!cube.getDescriptor().calculateSignature().equals(cube.getDescriptor().getSignature())) {
    this.releaseAllSegments(cube);
  }
  cube.setStatus(RealizationStatusEnum.READY);
  try {
    return getCubeManager().updateCube(cube);
  }
 catch (  IOException e) {
    cube.setStatus(ostatus);
    throw e;
  }
}
Program: 63189
Project: 63189
Buggy source:
/** 
 * purge the cube
 * @throws IOException
 * @throws JobException
 * @throws UnknownHostException
 * @throws CubeIntegrityException
 */
private void releaseAllSegments(CubeInstance cube) throws IOException, JobException, UnknownHostException, CubeIntegrityException {
  for (  JobInstance jobInstance : this.getJobManager().listJobs(cube.getName(),null)) {
    if (jobInstance.getStatus() != JobStatusEnum.FINISHED && jobInstance.getStatus() != JobStatusEnum.DISCARDED) {
      for (      JobStep jobStep : jobInstance.getSteps()) {
        if (jobStep.getStatus() != JobStepStatusEnum.FINISHED) {
          jobStep.setStatus(JobStepStatusEnum.DISCARDED);
        }
      }
      JobDAO.getInstance(this.getConfig()).updateJobInstance(jobInstance);
    }
  }
  cube.getSegments().clear();
  CubeManager.getInstance(getConfig()).updateCube(cube);
}

Fixed version (ground truth):
/** 
 * purge the cube
 * @throws IOException
 * @throws JobException
 * @throws UnknownHostException
 * @throws CubeIntegrityException
 */
private void releaseAllSegments(CubeInstance cube) throws IOException, JobException, UnknownHostException, CubeIntegrityException {
  final List<BuildCubeJob> buildCubeJobs=listAllCubingJobs(cube.getName(),null);
  for (  BuildCubeJob buildCubeJob : buildCubeJobs) {
    final ExecutableState status=buildCubeJob.getStatus();
    if (status != ExecutableState.SUCCEED && status != ExecutableState.STOPPED && status != ExecutableState.DISCARDED) {
      getExecutableManager().stopJob(buildCubeJob.getId());
    }
  }
  cube.getSegments().clear();
  CubeManager.getInstance(getConfig()).updateCube(cube);
}
Program: 63190
Project: 63190
Buggy source:
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public CubeDesc updateCubeAndDesc(CubeInstance cube,CubeDesc desc,String newProjectName) throws UnknownHostException, IOException, JobException {
  List<JobInstance> jobInstances=this.getJobManager().listJobs(cube.getName(),null);
  for (  JobInstance jobInstance : jobInstances) {
    if (jobInstance.getStatus() == JobStatusEnum.PENDING || jobInstance.getStatus() == JobStatusEnum.RUNNING) {
      throw new JobException("String_Node_Str");
    }
  }
  try {
    if (!cube.getDescriptor().calculateSignature().equals(cube.getDescriptor().getSignature())) {
      this.releaseAllSegments(cube);
    }
    CubeDesc updatedCubeDesc=getCubeDescManager().updateCubeDesc(desc);
    int cuboidCount=CuboidCLI.simulateCuboidGeneration(updatedCubeDesc);
    logger.info("String_Node_Str" + cube.getName() + "String_Node_Str"+ cuboidCount+ "String_Node_Str");
    ProjectManager projectManager=getProjectManager();
    if (!isCubeInProject(newProjectName,cube)) {
      String owner=SecurityContextHolder.getContext().getAuthentication().getName();
      ProjectInstance newProject=projectManager.moveRealizationToProject(RealizationType.CUBE,cube.getName(),newProjectName,owner);
      accessService.inherit(cube,newProject);
    }
    return updatedCubeDesc;
  }
 catch (  IOException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
catch (  CubeIntegrityException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public CubeDesc updateCubeAndDesc(CubeInstance cube,CubeDesc desc,String newProjectName) throws UnknownHostException, IOException, JobException {
  final List<BuildCubeJob> buildCubeJobs=listAllCubingJobs(cube.getName(),null,EnumSet.of(ExecutableState.READY,ExecutableState.RUNNING));
  if (!buildCubeJobs.isEmpty()) {
    throw new JobException("String_Node_Str");
  }
  try {
    if (!cube.getDescriptor().calculateSignature().equals(cube.getDescriptor().getSignature())) {
      this.releaseAllSegments(cube);
    }
    CubeDesc updatedCubeDesc=getCubeDescManager().updateCubeDesc(desc);
    int cuboidCount=CuboidCLI.simulateCuboidGeneration(updatedCubeDesc);
    logger.info("String_Node_Str" + cube.getName() + "String_Node_Str"+ cuboidCount+ "String_Node_Str");
    ProjectManager projectManager=getProjectManager();
    if (!isCubeInProject(newProjectName,cube)) {
      String owner=SecurityContextHolder.getContext().getAuthentication().getName();
      ProjectInstance newProject=projectManager.moveRealizationToProject(RealizationType.CUBE,cube.getName(),newProjectName,owner);
      accessService.inherit(cube,newProject);
    }
    return updatedCubeDesc;
  }
 catch (  IOException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
catch (  CubeIntegrityException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
}
Program: 63191
Project: 63191
Buggy source:
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public void deleteCube(CubeInstance cube) throws IOException, JobException, CubeIntegrityException {
  List<JobInstance> jobInstances=this.getJobManager().listJobs(cube.getName(),null);
  for (  JobInstance jobInstance : jobInstances) {
    if (jobInstance.getStatus() == JobStatusEnum.PENDING || jobInstance.getStatus() == JobStatusEnum.RUNNING) {
      throw new JobException("String_Node_Str" + cube.getName() + "String_Node_Str");
    }
  }
  this.releaseAllSegments(cube);
  getCubeManager().dropCube(cube.getName(),true);
  accessService.clean(cube,true);
}

Fixed version (ground truth):
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public void deleteCube(CubeInstance cube) throws IOException, JobException, CubeIntegrityException {
  final List<BuildCubeJob> buildCubeJobs=listAllCubingJobs(cube.getName(),null,EnumSet.of(ExecutableState.READY,ExecutableState.RUNNING));
  if (!buildCubeJobs.isEmpty()) {
    throw new JobException("String_Node_Str" + cube.getName() + "String_Node_Str");
  }
  this.releaseAllSegments(cube);
  getCubeManager().dropCube(cube.getName(),true);
  accessService.clean(cube,true);
}
Program: 63192
Project: 63192
Buggy source:
@BeforeClass public static void setupResource() throws Exception {
  Authentication authentication=new TestingAuthenticationToken("String_Node_Str","String_Node_Str","String_Node_Str");
  SecurityContextHolder.getContext().setAuthentication(authentication);
}

Fixed version (ground truth):
@BeforeClass public static void setupResource() throws Exception {
  staticCreateTestMetadata();
  Authentication authentication=new TestingAuthenticationToken("String_Node_Str","String_Node_Str","String_Node_Str");
  SecurityContextHolder.getContext().setAuthentication(authentication);
}
Program: 63194
Project: 63194
Buggy source:
public SSHClient(String hostname,String username,String password,SSHLogger sshLogger){
  this.hostname=hostname;
  this.username=username;
  if (new File(password).exists()) {
    this.identityPath=new File(password).getAbsolutePath();
    this.password=null;
  }
 else {
    this.password=password;
    this.identityPath=null;
  }
  this.sshLogger=sshLogger;
}

Fixed version (ground truth):
public SSHClient(String hostname,String username,String password,SSHLogger sshLogger){
  this.hostname=hostname;
  this.username=username;
  if (password != null && new File(password).exists()) {
    this.identityPath=new File(password).getAbsolutePath();
    this.password=null;
  }
 else {
    this.password=password;
    this.identityPath=null;
  }
  this.sshLogger=sshLogger;
}
Program: 63195
Project: 63195
Buggy source:
public CubeInstance createCube(String cubeName,String projectName,CubeDesc desc,String owner) throws IOException {
  logger.info("String_Node_Str" + projectName + "String_Node_Str"+ cubeName+ "String_Node_Str"+ desc.getName()+ "String_Node_Str");
  CubeInstance cube=CubeInstance.create(cubeName,projectName,desc);
  cube.setOwner(owner);
  saveResource(cube);
  ProjectManager.getInstance(config).updateRealizationToProject(RealizationType.CUBE,cubeName,projectName,owner);
  return cube;
}

Fixed version (ground truth):
public CubeInstance createCube(String cubeName,String projectName,CubeDesc desc,String owner) throws IOException {
  logger.info("String_Node_Str" + projectName + "String_Node_Str"+ cubeName+ "String_Node_Str"+ desc.getName()+ "String_Node_Str");
  CubeInstance cube=CubeInstance.create(cubeName,projectName,desc);
  cube.setOwner(owner);
  saveResource(cube);
  ProjectManager.getInstance(config).moveRealizationToProject(RealizationType.CUBE,cubeName,projectName,owner);
  return cube;
}
Program: 63196
Project: 63196
Buggy source:
@Test public void testProjectsLoadAfterProjectChange() throws IOException {
  CubeInstance cube=CubeManager.getInstance(getTestConfig()).getCube("String_Node_Str");
  assertTrue(ProjectManager.getInstance(this.getTestConfig()).getRealizationsByTable("String_Node_Str","String_Node_Str").contains(cube));
  ProjectManager.getInstance(getTestConfig()).removeRealizationsFromProjects(RealizationType.CUBE,cube.getName());
  assertTrue(!ProjectManager.getInstance(this.getTestConfig()).getRealizationsByTable("String_Node_Str","String_Node_Str").contains(cube));
  ProjectManager.getInstance(getTestConfig()).updateRealizationToProject(RealizationType.CUBE,cube.getName(),"String_Node_Str","String_Node_Str");
  assertTrue(ProjectManager.getInstance(this.getTestConfig()).getRealizationsByTable("String_Node_Str","String_Node_Str").contains(cube));
}

Fixed version (ground truth):
@Test public void testProjectsLoadAfterProjectChange() throws IOException {
  CubeInstance cube=CubeManager.getInstance(getTestConfig()).getCube("String_Node_Str");
  assertTrue(ProjectManager.getInstance(this.getTestConfig()).getRealizationsByTable("String_Node_Str","String_Node_Str").contains(cube));
  ProjectManager.getInstance(getTestConfig()).removeRealizationsFromProjects(RealizationType.CUBE,cube.getName());
  assertTrue(!ProjectManager.getInstance(this.getTestConfig()).getRealizationsByTable("String_Node_Str","String_Node_Str").contains(cube));
  ProjectManager.getInstance(getTestConfig()).moveRealizationToProject(RealizationType.CUBE,cube.getName(),"String_Node_Str","String_Node_Str");
  assertTrue(ProjectManager.getInstance(this.getTestConfig()).getRealizationsByTable("String_Node_Str","String_Node_Str").contains(cube));
}
Program: 63198
Project: 63198
Buggy source:
public ProjectInstance addTableDescToProject(String tables,String projectName) throws IOException {
  ProjectInstance projectInstance=getProject(projectName);
  String[] tokens=StringUtils.split(tables,"String_Node_Str");
  for (int i=0; i < tokens.length; i++) {
    String token=tokens[i].trim();
    if (StringUtils.isNotEmpty(token)) {
      projectInstance.addTable(token);
    }
  }
  List<TableDesc> exposedTables=listExposedTables(projectName);
  for (  TableDesc table : exposedTables) {
    projectInstance.addTable(table.getName());
  }
  saveResource(projectInstance);
  return projectInstance;
}

Fixed version (ground truth):
public ProjectInstance addTableDescToProject(String tables,String projectName) throws IOException {
  MetadataManager metaMgr=getMetadataManager();
  ProjectInstance projectInstance=getProject(projectName);
  String[] tokens=StringUtils.split(tables,"String_Node_Str");
  for (int i=0; i < tokens.length; i++) {
    String token=tokens[i].trim();
    TableDesc table=metaMgr.getTableDesc(token);
    if (table != null) {
      projectInstance.addTable(table.getIdentity());
    }
  }
  saveResource(projectInstance);
  return projectInstance;
}
Program: 63199
Project: 63199
Buggy source:
private RealizationRegistry(KylinConfig config) throws IOException {
  logger.info("String_Node_Str" + config);
  this.config=config;
  loadRealizations();
}

Fixed version (ground truth):
private RealizationRegistry(KylinConfig config) throws IOException {
  logger.info("String_Node_Str" + config);
  this.config=config;
}
Program: 63200
Project: 63200
Buggy source:
public static RealizationRegistry getInstance(KylinConfig config){
  RealizationRegistry r=CACHE.get(config);
  if (r != null) {
    return r;
  }
synchronized (RealizationRegistry.class) {
    r=CACHE.get(config);
    if (r != null) {
      return r;
    }
    try {
      r=new RealizationRegistry(config);
      CACHE.put(config,r);
      if (CACHE.size() > 1) {
        logger.warn("String_Node_Str");
      }
      return r;
    }
 catch (    IOException e) {
      throw new IllegalStateException("String_Node_Str" + config,e);
    }
  }
}

Fixed version (ground truth):
public static RealizationRegistry getInstance(KylinConfig config){
  RealizationRegistry r=CACHE.get(config);
  if (r != null) {
    return r;
  }
synchronized (RealizationRegistry.class) {
    r=CACHE.get(config);
    if (r != null) {
      return r;
    }
    try {
      r=new RealizationRegistry(config);
      CACHE.put(config,r);
      r.loadRealizations();
      if (CACHE.size() > 1) {
        logger.warn("String_Node_Str");
      }
      return r;
    }
 catch (    IOException e) {
      throw new IllegalStateException("String_Node_Str" + config,e);
    }
  }
}
Program: 63201
Project: 63201
Buggy source:
/** 
 * Get available table list of the input database
 * @return Table metadata array
 * @throws IOException
 */
@RequestMapping(value="String_Node_Str",method={RequestMethod.GET}) @ResponseBody @Metered(name="String_Node_Str") public List<TableDesc> getHiveTables(@RequestParam(value="String_Node_Str",required=false) boolean withExt,@RequestParam(value="String_Node_Str",required=false) String project){
  long start=System.currentTimeMillis();
  List<TableDesc> tables=null;
  try {
    tables=cubeMgmtService.getProjectManager().listDefinedTablesInProject(project);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new InternalErrorException(e.getLocalizedMessage());
  }
  if (withExt) {
    tables=cloneTableDesc(tables);
  }
  long end=System.currentTimeMillis();
  logger.info("String_Node_Str" + (end - start) + "String_Node_Str");
  return tables;
}

Fixed version (ground truth):
/** 
 * Get available table list of the input database
 * @return Table metadata array
 * @throws IOException
 */
@RequestMapping(value="String_Node_Str",method={RequestMethod.GET}) @ResponseBody @Metered(name="String_Node_Str") public List<TableDesc> getHiveTables(@RequestParam(value="String_Node_Str",required=false) boolean withExt,@RequestParam(value="String_Node_Str",required=false) String project){
  long start=System.currentTimeMillis();
  List<TableDesc> tables=null;
  try {
    tables=cubeMgmtService.getProjectManager().listDefinedTables(project);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new InternalErrorException(e.getLocalizedMessage());
  }
  if (withExt) {
    tables=cloneTableDesc(tables);
  }
  long end=System.currentTimeMillis();
  logger.info("String_Node_Str" + (end - start) + "String_Node_Str");
  return tables;
}
Program: 63202
Project: 63202
Buggy source:
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public CubeDesc updateCubeAndDesc(CubeInstance cube,CubeDesc desc,String newProjectName) throws UnknownHostException, IOException, JobException {
  List<JobInstance> jobInstances=this.getJobManager().listJobs(cube.getName(),null);
  for (  JobInstance jobInstance : jobInstances) {
    if (jobInstance.getStatus() == JobStatusEnum.PENDING || jobInstance.getStatus() == JobStatusEnum.RUNNING) {
      throw new JobException("String_Node_Str");
    }
  }
  try {
    if (!cube.getDescriptor().calculateSignature().equals(cube.getDescriptor().getSignature())) {
      this.releaseAllSegments(cube);
    }
    CubeDesc updatedCubeDesc=getCubeDescManager().updateCubeDesc(desc);
    int cuboidCount=CuboidCLI.simulateCuboidGeneration(updatedCubeDesc);
    logger.info("String_Node_Str" + cube.getName() + "String_Node_Str"+ cuboidCount+ "String_Node_Str");
    ProjectManager projectManager=getProjectManager();
    if (!isCubeInProject(newProjectName,cube)) {
      String owner=SecurityContextHolder.getContext().getAuthentication().getName();
      ProjectInstance newProject=projectManager.updateRealizationToProject(RealizationType.CUBE,cube.getName(),newProjectName,owner);
      accessService.inherit(cube,newProject);
    }
    return updatedCubeDesc;
  }
 catch (  IOException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
catch (  CubeIntegrityException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + "String_Node_Str") public CubeDesc updateCubeAndDesc(CubeInstance cube,CubeDesc desc,String newProjectName) throws UnknownHostException, IOException, JobException {
  List<JobInstance> jobInstances=this.getJobManager().listJobs(cube.getName(),null);
  for (  JobInstance jobInstance : jobInstances) {
    if (jobInstance.getStatus() == JobStatusEnum.PENDING || jobInstance.getStatus() == JobStatusEnum.RUNNING) {
      throw new JobException("String_Node_Str");
    }
  }
  try {
    if (!cube.getDescriptor().calculateSignature().equals(cube.getDescriptor().getSignature())) {
      this.releaseAllSegments(cube);
    }
    CubeDesc updatedCubeDesc=getCubeDescManager().updateCubeDesc(desc);
    int cuboidCount=CuboidCLI.simulateCuboidGeneration(updatedCubeDesc);
    logger.info("String_Node_Str" + cube.getName() + "String_Node_Str"+ cuboidCount+ "String_Node_Str");
    ProjectManager projectManager=getProjectManager();
    if (!isCubeInProject(newProjectName,cube)) {
      String owner=SecurityContextHolder.getContext().getAuthentication().getName();
      ProjectInstance newProject=projectManager.moveRealizationToProject(RealizationType.CUBE,cube.getName(),newProjectName,owner);
      accessService.inherit(cube,newProject);
    }
    return updatedCubeDesc;
  }
 catch (  IOException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
catch (  CubeIntegrityException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
}
Program: 63204
Project: 63204
Buggy source:
private void buildTableAliasMap(){
  tableAliasMap=new HashMap<String,String>();
  tableAliasMap.put(cubeDesc.getFactTable(),FACT_TABLE_ALIAS);
  int i=1;
  for (  DimensionDesc dim : cubeDesc.getDimensions()) {
    JoinDesc join=dim.getJoin();
    if (join != null) {
      tableAliasMap.put(dim.getTable(),LOOKUP_TABLE_ALAIS_PREFIX + i);
      i++;
    }
  }
}

Fixed version (ground truth):
private void buildTableAliasMap(){
  tableAliasMap=new HashMap<String,String>();
  tableAliasMap.put(cubeDesc.getFactTable().toUpperCase(),FACT_TABLE_ALIAS);
  int i=1;
  for (  DimensionDesc dim : cubeDesc.getDimensions()) {
    JoinDesc join=dim.getJoin();
    if (join != null) {
      tableAliasMap.put(dim.getTable().toUpperCase(),LOOKUP_TABLE_ALAIS_PREFIX + i);
      i++;
    }
  }
}
Program: 63205
Project: 63205
Buggy source:
@Override public String getTableAlias(String tableName){
  return tableAliasMap.get(tableName);
}

Fixed version (ground truth):
@Override public String getTableAlias(String tableName){
  return tableAliasMap.get(tableName.toUpperCase());
}
Program: 63206
Project: 63206
Buggy source:
@Override public void map(T key,HCatRecord value,Context context) throws IOException, InterruptedException {
  Integer columnSize=context.getConfiguration().getInt(HiveColumnCardinalityJob.KEY_TABLE_COLUMN_NUMBER,100);
  for (int m=0; m < columnSize; m++) {
    Object cell=value.get(m);
    if (counter < 5 && m < 3) {
      System.out.println("String_Node_Str" + m + "String_Node_Str"+ counter+ "String_Node_Str"+ String.valueOf(cell));
    }
    getHllc(m).add(Bytes.toBytes(String.valueOf(cell)));
  }
  counter++;
}

Fixed version (ground truth):
@Override public void map(T key,HCatRecord value,Context context) throws IOException, InterruptedException {
  Integer columnSize=context.getConfiguration().getInt(HiveColumnCardinalityJob.KEY_TABLE_COLUMN_NUMBER,100);
  for (int m=0; m < columnSize; m++) {
    Object cell=value.get(m);
    if (counter < 5 && m < 3) {
      System.out.println("String_Node_Str" + m + "String_Node_Str"+ counter+ "String_Node_Str"+ cell.toString());
    }
    getHllc(m).add(Bytes.toBytes(cell.toString()));
  }
  counter++;
}
Program: 63207
Project: 63207
Buggy source:
private void writeJobOutputResource(String path,JobOutputPO output) throws IOException {
  store.putResource(path,output,JOB_OUTPUT_SERIALIZER);
}

Fixed version (ground truth):
private long writeJobOutputResource(String path,JobOutputPO output) throws IOException {
  return store.putResource(path,output,JOB_OUTPUT_SERIALIZER);
}
Program: 63208
Project: 63208
Buggy source:
public void updateJobOutput(JobOutputPO output) throws PersistentException {
  try {
    Preconditions.checkArgument(output.getLastModified() > 0,"String_Node_Str");
    writeJobOutputResource(pathOfJobOutput(output.getUuid()),output);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + output.getUuid(),e);
    throw new PersistentException(e);
  }
}

Fixed version (ground truth):
public void updateJobOutput(JobOutputPO output) throws PersistentException {
  try {
    Preconditions.checkArgument(output.getLastModified() > 0,"String_Node_Str");
    final long ts=writeJobOutputResource(pathOfJobOutput(output.getUuid()),output);
    output.setLastModified(ts);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + output.getUuid(),e);
    throw new PersistentException(e);
  }
}
Program: 63209
Project: 63209
Buggy source:
private void addJobOutput(AbstractExecutable executable) throws PersistentException {
  jobDao.addJobOutput(executable.getJobOutput());
  if (executable instanceof DefaultChainedExecutable) {
    for (    AbstractExecutable subTask : ((DefaultChainedExecutable)executable).getTasks()) {
      addJob(subTask);
    }
  }
}

Fixed version (ground truth):
private void addJobOutput(AbstractExecutable executable) throws PersistentException {
  jobDao.addJobOutput(executable.getJobOutput());
  if (executable instanceof DefaultChainedExecutable) {
    for (    AbstractExecutable subTask : ((DefaultChainedExecutable)executable).getTasks()) {
      addJobOutput(subTask);
    }
  }
}
Program: 63210
Project: 63210
Buggy source:
@Override protected void onExecuteStart(ExecutableContext executableContext){
  this.setStatus(ExecutableStatus.RUNNING);
  jobService.updateJobStatus(this,ExecutableStatus.RUNNING);
}

Fixed version (ground truth):
@Override protected void onExecuteStart(ExecutableContext executableContext){
  jobService.updateJobStatus(this,ExecutableStatus.RUNNING);
}
Program: 63211
Project: 63211
Buggy source:
@Before public void setup() throws Exception {
  createTestMetadata();
  setFinalStatic(JobConstants.class.getField("String_Node_Str"),10);
  jobService=DefaultJobService.getInstance(KylinConfig.getInstanceFromEnv());
  scheduler=DefaultScheduler.getInstance();
  scheduler.init(new JobEngineConfig(KylinConfig.getInstanceFromEnv()));
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  createTestMetadata();
  setFinalStatic(JobConstants.class.getField("String_Node_Str"),10);
  jobService=DefaultJobService.getInstance(KylinConfig.getInstanceFromEnv());
  scheduler=DefaultScheduler.getInstance();
  scheduler.init(new JobEngineConfig(KylinConfig.getInstanceFromEnv()));
  if (!scheduler.hasStarted()) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 63212
Project: 63212
Buggy source:
private IIDesc loadIIDesc(String path) throws IOException {
  ResourceStore store=getStore();
  logger.debug("String_Node_Str" + store.getReadableResourcePath(path));
  IIDesc ndesc=store.getResource(path,IIDesc.class,II_DESC_SERIALIZER);
  if (StringUtils.isBlank(ndesc.getName())) {
    throw new IllegalStateException("String_Node_Str");
  }
  ndesc.init(getMetadataManager());
  return ndesc;
}

Fixed version (ground truth):
private IIDesc loadIIDesc(String path) throws IOException {
  ResourceStore store=getStore();
  logger.info("String_Node_Str" + store.getReadableResourcePath(path));
  IIDesc ndesc=store.getResource(path,IIDesc.class,II_DESC_SERIALIZER);
  if (StringUtils.isBlank(ndesc.getName())) {
    throw new IllegalStateException("String_Node_Str");
  }
  ndesc.init(getMetadataManager());
  return ndesc;
}