Program: 156976
Project: 156976
Buggy source:
public static void doPopulate(World world,Random rand,int x,int z){
  BiomeGenBase biome=world.getBiomeGenForCoords(x + 16,z + 16);
  if (biome.biomeID == BiomeGenBase.sky.biomeID || biome.biomeID == BiomeGenBase.hell.biomeID) {
    return;
  }
  if (surfaceDepositBiomes.contains(biome.biomeID) && rand.nextFloat() > 0.97) {
    int startX=rand.nextInt(10) + 2;
    int startZ=rand.nextInt(10) + 2;
    for (int j=128; j > 65; --j) {
      int i=startX + x;
      int k=startZ + z;
      int blockId=world.getBlockId(i,j,k);
      if (blockId != 0 && blockId == Block.sand.blockID) {
        generateSurfaceDeposit(world,rand,i,j,k,3);
      }
      break;
    }
  }
  boolean mediumDeposit=rand.nextDouble() <= (0.15 / 100.0);
  boolean largeDeposit=rand.nextDouble() <= (0.005 / 100.0);
  if (BuildCraftCore.debugMode && x == 0 && z == 0) {
    largeDeposit=true;
  }
  if (mediumDeposit || largeDeposit) {
    int baseX=x, baseZ=z;
    int wellY=20 + rand.nextInt(10);
    int baseY;
    if (largeDeposit && (BuildCraftCore.debugMode || rand.nextDouble() <= 0.25)) {
      baseY=0;
    }
 else {
      baseY=wellY;
    }
    int radius=0;
    if (largeDeposit) {
      radius=8 + rand.nextInt(9);
    }
 else     if (mediumDeposit) {
      radius=4 + rand.nextInt(4);
    }
    int radiusSq=radius * radius;
    for (int poolX=-radius; poolX <= radius; poolX++) {
      for (int poolY=-radius; poolY <= radius; poolY++) {
        for (int poolZ=-radius; poolZ <= radius; poolZ++) {
          int distance=poolX * poolX + poolY * poolY + poolZ * poolZ;
          if (distance <= radiusSq) {
            world.setBlock(poolX + baseX,poolY + wellY,poolZ + baseZ,BuildCraftEnergy.oilStill.blockID);
          }
        }
      }
    }
    boolean started=false;
    for (int y=128; y >= baseY; --y) {
      if (started) {
        int blockId=world.getBlockId(baseX,y,baseZ);
        if (blockId == Block.bedrock.blockID) {
          world.setBlock(baseX,y,baseZ,BuildCraftCore.springBlock.blockID,1,2);
          break;
        }
        world.setBlock(baseX,y,baseZ,BuildCraftEnergy.oilStill.blockID);
      }
 else {
        int blockId=world.getBlockId(baseX,y,baseZ);
        if (blockId != 0 && blockId != Block.leaves.blockID && blockId != Block.wood.blockID && blockId != Block.grass.blockID) {
          started=true;
          if (largeDeposit) {
            generateSurfaceDeposit(world,rand,baseX,y,baseZ,20 + rand.nextInt(20));
          }
 else           if (mediumDeposit) {
            generateSurfaceDeposit(world,rand,baseX,y,baseZ,5 + rand.nextInt(5));
          }
          int ymax=0;
          if (largeDeposit) {
            ymax=(y + 30 < 128 ? y + 30 : 128);
          }
 else           if (mediumDeposit) {
            ymax=(y + 4 < 128 ? y + 4 : 128);
          }
          for (int h=y + 1; h <= ymax; ++h) {
            world.setBlock(baseX,h,baseZ,BuildCraftEnergy.oilStill.blockID);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void doPopulate(World world,Random rand,int x,int z){
  BiomeGenBase biome=world.getBiomeGenForCoords(x + 16,z + 16);
  if (biome.biomeID == BiomeGenBase.sky.biomeID || biome.biomeID == BiomeGenBase.hell.biomeID) {
    return;
  }
  if (surfaceDepositBiomes.contains(biome.biomeID) && rand.nextFloat() > 0.97) {
    int startX=rand.nextInt(10) + 2;
    int startZ=rand.nextInt(10) + 2;
    for (int j=128; j > 65; --j) {
      int i=startX + x;
      int k=startZ + z;
      int blockId=world.getBlockId(i,j,k);
      if (blockId != 0) {
        if (blockId == Block.sand.blockID) {
          generateSurfaceDeposit(world,rand,i,j,k,3);
        }
        break;
      }
    }
  }
  boolean mediumDeposit=rand.nextDouble() <= (0.15 / 100.0);
  boolean largeDeposit=rand.nextDouble() <= (0.005 / 100.0);
  if (BuildCraftCore.debugMode && x == 0 && z == 0) {
    largeDeposit=true;
  }
  if (mediumDeposit || largeDeposit) {
    int baseX=x, baseZ=z;
    int wellY=20 + rand.nextInt(10);
    int baseY;
    if (largeDeposit && (BuildCraftCore.debugMode || rand.nextDouble() <= 0.25)) {
      baseY=0;
    }
 else {
      baseY=wellY;
    }
    int radius=0;
    if (largeDeposit) {
      radius=8 + rand.nextInt(9);
    }
 else     if (mediumDeposit) {
      radius=4 + rand.nextInt(4);
    }
    int radiusSq=radius * radius;
    for (int poolX=-radius; poolX <= radius; poolX++) {
      for (int poolY=-radius; poolY <= radius; poolY++) {
        for (int poolZ=-radius; poolZ <= radius; poolZ++) {
          int distance=poolX * poolX + poolY * poolY + poolZ * poolZ;
          if (distance <= radiusSq) {
            world.setBlock(poolX + baseX,poolY + wellY,poolZ + baseZ,BuildCraftEnergy.oilStill.blockID);
          }
        }
      }
    }
    boolean started=false;
    for (int y=128; y >= baseY; --y) {
      if (started) {
        int blockId=world.getBlockId(baseX,y,baseZ);
        if (blockId == Block.bedrock.blockID) {
          world.setBlock(baseX,y,baseZ,BuildCraftCore.springBlock.blockID,1,2);
          break;
        }
        world.setBlock(baseX,y,baseZ,BuildCraftEnergy.oilStill.blockID);
      }
 else {
        int blockId=world.getBlockId(baseX,y,baseZ);
        if (blockId != 0 && blockId != Block.leaves.blockID && blockId != Block.wood.blockID && blockId != Block.grass.blockID) {
          started=true;
          if (largeDeposit) {
            generateSurfaceDeposit(world,rand,baseX,y,baseZ,20 + rand.nextInt(20));
          }
 else           if (mediumDeposit) {
            generateSurfaceDeposit(world,rand,baseX,y,baseZ,5 + rand.nextInt(5));
          }
          int ymax=0;
          if (largeDeposit) {
            ymax=(y + 30 < 128 ? y + 30 : 128);
          }
 else           if (mediumDeposit) {
            ymax=(y + 4 < 128 ? y + 4 : 128);
          }
          for (int h=y + 1; h <= ymax; ++h) {
            world.setBlock(baseX,h,baseZ,BuildCraftEnergy.oilStill.blockID);
          }
        }
      }
    }
  }
}