Program: 142475
Project: 142475
Buggy source:
/** 
 * This method does the actual polling and returns a PollingResult. The change attribute of the PollingResult the significance of the changes detected by this poll.
 */
@Override public PollingResult compareRemoteRevisionWith(Job<?,?> job,Launcher launcher,FilePath buildWorkspace,TaskListener listener,SCMRevisionState baseline) throws IOException, InterruptedException {
  PollingResult state=PollingResult.NO_CHANGES;
  Node node=workspaceToNode(buildWorkspace);
  if (buildWorkspace == null || FilterPollMasterImpl.isMasterPolling(filter)) {
    buildWorkspace=Jenkins.getInstance().getRootPath();
    TagAction action=job.getLastBuild().getAction(TagAction.class);
    P4Revision last=action.getBuildChange();
    FilterPollMasterImpl pollM=FilterPollMasterImpl.findSelf(filter);
    pollM.setLastChange(last);
  }
  if (job.isBuilding()) {
    listener.getLogger().println("String_Node_Str");
    return PollingResult.NO_CHANGES;
  }
  if (job instanceof MatrixProject) {
    if (isBuildParent(job)) {
      EnvVars envVars=job.getEnvironment(node,listener);
      state=pollWorkspace(envVars,listener,buildWorkspace);
    }
 else {
      MatrixProject matrixProj=(MatrixProject)job;
      Collection<MatrixConfiguration> configs=matrixProj.getActiveConfigurations();
      for (      MatrixConfiguration config : configs) {
        EnvVars envVars=config.getEnvironment(node,listener);
        state=pollWorkspace(envVars,listener,buildWorkspace);
        if (state == PollingResult.BUILD_NOW) {
          return PollingResult.BUILD_NOW;
        }
      }
    }
  }
 else {
    EnvVars envVars=job.getEnvironment(node,listener);
    state=pollWorkspace(envVars,listener,buildWorkspace);
  }
  return state;
}

Fixed version (ground truth):
/** 
 * This method does the actual polling and returns a PollingResult. The change attribute of the PollingResult the significance of the changes detected by this poll.
 */
@Override public PollingResult compareRemoteRevisionWith(Job<?,?> job,Launcher launcher,FilePath buildWorkspace,TaskListener listener,SCMRevisionState baseline) throws IOException, InterruptedException {
  PollingResult state=PollingResult.NO_CHANGES;
  Node node=workspaceToNode(buildWorkspace);
  if (buildWorkspace == null || FilterPollMasterImpl.isMasterPolling(filter)) {
    Jenkins j=Jenkins.getInstance();
    if (j == null) {
      return PollingResult.NO_CHANGES;
    }
    buildWorkspace=j.getRootPath();
    TagAction action=job.getLastBuild().getAction(TagAction.class);
    P4Revision last=action.getBuildChange();
    FilterPollMasterImpl pollM=FilterPollMasterImpl.findSelf(filter);
    pollM.setLastChange(last);
  }
  if (job.isBuilding()) {
    listener.getLogger().println("String_Node_Str");
    return PollingResult.NO_CHANGES;
  }
  if (job instanceof MatrixProject) {
    if (isBuildParent(job)) {
      EnvVars envVars=job.getEnvironment(node,listener);
      state=pollWorkspace(envVars,listener,buildWorkspace);
    }
 else {
      MatrixProject matrixProj=(MatrixProject)job;
      Collection<MatrixConfiguration> configs=matrixProj.getActiveConfigurations();
      for (      MatrixConfiguration config : configs) {
        EnvVars envVars=config.getEnvironment(node,listener);
        state=pollWorkspace(envVars,listener,buildWorkspace);
        if (state == PollingResult.BUILD_NOW) {
          return PollingResult.BUILD_NOW;
        }
      }
    }
  }
 else {
    EnvVars envVars=job.getEnvironment(node,listener);
    state=pollWorkspace(envVars,listener,buildWorkspace);
  }
  return state;
}