Program: 150041
Project: 150041
Buggy source:
/** 
 * Perform a per-collector collection phase.
 * @param phaseId The unique phase identifier
 * @param primary Should this thread be used to execute any single-threadedlocal operations?
 */
public void collectionPhase(int phaseId,boolean primary) throws InlinePragma {
  if (phaseId == StopTheWorld.PREPARE) {
    return;
  }
  if (phaseId == StopTheWorld.PRECOPY) {
    if (ActivePlan.constraints().movesObjects()) {
      Scanning.preCopyGCInstances(getCurrentTrace());
    }
    return;
  }
  if (phaseId == StopTheWorld.ROOTS) {
    Scanning.computeAllRoots(getCurrentTrace());
    return;
  }
  if (phaseId == StopTheWorld.SOFT_REFS) {
    if (primary && !Options.noReferenceTypes.getValue())     ReferenceProcessor.processSoftReferences(global().isCurrentGCNursery());
    return;
  }
  if (phaseId == StopTheWorld.WEAK_REFS) {
    if (primary && !Options.noReferenceTypes.getValue())     ReferenceProcessor.processWeakReferences(global().isCurrentGCNursery());
    return;
  }
  if (phaseId == StopTheWorld.FINALIZABLE) {
    if (primary) {
      if (Options.noFinalizer.getValue())       Finalizer.kill();
 else       Finalizer.moveToFinalizable(getCurrentTrace());
    }
    return;
  }
  if (phaseId == StopTheWorld.PHANTOM_REFS) {
    if (primary && !Options.noReferenceTypes.getValue())     ReferenceProcessor.processPhantomReferences(global().isCurrentGCNursery());
    return;
  }
  if (phaseId == StopTheWorld.FORWARD_REFS) {
    if (primary && !Options.noReferenceTypes.getValue() && ActivePlan.constraints().needsForwardAfterLiveness()) {
      ReferenceProcessor.forwardReferences();
    }
    return;
  }
  if (phaseId == StopTheWorld.FORWARD_FINALIZABLE) {
    if (primary && !Options.noFinalizer.getValue() && ActivePlan.constraints().needsForwardAfterLiveness()) {
      Finalizer.forward(getCurrentTrace());
    }
    return;
  }
  if (phaseId == StopTheWorld.COMPLETE) {
    return;
  }
  if (phaseId == StopTheWorld.RELEASE) {
    return;
  }
  if (Options.sanityCheck.getValue() && getSanityChecker().collectionPhase(phaseId,primary)) {
    return;
  }
  Log.write("String_Node_Str");
  Log.write(Phase.getName(phaseId));
  Log.writeln("String_Node_Str");
  Assert.fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Perform a per-collector collection phase.
 * @param phaseId The unique phase identifier
 * @param primary Should this thread be used to execute any single-threadedlocal operations?
 */
public void collectionPhase(int phaseId,boolean primary) throws InlinePragma {
  if (phaseId == StopTheWorld.INITIATE) {
    Collection.prepareCollector(this);
    return;
  }
  if (phaseId == StopTheWorld.PREPARE) {
    return;
  }
  if (phaseId == StopTheWorld.PRECOPY) {
    if (ActivePlan.constraints().movesObjects()) {
      Scanning.preCopyGCInstances(getCurrentTrace());
    }
    return;
  }
  if (phaseId == StopTheWorld.ROOTS) {
    Scanning.computeAllRoots(getCurrentTrace());
    return;
  }
  if (phaseId == StopTheWorld.SOFT_REFS) {
    if (primary && !Options.noReferenceTypes.getValue())     ReferenceProcessor.processSoftReferences(global().isCurrentGCNursery());
    return;
  }
  if (phaseId == StopTheWorld.WEAK_REFS) {
    if (primary && !Options.noReferenceTypes.getValue())     ReferenceProcessor.processWeakReferences(global().isCurrentGCNursery());
    return;
  }
  if (phaseId == StopTheWorld.FINALIZABLE) {
    if (primary) {
      if (Options.noFinalizer.getValue())       Finalizer.kill();
 else       Finalizer.moveToFinalizable(getCurrentTrace());
    }
    return;
  }
  if (phaseId == StopTheWorld.PHANTOM_REFS) {
    if (primary && !Options.noReferenceTypes.getValue())     ReferenceProcessor.processPhantomReferences(global().isCurrentGCNursery());
    return;
  }
  if (phaseId == StopTheWorld.FORWARD_REFS) {
    if (primary && !Options.noReferenceTypes.getValue() && ActivePlan.constraints().needsForwardAfterLiveness()) {
      ReferenceProcessor.forwardReferences();
    }
    return;
  }
  if (phaseId == StopTheWorld.FORWARD_FINALIZABLE) {
    if (primary && !Options.noFinalizer.getValue() && ActivePlan.constraints().needsForwardAfterLiveness()) {
      Finalizer.forward(getCurrentTrace());
    }
    return;
  }
  if (phaseId == StopTheWorld.COMPLETE) {
    return;
  }
  if (phaseId == StopTheWorld.RELEASE) {
    return;
  }
  if (Options.sanityCheck.getValue() && getSanityChecker().collectionPhase(phaseId,primary)) {
    return;
  }
  Log.write("String_Node_Str");
  Log.write(Phase.getName(phaseId));
  Log.writeln("String_Node_Str");
  Assert.fail("String_Node_Str");
}