Program: 174506
Project: 174506
Buggy source:
public static InjectorResult create(World world,BlockPos pos,boolean drain){
  HashMap<Class<EntityGem>,Double> resultTable=new HashMap<Class<EntityGem>,Double>();
  HashMap<Class<EntityGem>,Double> defectivity=new HashMap<Class<EntityGem>,Double>();
  HashMap<Class<EntityGem>,Double> friction=new HashMap<Class<EntityGem>,Double>();
  float drainedCount=0F;
  float baseMinerals=0F;
  boolean drainedChecked=false;
  System.out.println("String_Node_Str");
  for (  String gemType : ModEntities.GEMS.keySet()) {
    Class<EntityGem> gemClass=null;
    HashMap<IBlockState,Double> yield=null;
    double defectivityMultiplier=1.0F;
    boolean fieldFound=false;
    try {
      gemClass=(Class<EntityGem>)ModEntities.GEMS.get(gemType);
      yield=(HashMap<IBlockState,Double>)gemClass.getField((gemType + "String_Node_Str").toUpperCase()).get(null);
      defectivityMultiplier=(double)gemClass.getField((gemType + "String_Node_Str").toUpperCase()).get(null);
      fieldFound=true;
    }
 catch (    Exception e) {
    }
    if (fieldFound) {
      try {
        double pressureFactor=1.0;
        double depthFactor=1.0;
        if (world.provider.isSurfaceWorld()) {
          try {
            depthFactor=(double)gemClass.getField((gemType + "String_Node_Str").toUpperCase()).get(null);
            if (depthFactor > 0) {
              pressureFactor=depthFactor / pos.getY();
              depthFactor=Math.min(1.0,pressureFactor);
            }
 else {
              depthFactor=1.0;
            }
          }
 catch (          Exception e) {
          }
        }
        double defectivityRate=1.0;
        double frictionFactor=0.0;
        for (int x=-4; x <= 4; ++x) {
          for (int y=-4; y <= 4; ++y) {
            for (int z=-4; z <= 4; ++z) {
              BlockPos ore=pos.add(x,y,z);
              IBlockState state=world.getBlockState(ore);
              try {
                if (!resultTable.containsKey(gemClass)) {
                  resultTable.put(gemClass,0.0);
                }
                if (yield.containsKey(state)) {
                  double result=yield.get(state);
                  if (result < 1.98) {
                    result*=depthFactor;
                  }
                  resultTable.put(gemClass,resultTable.get(gemClass) + result);
                  frictionFactor+=0.0036;
                  defectivityRate-=0.2;
                }
 else {
                  ItemStack stack=new ItemStack(state.getBlock(),1,state.getBlock().getMetaFromState(state));
                  if (!stack.isEmpty()) {
                    int[] oreIDs=OreDictionary.getOreIDs(stack);
                    for (                    int oreID : oreIDs) {
                      if (OreDictionary.getOreName(oreID).startsWith("String_Node_Str") || OreDictionary.getOreName(oreID).startsWith("String_Node_Str")) {
                        defectivityRate-=0.2;
                      }
                    }
                  }
                }
                if (!drainedChecked) {
                  Block block=state.getBlock();
                  if (block == ModBlocks.DRAINED_BLOCK || block == Blocks.GRAVEL || block == Blocks.AIR) {
                    drainedCount+=1;
                  }
                }
                if (state.getMaterial() == Material.GRASS) {
                  defectivityRate-=0.4;
                  if (!drainedChecked) {
                    baseMinerals+=1;
                  }
                }
 else                 if (state.getMaterial() == Material.SAND || state.getMaterial() == Material.GROUND) {
                  defectivityRate-=0.1;
                }
              }
 catch (              Exception e) {
                KAGIC.instance.chatInfoMessage("String_Node_Str" + state.getBlock().getUnlocalizedName() + "String_Node_Str");
              }
            }
          }
        }
        drainedChecked=true;
        defectivity.put(gemClass,Math.max(0.0,defectivityRate * defectivityMultiplier));
        resultTable.put(gemClass,resultTable.get(gemClass));
        friction.put(gemClass,frictionFactor * pressureFactor);
        System.out.println(gemType + "String_Node_Str" + resultTable.get(gemClass)+ "String_Node_Str"+ defectivity.get(gemClass)+ "String_Node_Str"+ friction.get(gemClass)+ "String_Node_Str"+ depthFactor);
      }
 catch (      Exception e) {
        System.out.println(gemType + "String_Node_Str");
        e.printStackTrace();
      }
    }
  }
  boolean canSpawnGem=false;
  Class<? extends EntityGem> mostLikelyGem=null;
  double highestYield=0.0;
  for (  Class<EntityGem> gemClass : resultTable.keySet()) {
    if (!gemClass.getName().contains("String_Node_Str")) {
      boolean forget=world.rand.nextBoolean();
      if (resultTable.get(gemClass) > 0.1 && world.rand.nextInt((int)(resultTable.get(gemClass) * 10) + 1) == 0) {
        highestYield=resultTable.get(gemClass);
        mostLikelyGem=gemClass;
        canSpawnGem=true;
      }
 else {
        double result=resultTable.get(gemClass);
        if (result == highestYield && result > 0) {
          highestYield=forget ? resultTable.get(gemClass) : highestYield;
          mostLikelyGem=forget ? gemClass : mostLikelyGem;
          canSpawnGem=true;
        }
 else         if (result > highestYield && result > 0) {
          highestYield=resultTable.get(gemClass);
          mostLikelyGem=gemClass;
          canSpawnGem=true;
        }
      }
    }
  }
  boolean mineralSpawned=false;
  if (highestYield <= 0.0 && (drainedCount - baseMinerals) / (9F * 9F * 9F) < InjectorResult.drainedPercentage) {
    ChunkPos c=world.getChunkFromBlockCoords(pos).getPos();
    int chunkPos=(c.x + c.z) % ModEntities.MINERALS.size();
    mostLikelyGem=ModEntities.MINERALS.get(Math.abs(chunkPos));
    mineralSpawned=true;
    canSpawnGem=true;
  }
  EntityGem gemSpawned=null;
  if (canSpawnGem) {
    try {
      gemSpawned=(EntityGem)(mostLikelyGem.getConstructors()[0].newInstance(world));
    }
 catch (    Exception e) {
      e.printStackTrace();
      System.out.println("String_Node_Str" + e.getMessage());
      canSpawnGem=false;
    }
  }
  ExitHole exitHole=null;
  if (drain && gemSpawned != null) {
    Double gemFriction=friction.get(gemSpawned.getClass());
    if (gemFriction == null) {
      gemFriction=0.0;
    }
    exitHole=ExitHole.create(world,pos,Math.ceil(gemSpawned.height),gemFriction >= 1.0F);
    exitHole.emerge(world);
    gemSpawned.setPosition(pos.getX() + 0.5,pos.getY(),pos.getZ() + 0.5);
  }
  if (drain) {
    for (int x=-4; x <= 4; ++x) {
      for (int y=-4; y <= 4; ++y) {
        for (int z=-4; z <= 4; ++z) {
          if (world.rand.nextBoolean()) {
            BlockPos ore=pos.add(x,y,z);
            drainBlock(world,ore);
          }
        }
      }
    }
  }
  return new InjectorResult(gemSpawned,pos,mineralSpawned ? 1.0 : (gemSpawned == null ? 0.0 : defectivity.get(gemSpawned.getClass())),!canSpawnGem,canSpawnGem ? friction.get(gemSpawned.getClass()) >= 1.0F : false,exitHole);
}

Fixed version (ground truth):
public static InjectorResult create(World world,BlockPos pos,boolean drain){
  HashMap<Class<EntityGem>,Double> resultTable=new HashMap<Class<EntityGem>,Double>();
  HashMap<Class<EntityGem>,Double> defectivity=new HashMap<Class<EntityGem>,Double>();
  HashMap<Class<EntityGem>,Double> friction=new HashMap<Class<EntityGem>,Double>();
  float drainedCount=0F;
  float baseMinerals=0F;
  boolean drainedChecked=false;
  System.out.println("String_Node_Str");
  for (  String gemType : ModEntities.GEMS.keySet()) {
    Class<EntityGem> gemClass=null;
    HashMap<IBlockState,Double> yield=null;
    double defectivityMultiplier=1.0F;
    boolean fieldFound=false;
    try {
      gemClass=(Class<EntityGem>)ModEntities.GEMS.get(gemType);
      yield=(HashMap<IBlockState,Double>)gemClass.getField((gemType + "String_Node_Str").toUpperCase()).get(null);
      defectivityMultiplier=(double)gemClass.getField((gemType + "String_Node_Str").toUpperCase()).get(null);
      fieldFound=true;
    }
 catch (    Exception e) {
    }
    if (fieldFound) {
      try {
        double pressureFactor=1.0;
        double depthFactor=1.0;
        if (world.provider.isSurfaceWorld()) {
          try {
            depthFactor=(double)gemClass.getField((gemType + "String_Node_Str").toUpperCase()).get(null);
            if (depthFactor > 0) {
              pressureFactor=depthFactor / pos.getY();
              depthFactor=Math.min(1.0,pressureFactor);
            }
 else {
              depthFactor=1.0;
            }
          }
 catch (          Exception e) {
          }
        }
        double defectivityRate=1.0;
        double frictionFactor=0.0;
        for (int x=-4; x <= 4; ++x) {
          for (int y=-4; y <= 4; ++y) {
            for (int z=-4; z <= 4; ++z) {
              BlockPos ore=pos.add(x,y,z);
              IBlockState state=world.getBlockState(ore);
              try {
                if (!resultTable.containsKey(gemClass)) {
                  resultTable.put(gemClass,0.0);
                }
                if (yield.containsKey(state)) {
                  double result=yield.get(state);
                  if (result > 1.98) {
                    result*=Math.max(pressureFactor,1.0);
                  }
 else {
                    result*=depthFactor;
                  }
                  resultTable.put(gemClass,resultTable.get(gemClass) + result);
                  frictionFactor+=0.0036;
                  defectivityRate-=0.2;
                }
 else {
                  ItemStack stack=new ItemStack(state.getBlock(),1,state.getBlock().getMetaFromState(state));
                  if (!stack.isEmpty()) {
                    int[] oreIDs=OreDictionary.getOreIDs(stack);
                    for (                    int oreID : oreIDs) {
                      if (OreDictionary.getOreName(oreID).startsWith("String_Node_Str") || OreDictionary.getOreName(oreID).startsWith("String_Node_Str")) {
                        defectivityRate-=0.2;
                      }
                    }
                  }
                }
                if (!drainedChecked) {
                  Block block=state.getBlock();
                  if (block == ModBlocks.DRAINED_BLOCK || block == Blocks.GRAVEL || block == Blocks.AIR) {
                    drainedCount+=1;
                  }
                }
                if (state.getMaterial() == Material.GRASS) {
                  defectivityRate-=0.4;
                  if (!drainedChecked) {
                    baseMinerals+=1;
                  }
                }
 else                 if (state.getMaterial() == Material.SAND || state.getMaterial() == Material.GROUND) {
                  defectivityRate-=0.1;
                }
              }
 catch (              Exception e) {
                KAGIC.instance.chatInfoMessage("String_Node_Str" + state.getBlock().getUnlocalizedName() + "String_Node_Str");
              }
            }
          }
        }
        drainedChecked=true;
        defectivity.put(gemClass,Math.max(0.0,defectivityRate * defectivityMultiplier));
        resultTable.put(gemClass,resultTable.get(gemClass));
        friction.put(gemClass,frictionFactor * pressureFactor);
        System.out.println(gemType + "String_Node_Str" + resultTable.get(gemClass)+ "String_Node_Str"+ defectivity.get(gemClass)+ "String_Node_Str"+ friction.get(gemClass)+ "String_Node_Str"+ depthFactor);
      }
 catch (      Exception e) {
        System.out.println(gemType + "String_Node_Str");
        e.printStackTrace();
      }
    }
  }
  boolean canSpawnGem=false;
  Class<? extends EntityGem> mostLikelyGem=null;
  double highestYield=0.0;
  for (  Class<EntityGem> gemClass : resultTable.keySet()) {
    if (!gemClass.getName().contains("String_Node_Str")) {
      boolean forget=world.rand.nextBoolean();
      if (resultTable.get(gemClass) > 0.1 && world.rand.nextInt((int)(resultTable.get(gemClass) * 10) + 1) == 0) {
        highestYield=resultTable.get(gemClass);
        mostLikelyGem=gemClass;
        canSpawnGem=true;
      }
 else {
        double result=resultTable.get(gemClass);
        if (result == highestYield && result > 0) {
          highestYield=forget ? resultTable.get(gemClass) : highestYield;
          mostLikelyGem=forget ? gemClass : mostLikelyGem;
          canSpawnGem=true;
        }
 else         if (result > highestYield && result > 0) {
          highestYield=resultTable.get(gemClass);
          mostLikelyGem=gemClass;
          canSpawnGem=true;
        }
      }
    }
  }
  boolean mineralSpawned=false;
  if (highestYield <= 0.0 && (drainedCount - baseMinerals) / (9F * 9F * 9F) < InjectorResult.drainedPercentage) {
    ChunkPos c=world.getChunkFromBlockCoords(pos).getPos();
    int chunkPos=(c.x + c.z) % ModEntities.MINERALS.size();
    mostLikelyGem=ModEntities.MINERALS.get(Math.abs(chunkPos));
    mineralSpawned=true;
    canSpawnGem=true;
  }
  EntityGem gemSpawned=null;
  if (canSpawnGem) {
    try {
      gemSpawned=(EntityGem)(mostLikelyGem.getConstructors()[0].newInstance(world));
    }
 catch (    Exception e) {
      e.printStackTrace();
      System.out.println("String_Node_Str" + e.getMessage());
      canSpawnGem=false;
    }
  }
  ExitHole exitHole=null;
  if (drain && gemSpawned != null) {
    Double gemFriction=friction.get(gemSpawned.getClass());
    if (gemFriction == null) {
      gemFriction=0.0;
    }
    exitHole=ExitHole.create(world,pos,Math.ceil(gemSpawned.height),gemFriction >= 1.0F);
    exitHole.emerge(world);
    gemSpawned.setPosition(pos.getX() + 0.5,pos.getY(),pos.getZ() + 0.5);
  }
  if (drain) {
    for (int x=-4; x <= 4; ++x) {
      for (int y=-4; y <= 4; ++y) {
        for (int z=-4; z <= 4; ++z) {
          if (world.rand.nextBoolean()) {
            BlockPos ore=pos.add(x,y,z);
            drainBlock(world,ore);
          }
        }
      }
    }
  }
  return new InjectorResult(gemSpawned,pos,mineralSpawned ? 1.0 : (gemSpawned == null ? 0.0 : defectivity.get(gemSpawned.getClass())),!canSpawnGem,canSpawnGem ? friction.get(gemSpawned.getClass()) >= 1.0F : false,exitHole);
}