Program: 156975
Project: 156975
Buggy source:
public static void doPopulate(World world,Random rand,int x,int z){
  BiomeGenBase biome=world.getBiomeGenForCoords(x + 16,z + 16);
  if (excludedBiomes.contains(biome.biomeID)) {
    return;
  }
  if (surfaceDepositBiomes.contains(biome.biomeID) && rand.nextFloat() > 0.97) {
    int lakeX=rand.nextInt(10) + 2 + x;
    int lakeY=world.getTopSolidOrLiquidBlock(x,z) - 1;
    int lakeZ=rand.nextInt(10) + 2 + z;
    int blockId=world.getBlockId(lakeX,lakeY,lakeZ);
    if (blockId == biome.topBlock) {
      generateSurfaceDeposit(world,rand,lakeX,lakeY,lakeZ,3);
    }
  }
  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);
        Block block=Block.blocksList[blockId];
        if (blockId != 0 && !block.isLeaves(world,baseX,y,baseZ) && !block.isWood(world,baseX,y,baseZ)) {
          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 (excludedBiomes.contains(biome.biomeID)) {
    return;
  }
  if (surfaceDepositBiomes.contains(biome.biomeID) && rand.nextFloat() > 0.97) {
    int lakeX=rand.nextInt(10) + 2 + x;
    int lakeZ=rand.nextInt(10) + 2 + z;
    int lakeY=world.getTopSolidOrLiquidBlock(lakeX,lakeZ) - 1;
    int blockId=world.getBlockId(lakeX,lakeY,lakeZ);
    if (blockId == biome.topBlock) {
      generateSurfaceDeposit(world,rand,lakeX,lakeY,lakeZ,3);
    }
  }
  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);
        Block block=Block.blocksList[blockId];
        if (blockId != 0 && !block.isLeaves(world,baseX,y,baseZ) && !block.isWood(world,baseX,y,baseZ)) {
          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);
          }
        }
      }
    }
  }
}