Program: 7232
Project: 7232
Buggy source:
/** 
 * Overridden checkout function This is the real invocation of this plugin. Currently, we will do a project info and determine the true nature of the project Subsequent to that we will run a view project command and cache the information on each member, so that we can execute project checkout commands.  This obviously eliminates the need for a sandbox and can wily nilly delete the workspace directory as needed
 * @see hudson.scm.SCM#checkout(hudson.model.AbstractBuild,hudson.Launcher,hudson.FilePath,hudson.model.BuildListener,java.io.File)
 */
@Override public boolean checkout(AbstractBuild<?,?> build,Launcher launcher,FilePath workspace,BuildListener listener,File changeLogFile) throws IOException, InterruptedException {
  LOGGER.fine("String_Node_Str");
  String resolvedConfigPath=IntegrityCheckpointAction.evalGroovyExpression(build.getEnvironment(listener),configPath);
  listener.getLogger().println("String_Node_Str" + ciServerURL + build.getUrl()+ "String_Node_Str");
  listener.getLogger().println("String_Node_Str" + ciServerURL + build.getUrl()+ "String_Node_Str");
  IntegrityConfigurable desSettings=DescriptorImpl.INTEGRITY_DESCRIPTOR.getConfiguration(serverConfig);
  IntegrityConfigurable coSettings=new IntegrityConfigurable("String_Node_Str",desSettings.getIpHostName(),desSettings.getIpPort(),desSettings.getHostName(),desSettings.getPort(),desSettings.getSecure(),userName,password.getPlainText());
  APISession api=APISession.create(coSettings);
  if (null == api) {
    listener.getLogger().println("String_Node_Str");
    return false;
  }
  PrintWriter writer=new PrintWriter(new OutputStreamWriter(new FileOutputStream(changeLogFile),"String_Node_Str"));
  try {
    String projectCacheTable=DerbyUtils.registerProjectCache(((DescriptorImpl)this.getDescriptor()).getDataSource(),((AbstractProject<?,?>)build.getProject()).getName(),configurationName,build.getNumber());
    listener.getLogger().println("String_Node_Str" + resolvedConfigPath);
    initializeCMProject(api,projectCacheTable,resolvedConfigPath);
    IntegrityCMProject siProject=getIntegrityProject();
    if (checkpointBeforeBuild) {
      if (!siProject.isBuild()) {
        listener.getLogger().println("String_Node_Str" + siProject.getConfigurationPath());
        Response res=siProject.checkpoint(api,IntegrityCheckpointAction.evalGroovyExpression(build.getEnvironment(listener),checkpointLabel));
        LOGGER.fine(res.getCommandString() + "String_Node_Str" + res.getExitCode());
        WorkItem wi=res.getWorkItem(siProject.getConfigurationPath());
        String chkpt=wi.getResult().getField("String_Node_Str").getItem().getId();
        listener.getLogger().println("String_Node_Str" + siProject.getConfigurationPath() + "String_Node_Str"+ chkpt);
        Command siProjectInfoCmd=new Command(Command.SI,"String_Node_Str");
        siProjectInfoCmd.addOption(new Option("String_Node_Str",siProject.getConfigurationPath() + "String_Node_Str" + chkpt));
        Response infoRes=api.runCommand(siProjectInfoCmd);
        siProject.initializeProject(infoRes.getWorkItems().next());
      }
 else {
        listener.getLogger().println("String_Node_Str");
      }
    }
    listener.getLogger().println("String_Node_Str" + siProject.getConfigurationPath());
    initializeCMProjectMembers(api);
    AbstractBuild<?,?> previousBuild=build.getPreviousBuild();
    String prevProjectCache=null;
    while (null != previousBuild) {
      prevProjectCache=DerbyUtils.getProjectCache(((DescriptorImpl)this.getDescriptor()).getDataSource(),((AbstractProject<?,?>)build.getProject()).getName(),configurationName,previousBuild.getNumber());
      if (null != prevProjectCache && prevProjectCache.length() > 0) {
        LOGGER.fine("String_Node_Str" + previousBuild.getNumber());
        break;
      }
      previousBuild=previousBuild.getPreviousBuild();
    }
    if (null != prevProjectCache && prevProjectCache.length() > 0) {
      DerbyUtils.compareBaseline(prevProjectCache,projectCacheTable,skipAuthorInfo,api);
    }
 else {
      LOGGER.fine("String_Node_Str");
      if (!skipAuthorInfo) {
        DerbyUtils.primeAuthorInformation(projectCacheTable,api);
      }
    }
    List<Hashtable<CM_PROJECT,Object>> projectMembersList=DerbyUtils.viewProject(projectCacheTable);
    List<String> dirList=DerbyUtils.getDirList(projectCacheTable);
    IntegrityCheckoutTask coTask=null;
    if (null == prevProjectCache || prevProjectCache.length() == 0) {
      coTask=new IntegrityCheckoutTask(projectMembersList,dirList,alternateWorkspace,lineTerminator,restoreTimestamp,true,fetchChangedWorkspaceFiles,checkoutThreadPoolSize,listener,((DescriptorImpl)this.getDescriptor()).getConfiguration(serverConfig));
    }
 else {
      coTask=new IntegrityCheckoutTask(projectMembersList,dirList,alternateWorkspace,lineTerminator,restoreTimestamp,cleanCopy,fetchChangedWorkspaceFiles,checkoutThreadPoolSize,listener,((DescriptorImpl)this.getDescriptor()).getConfiguration(serverConfig));
    }
    if (workspace.act(coTask)) {
      listener.getLogger().println("String_Node_Str");
      if (fetchChangedWorkspaceFiles) {
        DerbyUtils.updateChecksum(projectCacheTable,coTask.getChecksumUpdates());
      }
      listener.getLogger().println("String_Node_Str");
      writer.println(siProject.getChangeLog(String.valueOf(build.getNumber()),projectMembersList));
      listener.getLogger().println("String_Node_Str" + changeLogFile.getAbsolutePath());
      if (deleteNonMembers) {
        IntegrityDeleteNonMembersTask deleteNonMembers=new IntegrityDeleteNonMembersTask(build,listener,alternateWorkspace,getIntegrityProject());
        if (!workspace.act(deleteNonMembers)) {
          return false;
        }
      }
    }
 else {
      return false;
    }
  }
 catch (  APIException aex) {
    LOGGER.severe("String_Node_Str");
    listener.getLogger().println("String_Node_Str");
    ExceptionHandler eh=new ExceptionHandler(aex);
    LOGGER.severe(eh.getMessage());
    listener.getLogger().println(eh.getMessage());
    LOGGER.fine(eh.getCommand() + "String_Node_Str" + eh.getExitCode());
    listener.getLogger().println(eh.getCommand() + "String_Node_Str" + eh.getExitCode());
    return false;
  }
catch (  SQLException sqlex) {
    LOGGER.severe("String_Node_Str");
    listener.getLogger().println("String_Node_Str");
    listener.getLogger().println(sqlex.getMessage());
    LOGGER.log(Level.SEVERE,"String_Node_Str",sqlex);
    return false;
  }
 finally {
    if (writer != null) {
      writer.close();
    }
    api.Terminate();
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Overridden checkout function This is the real invocation of this plugin. Currently, we will do a project info and determine the true nature of the project Subsequent to that we will run a view project command and cache the information on each member, so that we can execute project checkout commands.  This obviously eliminates the need for a sandbox and can wily nilly delete the workspace directory as needed
 * @see hudson.scm.SCM#checkout(hudson.model.AbstractBuild,hudson.Launcher,hudson.FilePath,hudson.model.BuildListener,java.io.File)
 */
@Override public boolean checkout(AbstractBuild<?,?> build,Launcher launcher,FilePath workspace,BuildListener listener,File changeLogFile) throws IOException, InterruptedException {
  LOGGER.fine("String_Node_Str");
  String resolvedConfigPath=IntegrityCheckpointAction.evalGroovyExpression(build.getEnvironment(listener),configPath);
  listener.getLogger().println("String_Node_Str" + ciServerURL + build.getUrl()+ "String_Node_Str");
  listener.getLogger().println("String_Node_Str" + ciServerURL + build.getUrl()+ "String_Node_Str");
  IntegrityConfigurable desSettings=DescriptorImpl.INTEGRITY_DESCRIPTOR.getConfiguration(serverConfig);
  IntegrityConfigurable coSettings=new IntegrityConfigurable("String_Node_Str",desSettings.getIpHostName(),desSettings.getIpPort(),desSettings.getHostName(),desSettings.getPort(),desSettings.getSecure(),userName,password.getPlainText());
  APISession api=APISession.create(coSettings);
  if (null == api) {
    listener.getLogger().println("String_Node_Str");
    return false;
  }
  PrintWriter writer=new PrintWriter(new OutputStreamWriter(new FileOutputStream(changeLogFile),"String_Node_Str"));
  try {
    String projectCacheTable=DerbyUtils.registerProjectCache(((DescriptorImpl)this.getDescriptor()).getDataSource(),((AbstractProject<?,?>)build.getProject()).getName(),configurationName,build.getNumber());
    listener.getLogger().println("String_Node_Str" + resolvedConfigPath);
    initializeCMProject(api,projectCacheTable,resolvedConfigPath);
    IntegrityCMProject siProject=getIntegrityProject();
    if (checkpointBeforeBuild) {
      if (!siProject.isBuild()) {
        listener.getLogger().println("String_Node_Str" + siProject.getConfigurationPath());
        Response res=siProject.checkpoint(api,IntegrityCheckpointAction.evalGroovyExpression(build.getEnvironment(listener),checkpointLabel));
        LOGGER.fine(res.getCommandString() + "String_Node_Str" + res.getExitCode());
        WorkItem wi=res.getWorkItem(siProject.getConfigurationPath());
        String chkpt=wi.getResult().getField("String_Node_Str").getItem().getId();
        listener.getLogger().println("String_Node_Str" + siProject.getConfigurationPath() + "String_Node_Str"+ chkpt);
        Command siProjectInfoCmd=new Command(Command.SI,"String_Node_Str");
        siProjectInfoCmd.addOption(new Option("String_Node_Str",siProject.getConfigurationPath() + "String_Node_Str" + chkpt));
        Response infoRes=api.runCommand(siProjectInfoCmd);
        siProject.initializeProject(infoRes.getWorkItems().next());
      }
 else {
        listener.getLogger().println("String_Node_Str");
      }
    }
    listener.getLogger().println("String_Node_Str" + siProject.getConfigurationPath());
    initializeCMProjectMembers(api);
    AbstractBuild<?,?> previousBuild=build.getPreviousBuild();
    String prevProjectCache=null;
    while (null != previousBuild) {
      prevProjectCache=DerbyUtils.getProjectCache(((DescriptorImpl)this.getDescriptor()).getDataSource(),((AbstractProject<?,?>)build.getProject()).getName(),configurationName,previousBuild.getNumber());
      if (null != prevProjectCache && prevProjectCache.length() > 0) {
        LOGGER.fine("String_Node_Str" + previousBuild.getNumber());
        break;
      }
      previousBuild=previousBuild.getPreviousBuild();
    }
    if (null != prevProjectCache && prevProjectCache.length() > 0) {
      DerbyUtils.compareBaseline(prevProjectCache,projectCacheTable,skipAuthorInfo,api);
    }
 else {
      LOGGER.fine("String_Node_Str");
      if (!skipAuthorInfo) {
        DerbyUtils.primeAuthorInformation(projectCacheTable,api);
      }
    }
    List<Hashtable<CM_PROJECT,Object>> projectMembersList=DerbyUtils.viewProject(projectCacheTable);
    List<String> dirList=DerbyUtils.getDirList(projectCacheTable);
    IntegrityCheckoutTask coTask=null;
    if (null == prevProjectCache || prevProjectCache.length() == 0) {
      coTask=new IntegrityCheckoutTask(projectMembersList,dirList,alternateWorkspace,lineTerminator,restoreTimestamp,true,fetchChangedWorkspaceFiles,checkoutThreadPoolSize,listener,coSettings);
    }
 else {
      coTask=new IntegrityCheckoutTask(projectMembersList,dirList,alternateWorkspace,lineTerminator,restoreTimestamp,cleanCopy,fetchChangedWorkspaceFiles,checkoutThreadPoolSize,listener,coSettings);
    }
    if (workspace.act(coTask)) {
      listener.getLogger().println("String_Node_Str");
      if (fetchChangedWorkspaceFiles) {
        DerbyUtils.updateChecksum(projectCacheTable,coTask.getChecksumUpdates());
      }
      listener.getLogger().println("String_Node_Str");
      writer.println(siProject.getChangeLog(String.valueOf(build.getNumber()),projectMembersList));
      listener.getLogger().println("String_Node_Str" + changeLogFile.getAbsolutePath());
      if (deleteNonMembers) {
        IntegrityDeleteNonMembersTask deleteNonMembers=new IntegrityDeleteNonMembersTask(build,listener,alternateWorkspace,getIntegrityProject());
        if (!workspace.act(deleteNonMembers)) {
          return false;
        }
      }
    }
 else {
      return false;
    }
  }
 catch (  APIException aex) {
    LOGGER.severe("String_Node_Str");
    listener.getLogger().println("String_Node_Str");
    ExceptionHandler eh=new ExceptionHandler(aex);
    LOGGER.severe(eh.getMessage());
    listener.getLogger().println(eh.getMessage());
    LOGGER.fine(eh.getCommand() + "String_Node_Str" + eh.getExitCode());
    listener.getLogger().println(eh.getCommand() + "String_Node_Str" + eh.getExitCode());
    return false;
  }
catch (  SQLException sqlex) {
    LOGGER.severe("String_Node_Str");
    listener.getLogger().println("String_Node_Str");
    listener.getLogger().println(sqlex.getMessage());
    LOGGER.log(Level.SEVERE,"String_Node_Str",sqlex);
    return false;
  }
 finally {
    if (writer != null) {
      writer.close();
    }
    api.Terminate();
  }
  return true;
}