Program: 9375
Project: 9375
Buggy source:
/** 
 * @throws AbortException if check for runtime fails 
 */
protected boolean doBuild(AjBuildConfig buildConfig,IMessageHandler baseHandler,boolean batch) throws IOException, AbortException {
  boolean ret=true;
  batchCompile=batch;
  try {
    if (batch) {
      this.state=new AjState(this);
    }
    boolean canIncremental=state.prepareForNextBuild(buildConfig);
    if (!canIncremental && !batch) {
      return doBuild(buildConfig,baseHandler,true);
    }
    this.handler=CountingMessageHandler.makeCountingMessageHandler(baseHandler);
    String check=checkRtJar(buildConfig);
    if (check != null) {
      if (FAIL_IF_RUNTIME_NOT_FOUND) {
        MessageUtil.error(handler,check);
        return false;
      }
 else {
        MessageUtil.warn(handler,check);
      }
    }
    setBuildConfig(buildConfig);
    if (batch || !AsmManager.attemptIncrementalModelRepairs) {
      setupModel(buildConfig);
    }
    if (batch) {
      initBcelWorld(handler);
    }
    if (handler.hasErrors()) {
      return false;
    }
    if (buildConfig.getOutputJar() != null) {
      if (!openOutputStream(buildConfig.getOutputJar()))       return false;
    }
    if (batch) {
      if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode()) {
        bcelWorld.setModel(AsmManager.getDefault().getHierarchy());
      }
      binarySourcesForTheNextCompile=state.getBinaryFilesToCompile(true);
      performCompilation(buildConfig.getFiles());
      if (handler.hasErrors()) {
        return false;
      }
      if (AsmManager.isReporting())       AsmManager.getDefault().reportModelInfo("String_Node_Str");
    }
 else {
      binarySourcesForTheNextCompile=state.getBinaryFilesToCompile(true);
      List files=state.getFilesToCompile(true);
      if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode())       if (AsmManager.attemptIncrementalModelRepairs)       AsmManager.getDefault().processDelta(files,state.addedFiles,state.deletedFiles);
      boolean hereWeGoAgain=!(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
      for (int i=0; (i < 5) && hereWeGoAgain; i++) {
        performCompilation(files);
        if (handler.hasErrors() || (progressListener != null && progressListener.isCancelledRequested())) {
          return false;
        }
        binarySourcesForTheNextCompile=state.getBinaryFilesToCompile(false);
        files=state.getFilesToCompile(false);
        hereWeGoAgain=!(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
        if (hereWeGoAgain)         if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode())         if (AsmManager.attemptIncrementalModelRepairs)         AsmManager.getDefault().processDelta(files,state.addedFiles,state.deletedFiles);
      }
      if (!files.isEmpty()) {
        return batchBuild(buildConfig,baseHandler);
      }
 else {
        if (AsmManager.isReporting())         AsmManager.getDefault().reportModelInfo("String_Node_Str");
      }
    }
    if (buildConfig.isEmacsSymMode()) {
      new org.aspectj.ajdt.internal.core.builder.EmacsStructureModelManager().externalizeModel();
    }
    state.successfulCompile(buildConfig);
    copyResourcesToDestination();
    if (buildConfig.isGenerateModelMode()) {
      AsmManager.getDefault().fireModelUpdated();
    }
  }
  finally {
    if (zos != null) {
      closeOutputStream(buildConfig.getOutputJar());
    }
    ret=!handler.hasErrors();
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * @throws AbortException if check for runtime fails 
 */
protected boolean doBuild(AjBuildConfig buildConfig,IMessageHandler baseHandler,boolean batch) throws IOException, AbortException {
  boolean ret=true;
  batchCompile=batch;
  try {
    if (batch) {
      this.state=new AjState(this);
    }
    boolean canIncremental=state.prepareForNextBuild(buildConfig);
    if (!canIncremental && !batch) {
      return doBuild(buildConfig,baseHandler,true);
    }
    this.handler=CountingMessageHandler.makeCountingMessageHandler(baseHandler);
    String check=checkRtJar(buildConfig);
    if (check != null) {
      if (FAIL_IF_RUNTIME_NOT_FOUND) {
        MessageUtil.error(handler,check);
        return false;
      }
 else {
        MessageUtil.warn(handler,check);
      }
    }
    setBuildConfig(buildConfig);
    if (batch || !AsmManager.attemptIncrementalModelRepairs) {
      setupModel(buildConfig);
    }
    if (batch) {
      initBcelWorld(handler);
    }
    if (handler.hasErrors()) {
      return false;
    }
    if (buildConfig.getOutputJar() != null) {
      if (!openOutputStream(buildConfig.getOutputJar()))       return false;
    }
    if (batch) {
      if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode()) {
        bcelWorld.setModel(AsmManager.getDefault().getHierarchy());
      }
      binarySourcesForTheNextCompile=state.getBinaryFilesToCompile(true);
      performCompilation(buildConfig.getFiles());
      if (handler.hasErrors()) {
        return false;
      }
      if (AsmManager.isReporting())       AsmManager.getDefault().reportModelInfo("String_Node_Str");
    }
 else {
      binarySourcesForTheNextCompile=state.getBinaryFilesToCompile(true);
      List files=state.getFilesToCompile(true);
      if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode())       if (AsmManager.attemptIncrementalModelRepairs)       AsmManager.getDefault().processDelta(files,state.addedFiles,state.deletedFiles);
      boolean hereWeGoAgain=!(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
      for (int i=0; (i < 5) && hereWeGoAgain; i++) {
        performCompilation(files);
        if (handler.hasErrors() || (progressListener != null && progressListener.isCancelledRequested())) {
          return false;
        }
        binarySourcesForTheNextCompile=state.getBinaryFilesToCompile(false);
        files=state.getFilesToCompile(false);
        hereWeGoAgain=!(files.isEmpty() && binarySourcesForTheNextCompile.isEmpty());
        if (hereWeGoAgain)         if (buildConfig.isEmacsSymMode() || buildConfig.isGenerateModelMode())         if (AsmManager.attemptIncrementalModelRepairs)         AsmManager.getDefault().processDelta(files,state.addedFiles,state.deletedFiles);
      }
      if (!files.isEmpty()) {
        return batchBuild(buildConfig,baseHandler);
      }
 else {
        if (AsmManager.isReporting())         AsmManager.getDefault().reportModelInfo("String_Node_Str");
      }
    }
    if (buildConfig.isEmacsSymMode()) {
      new org.aspectj.ajdt.internal.core.builder.EmacsStructureModelManager().externalizeModel();
    }
    state.successfulCompile(buildConfig);
    copyResourcesToDestination();
    if (buildConfig.isGenerateModelMode()) {
      AsmManager.getDefault().fireModelUpdated();
    }
  }
  finally {
    if (zos != null) {
      closeOutputStream(buildConfig.getOutputJar());
    }
    ret=!handler.hasErrors();
    bcelWorld.tidyUp();
  }
  return ret;
}