Program: 22839
Project: 22839
Buggy source:
public void Finalize() throws CarriageMotionException {
  for (  BlockRecord PotentialObstruction : PotentialObstructions) {
    AssertNotObstruction(PotentialObstruction);
  }
  long WorldTime=World.getWorldInfo().getWorldTotalTime();
  try {
    TreeSet<NextTickListEntry> ticks=(TreeSet<NextTickListEntry>)Reflection.get(WorldServer.class,World,"String_Node_Str");
    java.util.Iterator PendingBlockUpdateSetIterator=ticks.iterator();
    while (PendingBlockUpdateSetIterator.hasNext()) {
      NextTickListEntry PendingBlockUpdate=(net.minecraft.world.NextTickListEntry)PendingBlockUpdateSetIterator.next();
      if (Body.contains(new BlockRecord(PendingBlockUpdate.xCoord,PendingBlockUpdate.yCoord,PendingBlockUpdate.zCoord))) {
        PendingBlockUpdateSetIterator.remove();
        ticks.remove(PendingBlockUpdate);
        StorePendingBlockUpdateRecord(PendingBlockUpdate,WorldTime);
      }
    }
  }
 catch (  Throwable VanillaThrowable) {
    if (VanillaThrowable instanceof ThreadDeath) {
      throw ((ThreadDeath)VanillaThrowable);
    }
    try {
      java.util.Set PendingBlockUpdateSet=(java.util.Set)ModInteraction.PendingBlockUpdateSetField.get(World);
      while (true) {
        net.minecraft.world.NextTickListEntry PendingBlockUpdate=null;
        for (        Object Target : PendingBlockUpdateSet) {
          net.minecraft.world.NextTickListEntry TargetPendingBlockUpdate=(net.minecraft.world.NextTickListEntry)Target;
          if (Body.contains(new BlockRecord(TargetPendingBlockUpdate.xCoord,TargetPendingBlockUpdate.yCoord,TargetPendingBlockUpdate.zCoord))) {
            PendingBlockUpdate=TargetPendingBlockUpdate;
            break;
          }
        }
        if (PendingBlockUpdate == null) {
          break;
        }
        StorePendingBlockUpdateRecord(PendingBlockUpdate,WorldTime);
        ModInteraction.RemovePendingBlockUpdate.invoke(World,PendingBlockUpdate);
      }
    }
 catch (    Throwable McpcThrowable) {
      McpcThrowable.printStackTrace();
      VanillaThrowable.printStackTrace();
    }
  }
  if (Configuration.HardmodeActive) {
    for (    BlockRecord CarriageRecord : Carriages) {
      int Tier=((CarriageEntity)CarriageRecord.Entity).Tier;
      double Factor=Carriage.Tiers.values()[Tier].CargoBurdenFactor;
      if (Tier == 0) {
        for (        Directions Direction : Directions.values()) {
          BlockRecord Position=CarriageRecord.NextInDirection(Direction);
          ApplyCargoBurdenFactor(Position,Factor);
        }
      }
 else {
        for (int Distance=1; Distance <= Tier; Distance++, Factor=Math.sqrt(Factor)) {
          int MinX=CarriageRecord.X - Distance;
          int MinY=CarriageRecord.Y - Distance;
          int MinZ=CarriageRecord.Z - Distance;
          int MaxX=CarriageRecord.X + Distance;
          int MaxY=CarriageRecord.Y + Distance;
          int MaxZ=CarriageRecord.Z + Distance;
          for (int X=MinX; X <= MaxX; X++) {
            for (int Y=MinY; Y <= MaxY; Y++) {
              for (int Z=MinZ; Z <= MaxZ; Z++) {
                if ((X == MinX) || (X == MaxX) || (Y == MinY)|| (Y == MaxY)|| (Z == MinZ)|| (Z == MaxZ)) {
                  ApplyCargoBurdenFactor(new BlockRecord(X,Y,Z),Factor);
                }
              }
            }
          }
        }
      }
    }
    for (    BlockRecord CargoRecord : Cargo) {
      Double BurdenFactor=CargoBurdenFactors.get(CargoRecord);
      double Burden=GetBaseBurden(CargoRecord);
      if (BurdenFactor == null) {
        Mass+=Burden;
      }
 else {
        Mass+=Burden * BurdenFactor;
      }
    }
  }
  PotentialObstructions=null;
  Carriages=null;
  Cargo=null;
  CargoBurdenFactors=null;
}

Fixed version (ground truth):
public void Finalize() throws CarriageMotionException {
  Debug.dbg("String_Node_Str");
  for (  BlockRecord PotentialObstruction : PotentialObstructions) {
    Debug.dbg("String_Node_Str" + PotentialObstruction);
    AssertNotObstruction(PotentialObstruction);
  }
  Debug.dbg("String_Node_Str");
  long WorldTime=World.getWorldInfo().getWorldTotalTime();
  try {
    TreeSet<NextTickListEntry> ticks=(TreeSet<NextTickListEntry>)Reflection.get(WorldServer.class,World,"String_Node_Str");
    java.util.Iterator PendingBlockUpdateSetIterator=ticks.iterator();
    while (PendingBlockUpdateSetIterator.hasNext()) {
      NextTickListEntry PendingBlockUpdate=(net.minecraft.world.NextTickListEntry)PendingBlockUpdateSetIterator.next();
      if (Body.contains(new BlockRecord(PendingBlockUpdate.xCoord,PendingBlockUpdate.yCoord,PendingBlockUpdate.zCoord))) {
        PendingBlockUpdateSetIterator.remove();
        ticks.remove(PendingBlockUpdate);
        StorePendingBlockUpdateRecord(PendingBlockUpdate,WorldTime);
      }
    }
  }
 catch (  Throwable VanillaThrowable) {
    if (VanillaThrowable instanceof ThreadDeath) {
      throw ((ThreadDeath)VanillaThrowable);
    }
    try {
      java.util.Set PendingBlockUpdateSet=(java.util.Set)ModInteraction.PendingBlockUpdateSetField.get(World);
      while (true) {
        net.minecraft.world.NextTickListEntry PendingBlockUpdate=null;
        for (        Object Target : PendingBlockUpdateSet) {
          net.minecraft.world.NextTickListEntry TargetPendingBlockUpdate=(net.minecraft.world.NextTickListEntry)Target;
          if (Body.contains(new BlockRecord(TargetPendingBlockUpdate.xCoord,TargetPendingBlockUpdate.yCoord,TargetPendingBlockUpdate.zCoord))) {
            PendingBlockUpdate=TargetPendingBlockUpdate;
            break;
          }
        }
        if (PendingBlockUpdate == null) {
          break;
        }
        StorePendingBlockUpdateRecord(PendingBlockUpdate,WorldTime);
        ModInteraction.RemovePendingBlockUpdate.invoke(World,PendingBlockUpdate);
      }
    }
 catch (    Throwable McpcThrowable) {
      McpcThrowable.printStackTrace();
      VanillaThrowable.printStackTrace();
    }
  }
  if (Configuration.HardmodeActive) {
    for (    BlockRecord CarriageRecord : Carriages) {
      int Tier=((CarriageEntity)CarriageRecord.Entity).Tier;
      double Factor=Carriage.Tiers.values()[Tier].CargoBurdenFactor;
      if (Tier == 0) {
        for (        Directions Direction : Directions.values()) {
          BlockRecord Position=CarriageRecord.NextInDirection(Direction);
          ApplyCargoBurdenFactor(Position,Factor);
        }
      }
 else {
        for (int Distance=1; Distance <= Tier; Distance++, Factor=Math.sqrt(Factor)) {
          int MinX=CarriageRecord.X - Distance;
          int MinY=CarriageRecord.Y - Distance;
          int MinZ=CarriageRecord.Z - Distance;
          int MaxX=CarriageRecord.X + Distance;
          int MaxY=CarriageRecord.Y + Distance;
          int MaxZ=CarriageRecord.Z + Distance;
          for (int X=MinX; X <= MaxX; X++) {
            for (int Y=MinY; Y <= MaxY; Y++) {
              for (int Z=MinZ; Z <= MaxZ; Z++) {
                if ((X == MinX) || (X == MaxX) || (Y == MinY)|| (Y == MaxY)|| (Z == MinZ)|| (Z == MaxZ)) {
                  ApplyCargoBurdenFactor(new BlockRecord(X,Y,Z),Factor);
                }
              }
            }
          }
        }
      }
    }
    for (    BlockRecord CargoRecord : Cargo) {
      Double BurdenFactor=CargoBurdenFactors.get(CargoRecord);
      double Burden=GetBaseBurden(CargoRecord);
      if (BurdenFactor == null) {
        Mass+=Burden;
      }
 else {
        Mass+=Burden * BurdenFactor;
      }
    }
  }
  PotentialObstructions=null;
  Carriages=null;
  Cargo=null;
  CargoBurdenFactors=null;
}