nus-yam/ex-repair huggingface dataset:
Program: 157070
Project: 157070
Buggy source:
private static boolean compareStacks(WrappedStack wrappedStack1,WrappedStack wrappedStack2){
  if (wrappedStack1 != null && wrappedStack1.getWrappedObject() != null && wrappedStack2 != null && wrappedStack2.getWrappedObject() != null) {
    if (wrappedStack1.getWrappedObject() instanceof ItemStack && wrappedStack2.getWrappedObject() instanceof ItemStack) {
      ItemStack itemStack1=(ItemStack)wrappedStack1.getWrappedObject();
      itemStack1.stackSize=wrappedStack1.getStackSize();
      ItemStack itemStack2=(ItemStack)wrappedStack2.getWrappedObject();
      itemStack2.stackSize=wrappedStack2.getStackSize();
      return compareItemStacks(itemStack1,itemStack2);
    }
 else     if (wrappedStack1.getWrappedObject() instanceof OreStack && wrappedStack2.getWrappedObject() instanceof OreStack) {
      if (((OreStack)wrappedStack1.getWrappedObject()).oreName.equalsIgnoreCase(((OreStack)wrappedStack2.getWrappedObject()).oreName)) {
        return wrappedStack2.getStackSize() >= wrappedStack1.getStackSize();
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean compareStacks(WrappedStack wrappedStack1,WrappedStack wrappedStack2){
  if (wrappedStack1 != null && wrappedStack1.getWrappedObject() != null && wrappedStack2 != null && wrappedStack2.getWrappedObject() != null) {
    if (wrappedStack1.getWrappedObject() instanceof ItemStack && wrappedStack2.getWrappedObject() instanceof ItemStack) {
      ItemStack itemStack1=(ItemStack)wrappedStack1.getWrappedObject();
      itemStack1.stackSize=wrappedStack1.getStackSize();
      ItemStack itemStack2=(ItemStack)wrappedStack2.getWrappedObject();
      itemStack2.stackSize=wrappedStack2.getStackSize();
      return compareItemStacks(itemStack1,itemStack2);
    }
  }
  return false;
}
Program: 157071
Project: 157071
Buggy source:
public void addRecipe(ItemStack recipeOutput,OreStack recipeInputStack,ItemStack recipeInputDust){
  addRecipe(new RecipeAludel(recipeOutput,recipeInputStack,recipeInputDust));
}

Fixed version (ground truth):
public void addRecipe(RecipeAludel recipeAludel){
  if (!aludelRecipes.contains(recipeAludel)) {
    aludelRecipes.add(recipeAludel);
  }
}
Program: 157072
Project: 157072
Buggy source:
@Override public IMessage onMessage(MessageTransmutationKnowledgeUpdate message,MessageContext ctx){
  EntityPlayer entityPlayer=FMLClientHandler.instance().getClientPlayerEntity();
  if (entityPlayer != null && entityPlayer.openContainer instanceof ContainerTransmutationTablet) {
    ((ContainerTransmutationTablet)entityPlayer.openContainer).handleTransmutationKnowledgeUpdate(message.transmutationKnowledge);
  }
  return null;
}

Fixed version (ground truth):
@Override public IMessage onMessage(MessageTransmutationKnowledgeUpdate message,MessageContext ctx){
  if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiContainer) {
    GuiContainer guiContainer=(GuiContainer)FMLClientHandler.instance().getClient().currentScreen;
    if (guiContainer.inventorySlots instanceof ContainerTransmutationTablet) {
      ((ContainerTransmutationTablet)guiContainer.inventorySlots).handleTransmutationKnowledgeUpdate(message.transmutationKnowledge);
    }
  }
  return null;
}
Program: 157073
Project: 157073
Buggy source:
public static boolean equalsIgnoreStackSize(ItemStack itemStack1,ItemStack itemStack2){
  if (itemStack1 != null && itemStack2 != null) {
    if (Item.getIdFromItem(itemStack1.getItem()) - Item.getIdFromItem(itemStack2.getItem()) == 0) {
      if (itemStack1.getItem() == itemStack2.getItem()) {
        if (itemStack1.getItemDamage() == itemStack2.getItemDamage()) {
          if (itemStack1.hasTagCompound() && itemStack2.hasTagCompound()) {
            if (ItemStack.areItemStackTagsEqual(itemStack1,itemStack2)) {
              return true;
            }
          }
 else {
            return true;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean equalsIgnoreStackSize(ItemStack itemStack1,ItemStack itemStack2){
  if (itemStack1 != null && itemStack2 != null) {
    if (Item.getIdFromItem(itemStack1.getItem()) - Item.getIdFromItem(itemStack2.getItem()) == 0) {
      if (itemStack1.getItem() == itemStack2.getItem()) {
        if (itemStack1.getItemDamage() == itemStack2.getItemDamage()) {
          if (itemStack1.hasTagCompound() && itemStack2.hasTagCompound()) {
            if (ItemStack.areItemStackTagsEqual(itemStack1,itemStack2)) {
              return true;
            }
          }
 else           if (!itemStack1.hasTagCompound() && !itemStack2.hasTagCompound()) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
Program: 157074
Project: 157074
Buggy source:
public static boolean equalsIgnoreStackSize(ItemStack itemStack1,ItemStack itemStack2){
  if (itemStack1 != null && itemStack2 != null) {
    if (Item.getIdFromItem(itemStack1.getItem()) - Item.getIdFromItem(itemStack2.getItem()) == 0) {
      if (itemStack1.getItemDamage() == itemStack2.getItemDamage()) {
        if (itemStack1.hasTagCompound() && itemStack2.hasTagCompound()) {
          if (itemStack1.getTagCompound().equals(itemStack2.getTagCompound())) {
            return true;
          }
        }
 else {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean equalsIgnoreStackSize(ItemStack itemStack1,ItemStack itemStack2){
  if (itemStack1 != null && itemStack2 != null) {
    if (Item.getIdFromItem(itemStack1.getItem()) - Item.getIdFromItem(itemStack2.getItem()) == 0) {
      if (itemStack1.getItem() == itemStack2.getItem()) {
        if (itemStack1.getItemDamage() == itemStack2.getItemDamage()) {
          if (itemStack1.hasTagCompound() && itemStack2.hasTagCompound()) {
            if (ItemStack.areItemStackTagsEqual(itemStack1,itemStack2)) {
              return true;
            }
          }
 else {
            return true;
          }
        }
      }
    }
  }
  return false;
}
Program: 157075
Project: 157075
Buggy source:
@Override public void onBlockPlacedBy(World world,int x,int y,int z,EntityLivingBase entityLiving,ItemStack itemStack){
  super.onBlockPlacedBy(world,x,y,z,entityLiving,itemStack);
  if (world.getBlockTileEntity(x,y + 1,z) instanceof TileGlassBell) {
    TileGlassBell tileGlassBell=(TileGlassBell)world.getBlockTileEntity(x,y + 1,z);
    tileGlassBell.setOrientation(ForgeDirection.UP);
    if (world.getBlockTileEntity(x,y,z) instanceof TileAludel) {
      TileAludel tileAludel=(TileAludel)world.getBlockTileEntity(x,y,z);
      ItemStack itemStackGlassBell=tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX);
      tileGlassBell.setInventorySlotContents(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX,null);
      tileAludel.setInventorySlotContents(TileAludel.INPUT_INVENTORY_INDEX,itemStackGlassBell);
    }
  }
}

Fixed version (ground truth):
@Override public void onBlockPlacedBy(World world,int x,int y,int z,EntityLivingBase entityLiving,ItemStack itemStack){
  super.onBlockPlacedBy(world,x,y,z,entityLiving,itemStack);
  if (world.getBlockTileEntity(x,y + 1,z) instanceof TileGlassBell) {
    TileGlassBell tileGlassBell=(TileGlassBell)world.getBlockTileEntity(x,y + 1,z);
    tileGlassBell.setOrientation(ForgeDirection.UP);
    if (world.getBlockTileEntity(x,y,z) instanceof TileAludel) {
      TileAludel tileAludel=(TileAludel)world.getBlockTileEntity(x,y,z);
      ItemStack itemStackGlassBell=tileGlassBell.getStackInSlot(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX);
      tileGlassBell.setInventorySlotContents(TileGlassBell.DISPLAY_SLOT_INVENTORY_INDEX,null);
      tileAludel.setInventorySlotContents(TileAludel.INPUT_INVENTORY_INDEX,itemStackGlassBell);
      tileAludel.hasGlassBell=true;
    }
  }
}
Program: 157076
Project: 157076
Buggy source:
@Override public void readFromNBT(NBTTagCompound nbtTagCompound){
  super.readFromNBT(nbtTagCompound);
  NBTTagList tagList=nbtTagCompound.getTagList("String_Node_Str");
  inventory=new ItemStack[this.getSizeInventory()];
  for (int i=0; i < tagList.tagCount(); ++i) {
    NBTTagCompound tagCompound=(NBTTagCompound)tagList.tagAt(i);
    byte slotIndex=tagCompound.getByte("String_Node_Str");
    if (slotIndex >= 0 && slotIndex < inventory.length) {
      inventory[slotIndex]=ItemStack.loadItemStackFromNBT(tagCompound);
    }
  }
  deviceCookTime=nbtTagCompound.getInteger("String_Node_Str");
  fuelBurnTime=nbtTagCompound.getInteger("String_Node_Str");
  itemCookTime=nbtTagCompound.getInteger("String_Node_Str");
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound nbtTagCompound){
  super.readFromNBT(nbtTagCompound);
  NBTTagList tagList=nbtTagCompound.getTagList("String_Node_Str");
  inventory=new ItemStack[this.getSizeInventory()];
  for (int i=0; i < tagList.tagCount(); ++i) {
    NBTTagCompound tagCompound=(NBTTagCompound)tagList.tagAt(i);
    byte slotIndex=tagCompound.getByte("String_Node_Str");
    if (slotIndex >= 0 && slotIndex < inventory.length) {
      inventory[slotIndex]=ItemStack.loadItemStackFromNBT(tagCompound);
    }
  }
  deviceCookTime=nbtTagCompound.getInteger("String_Node_Str");
  fuelBurnTime=nbtTagCompound.getInteger("String_Node_Str");
  itemCookTime=nbtTagCompound.getInteger("String_Node_Str");
  hasGlassBell=nbtTagCompound.getBoolean("String_Node_Str");
}
Program: 157077
Project: 157077
Buggy source:
private boolean canInfuse(){
  if (inventory[INPUT_INVENTORY_INDEX] == null || inventory[DUST_INVENTORY_INDEX] == null) {
    return false;
  }
 else {
    ItemStack infusedItemStack=RecipesAludel.getInstance().getResult(inventory[INPUT_INVENTORY_INDEX],inventory[DUST_INVENTORY_INDEX]);
    if (infusedItemStack == null) {
      return false;
    }
    if (inventory[OUTPUT_INVENTORY_INDEX] == null) {
      return true;
    }
 else {
      boolean outputEquals=this.inventory[OUTPUT_INVENTORY_INDEX].isItemEqual(infusedItemStack);
      int mergedOutputStackSize=this.inventory[OUTPUT_INVENTORY_INDEX].stackSize + infusedItemStack.stackSize;
      if (outputEquals) {
        return mergedOutputStackSize <= getInventoryStackLimit() && mergedOutputStackSize <= infusedItemStack.getMaxStackSize();
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean canInfuse(){
  if (!hasGlassBell || inventory[INPUT_INVENTORY_INDEX] == null || inventory[DUST_INVENTORY_INDEX] == null) {
    return false;
  }
 else {
    ItemStack infusedItemStack=RecipesAludel.getInstance().getResult(inventory[INPUT_INVENTORY_INDEX],inventory[DUST_INVENTORY_INDEX]);
    if (infusedItemStack == null) {
      return false;
    }
    if (inventory[OUTPUT_INVENTORY_INDEX] == null) {
      return true;
    }
 else {
      boolean outputEquals=this.inventory[OUTPUT_INVENTORY_INDEX].isItemEqual(infusedItemStack);
      int mergedOutputStackSize=this.inventory[OUTPUT_INVENTORY_INDEX].stackSize + infusedItemStack.stackSize;
      if (outputEquals) {
        return mergedOutputStackSize <= getInventoryStackLimit() && mergedOutputStackSize <= infusedItemStack.getMaxStackSize();
      }
    }
  }
  return false;
}
Program: 157078
Project: 157078
Buggy source:
@Override public void onInventoryChanged(){
  PacketDispatcher.sendPacketToAllAround(this.xCoord,this.yCoord,this.zCoord,128D,this.worldObj.provider.dimensionId,getDescriptionPacket());
  worldObj.updateAllLightTypes(xCoord,yCoord,zCoord);
  if (worldObj.getBlockTileEntity(xCoord,yCoord + 1,zCoord) instanceof TileGlassBell) {
    worldObj.updateAllLightTypes(xCoord,yCoord + 1,zCoord);
  }
}

Fixed version (ground truth):
@Override public void onInventoryChanged(){
  PacketDispatcher.sendPacketToAllAround(this.xCoord,this.yCoord,this.zCoord,128D,this.worldObj.provider.dimensionId,getDescriptionPacket());
  worldObj.updateAllLightTypes(xCoord,yCoord,zCoord);
  if (hasGlassBell) {
    worldObj.updateAllLightTypes(xCoord,yCoord + 1,zCoord);
  }
}
Program: 157079
Project: 157079
Buggy source:
@Override public void writeToNBT(NBTTagCompound nbtTagCompound){
  super.writeToNBT(nbtTagCompound);
  NBTTagList tagList=new NBTTagList();
  for (int currentIndex=0; currentIndex < inventory.length; ++currentIndex) {
    if (inventory[currentIndex] != null) {
      NBTTagCompound tagCompound=new NBTTagCompound();
      tagCompound.setByte("String_Node_Str",(byte)currentIndex);
      inventory[currentIndex].writeToNBT(tagCompound);
      tagList.appendTag(tagCompound);
    }
  }
  nbtTagCompound.setTag("String_Node_Str",tagList);
  nbtTagCompound.setInteger("String_Node_Str",deviceCookTime);
  nbtTagCompound.setInteger("String_Node_Str",fuelBurnTime);
  nbtTagCompound.setInteger("String_Node_Str",itemCookTime);
}

Fixed version (ground truth):
@Override public void writeToNBT(NBTTagCompound nbtTagCompound){
  super.writeToNBT(nbtTagCompound);
  NBTTagList tagList=new NBTTagList();
  for (int currentIndex=0; currentIndex < inventory.length; ++currentIndex) {
    if (inventory[currentIndex] != null) {
      NBTTagCompound tagCompound=new NBTTagCompound();
      tagCompound.setByte("String_Node_Str",(byte)currentIndex);
      inventory[currentIndex].writeToNBT(tagCompound);
      tagList.appendTag(tagCompound);
    }
  }
  nbtTagCompound.setTag("String_Node_Str",tagList);
  nbtTagCompound.setInteger("String_Node_Str",deviceCookTime);
  nbtTagCompound.setInteger("String_Node_Str",fuelBurnTime);
  nbtTagCompound.setInteger("String_Node_Str",itemCookTime);
  nbtTagCompound.setBoolean("String_Node_Str",hasGlassBell);
}
Program: 157080
Project: 157080
Buggy source:
public static float[] convertIntColourToFloatArray(int intColour){
  float[] colourFloatArray=new float[3];
  colourFloatArray[0]=(float)(intColour >> 16 & 255) / 255F;
  colourFloatArray[1]=(float)(intColour >> 8 & 255) / 255F;
  colourFloatArray[2]=(float)(intColour & 255) / 255F;
  return colourFloatArray;
}

Fixed version (ground truth):
public static float[] convertIntColourToFloatArray(int intColour){
  float[] colourFloatArray=new float[3];
  colourFloatArray[0]=((intColour >> 16 & 0xFF) / 255F);
  colourFloatArray[1]=((intColour >> 8 & 0xFF) / 255F);
  colourFloatArray[2]=((intColour & 0xFF) / 255F);
  return colourFloatArray;
}
Program: 157081
Project: 157081
Buggy source:
private static float[] getBlendedDustColour(int leftStackSize,int leftStackColour,int rightStackSize,int rightStackColour){
  if (leftStackSize > 0 && rightStackSize > 0) {
    int stackSizeStepRange=8;
    int factoredLeftStackSize=leftStackSize / stackSizeStepRange;
    int factoredRightStackSize=rightStackSize / stackSizeStepRange;
    float[][] blendedColours=ColourUtils.getFloatBlendedColours(leftStackColour,rightStackColour,2 * stackSizeStepRange - 1);
    return blendedColours[stackSizeStepRange + (factoredLeftStackSize - factoredRightStackSize)];
  }
 else   if (leftStackSize > 0) {
    return ColourUtils.convertIntColourToFloatArray(leftStackColour);
  }
 else   if (rightStackSize > 0) {
    return ColourUtils.convertIntColourToFloatArray(rightStackColour);
  }
 else {
    return new float[]{1F,1F,1F};
  }
}

Fixed version (ground truth):
private static float[] getBlendedDustColour(int leftStackSize,int leftStackColour,int rightStackSize,int rightStackColour){
  if (leftStackSize > 0 && rightStackSize > 0) {
    int stackSizeStepRange=8;
    int factoredLeftStackSize=leftStackSize / stackSizeStepRange;
    int factoredRightStackSize=rightStackSize / stackSizeStepRange;
    float[][] blendedColours=ColourUtils.getFloatBlendedColours(leftStackColour,rightStackColour,2 * stackSizeStepRange - 1);
    if (blendedColours != null) {
      return blendedColours[stackSizeStepRange + (factoredLeftStackSize - factoredRightStackSize)];
    }
 else {
      return new float[]{1F,1F,1F};
    }
  }
 else   if (leftStackSize > 0) {
    return ColourUtils.convertIntColourToFloatArray(leftStackColour);
  }
 else   if (rightStackSize > 0) {
    return ColourUtils.convertIntColourToFloatArray(rightStackColour);
  }
 else {
    return new float[]{1F,1F,1F};
  }
}
Program: 157082
Project: 157082
Buggy source:
private int getLeftStackColour(){
  if (this.inventory[OUTPUT_LEFT_INVENTORY_INDEX] != null) {
    return this.inventory[OUTPUT_LEFT_INVENTORY_INDEX].getItem().getColorFromItemStack(this.inventory[OUTPUT_LEFT_INVENTORY_INDEX],1);
  }
  return Integer.parseInt(Colours.PURE_WHITE,16);
}

Fixed version (ground truth):
private int getLeftStackColour(){
  if (this.inventory[OUTPUT_LEFT_INVENTORY_INDEX] != null) {
    ItemStack itemStack=this.inventory[OUTPUT_LEFT_INVENTORY_INDEX];
    if (itemStack.getItem() instanceof ItemAlchemicalDust) {
      return Integer.parseInt(Colours.DUST_COLOURS[MathHelper.clamp_int(itemStack.getItemDamage(),0,Colours.DUST_COLOURS.length - 1)],16);
    }
  }
  return 16777215;
}
Program: 157083
Project: 157083
Buggy source:
private int getRightStackColour(){
  if (this.inventory[OUTPUT_RIGHT_INVENTORY_INDEX] != null) {
    return this.inventory[OUTPUT_RIGHT_INVENTORY_INDEX].getItem().getColorFromItemStack(this.inventory[OUTPUT_RIGHT_INVENTORY_INDEX],1);
  }
  return Integer.parseInt(Colours.PURE_WHITE,16);
}

Fixed version (ground truth):
private int getRightStackColour(){
  if (this.inventory[OUTPUT_RIGHT_INVENTORY_INDEX] != null) {
    ItemStack itemStack=this.inventory[OUTPUT_RIGHT_INVENTORY_INDEX];
    if (itemStack.getItem() instanceof ItemAlchemicalDust) {
      return Integer.parseInt(Colours.DUST_COLOURS[MathHelper.clamp_int(itemStack.getItemDamage(),0,Colours.DUST_COLOURS.length - 1)],16);
    }
  }
  return 16777215;
}
Program: 157084
Project: 157084
Buggy source:
/** 
 * Returns the stack in slot i
 */
@Override public ItemStack getStackInSlot(int slotIndex){
  return inventory[slotIndex];
}

Fixed version (ground truth):
/** 
 * Returns the stack in slot i
 */
@Override public ItemStack getStackInSlot(int slotIndex){
  sendDustPileData();
  return inventory[slotIndex];
}
Program: 157086
Project: 157086
Buggy source:
@Override public JsonElement serialize(WrappedStack wrappedStack,Type type,JsonSerializationContext context){
  JsonObject jsonWrappedStack=new JsonObject();
  Gson gsonWrappedStack=new Gson();
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.className);
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.stackSize);
  if (wrappedStack.wrappedStack instanceof ItemStack) {
    Gson gsonItemStackSerializer=(new GsonBuilder()).registerTypeAdapter(ItemStack.class,new GsonItemStackSerialization()).create();
    jsonWrappedStack.add("String_Node_Str",gsonItemStackSerializer.toJsonTree(wrappedStack.wrappedStack,ItemStack.class));
  }
 else   if (wrappedStack.wrappedStack instanceof OreStack) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack,OreStack.class));
  }
 else   if (wrappedStack.wrappedStack instanceof EnergyStack) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack,EnergyStack.class));
  }
 else   if (wrappedStack.wrappedStack instanceof FluidStack) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack,FluidStack.class));
  }
  return jsonWrappedStack;
}

Fixed version (ground truth):
@Override public JsonElement serialize(WrappedStack wrappedStack,Type type,JsonSerializationContext context){
  JsonObject jsonWrappedStack=new JsonObject();
  Gson gsonWrappedStack=new Gson();
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.className);
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.stackSize);
  if (wrappedStack.wrappedStack instanceof ItemStack) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack,ItemStack.class));
  }
 else   if (wrappedStack.wrappedStack instanceof OreStack) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack,OreStack.class));
  }
 else   if (wrappedStack.wrappedStack instanceof EnergyStack) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack,EnergyStack.class));
  }
 else   if (wrappedStack.wrappedStack instanceof FluidStack) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack,FluidStack.class));
  }
  return jsonWrappedStack;
}
Program: 157089
Project: 157089
Buggy source:
public String toJson(){
  return gsonSerializer.toJson(this);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public String toJson(){
  return gsonSerializer.toJson(this);
}
Program: 157090
Project: 157090
Buggy source:
public static void init(){
  GameRegistry.registerCraftingHandler(new CraftingHandler());
  CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes());
  initBlockRecipes();
  initItemRecipes();
}

Fixed version (ground truth):
public static void init(){
  GameRegistry.registerCraftingHandler(new CraftingHandler());
  CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes());
  RecipesEquivalentExchange.init();
}
Program: 157091
Project: 157091
Buggy source:
@Override public JsonElement serialize(RecipeMapping recipeMapping,Type type,JsonSerializationContext context){
  JsonObject jsonRecipeMapping=new JsonObject();
  Gson gsonWrappedStack=(new GsonBuilder()).registerTypeAdapter(WrappedStack.class,new WrappedStack()).create();
  JsonArray jsonArray=new JsonArray();
  for (  WrappedStack inputStack : recipeMapping.inputWrappedStacks) {
    jsonArray.add(gsonWrappedStack.toJsonTree(inputStack));
  }
  jsonRecipeMapping.add("String_Node_Str",gsonWrappedStack.toJsonTree(recipeMapping.outputWrappedStack));
  jsonRecipeMapping.add("String_Node_Str",jsonArray);
  return jsonRecipeMapping;
}

Fixed version (ground truth):
@Override public JsonElement serialize(RecipeMapping recipeMapping,Type type,JsonSerializationContext context){
  JsonObject jsonRecipeMapping=new JsonObject();
  Gson gsonWrappedStack=new Gson();
  JsonArray jsonArray=new JsonArray();
  for (  WrappedStack inputStack : recipeMapping.inputWrappedStacks) {
    jsonArray.add(gsonWrappedStack.toJsonTree(inputStack));
  }
  jsonRecipeMapping.add("String_Node_Str",gsonWrappedStack.toJsonTree(recipeMapping.outputWrappedStack));
  jsonRecipeMapping.add("String_Node_Str",jsonArray);
  return jsonRecipeMapping;
}
Program: 157092
Project: 157092
Buggy source:
@Override public JsonElement serialize(WrappedStack wrappedStack,Type type,JsonSerializationContext context){
  JsonObject jsonWrappedStack=new JsonObject();
  Gson gsonWrappedStack=new Gson();
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.className);
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.stackSize);
  if (gsonWrappedStack != null) {
    jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack));
  }
 else {
    jsonWrappedStack.add("String_Node_Str",JsonNull.INSTANCE);
  }
  return jsonWrappedStack;
}

Fixed version (ground truth):
@Override public JsonElement serialize(WrappedStack wrappedStack,Type type,JsonSerializationContext context){
  JsonObject jsonWrappedStack=new JsonObject();
  Gson gsonWrappedStack=new Gson();
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.className);
  jsonWrappedStack.addProperty("String_Node_Str",wrappedStack.stackSize);
  jsonWrappedStack.add("String_Node_Str",gsonWrappedStack.toJsonTree(wrappedStack.wrappedStack));
  return jsonWrappedStack;
}
Program: 157094
Project: 157094
Buggy source:
public static boolean transmuteInWorld(World world,EntityPlayer player,ItemStack stack,int x,int y,int z,int targetID,int targetMeta){
  if (Block.blocksList[targetID] != null) {
    world.setBlockMetadataWithNotify(x,y,z,targetID,targetMeta);
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean transmuteInWorld(World world,EntityPlayer player,ItemStack stack,int x,int y,int z,int targetID,int targetMeta){
  if (Block.blocksList[targetID] != null) {
    world.setBlock(x,y,z,targetID,targetMeta,2);
    return true;
  }
  return false;
}
Program: 157096
Project: 157096
Buggy source:
public ContainerAlchemicalChest(InventoryPlayer inventoryPlayer,TileAlchemicalChest tileAlchemicalChest){
  this.tileAlchemicalChest=tileAlchemicalChest;
  tileAlchemicalChest.openChest();
  for (int chestRowIndex=0; chestRowIndex < numChestRows; ++chestRowIndex) {
    for (int chestColumnIndex=0; chestColumnIndex < numChestColumns; ++chestColumnIndex) {
      this.addSlotToContainer(new Slot(tileAlchemicalChest,chestColumnIndex + chestRowIndex * 9 + 9,8 + chestColumnIndex * 18,18 + chestRowIndex * 18));
    }
  }
  for (int inventoryRowIndex=0; inventoryRowIndex < numPlayerRows; ++inventoryRowIndex) {
    for (int inventoryColumnIndex=0; inventoryColumnIndex < numPlayerColumns; ++inventoryColumnIndex) {
      this.addSlotToContainer(new Slot(inventoryPlayer,inventoryColumnIndex + inventoryRowIndex * 9 + 9,44 + inventoryColumnIndex * 18,104 + inventoryRowIndex * 18));
    }
  }
  for (int actionBarSlotIndex=0; actionBarSlotIndex < numPlayerColumns; ++actionBarSlotIndex) {
    this.addSlotToContainer(new Slot(inventoryPlayer,actionBarSlotIndex,44 + actionBarSlotIndex * 18,162));
  }
}

Fixed version (ground truth):
public ContainerAlchemicalChest(InventoryPlayer inventoryPlayer,TileAlchemicalChest tileAlchemicalChest){
  this.tileAlchemicalChest=tileAlchemicalChest;
  tileAlchemicalChest.openChest();
  for (int chestRowIndex=0; chestRowIndex < numChestRows; ++chestRowIndex) {
    for (int chestColumnIndex=0; chestColumnIndex < numChestColumns; ++chestColumnIndex) {
      this.addSlotToContainer(new Slot(tileAlchemicalChest,chestColumnIndex + chestRowIndex * 13,8 + chestColumnIndex * 18,18 + chestRowIndex * 18));
    }
  }
  for (int inventoryRowIndex=0; inventoryRowIndex < numPlayerRows; ++inventoryRowIndex) {
    for (int inventoryColumnIndex=0; inventoryColumnIndex < numPlayerColumns; ++inventoryColumnIndex) {
      this.addSlotToContainer(new Slot(inventoryPlayer,inventoryColumnIndex + inventoryRowIndex * 9 + 9,44 + inventoryColumnIndex * 18,104 + inventoryRowIndex * 18));
    }
  }
  for (int actionBarSlotIndex=0; actionBarSlotIndex < numPlayerColumns; ++actionBarSlotIndex) {
    this.addSlotToContainer(new Slot(inventoryPlayer,actionBarSlotIndex,44 + actionBarSlotIndex * 18,162));
  }
}
Program: 157097
Project: 157097
Buggy source:
@ForgeSubscribe public void onWorldTransmutationEvent(WorldTransmutationEvent event){
  int id=event.world.getBlockId(event.x,event.y,event.z);
  int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
  boolean result=false;
  Block currentBlock=Block.blocksList[id];
  if (currentBlock != null) {
    meta=currentBlock.damageDropped(meta);
  }
  ItemStack worldStack=new ItemStack(id,1,meta);
  ItemStack targetStack=new ItemStack(event.targetID,1,event.targetMeta);
  if (!worldStack.isItemEqual(targetStack)) {
    if (EquivalencyHandler.instance().areEquivalent(worldStack,targetStack)) {
      if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) {
        result=TransmutationHelper.transmuteInWorld(event.world,event.player,event.player.getCurrentEquippedItem(),event.x,event.y,event.z,event.targetID,event.targetMeta);
      }
    }
  }
  if (result) {
    event.actionResult=ActionResult.SUCCESS;
  }
 else {
    event.actionResult=ActionResult.FAILURE;
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onWorldTransmutationEvent(WorldTransmutationEvent event){
  int id=event.world.getBlockId(event.x,event.y,event.z);
  int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
  boolean result=false;
  Block currentBlock=Block.blocksList[id];
  if (currentBlock != null) {
    meta=currentBlock.damageDropped(meta);
  }
  ItemStack worldStack=new ItemStack(id,1,meta);
  ItemStack targetStack=new ItemStack(event.targetID,1,event.targetMeta);
  if (!worldStack.isItemEqual(targetStack)) {
    if (EquivalencyHandler.instance().areWorldEquivalent(worldStack,targetStack)) {
      if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) {
        result=TransmutationHelper.transmuteInWorld(event.world,event.player,event.player.getCurrentEquippedItem(),event.x,event.y,event.z,event.targetID,event.targetMeta);
      }
    }
  }
  if (result) {
    event.actionResult=ActionResult.SUCCESS;
  }
 else {
    event.actionResult=ActionResult.FAILURE;
  }
}
Program: 157098
Project: 157098
Buggy source:
@Override public boolean onItemUse(ItemStack itemStack,EntityPlayer entityPlayer,World world,int x,int y,int z,int sideHit,float hitVecX,float hitVecY,float hitVecZ){
  transmuteBlock(itemStack,entityPlayer,world,x,y,z,sideHit);
  return true;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack itemStack,EntityPlayer entityPlayer,World world,int x,int y,int z,int sideHit,float hitVecX,float hitVecY,float hitVecZ){
  if (world.isRemote) {
    transmuteBlock(itemStack,entityPlayer,world,x,y,z,sideHit);
  }
  return true;
}
Program: 157100
Project: 157100
Buggy source:
public String getCommandName(){
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getCommandName(){
  return COMMAND_EE3;
}
Program: 157101
Project: 157101
Buggy source:
public void processCommand(ICommandSender commandSender,String[] args){
  if (args.length > 0) {
    String commandName=args[0];
    System.arraycopy(args,1,args,0,args.length - 1);
    if (commandName.toLowerCase().equals("String_Node_Str")) {
      CommandOverlay.processCommand(commandSender,args);
    }
 else     if (commandName.toLowerCase().equals("String_Node_Str")) {
      CommandParticles.processCommand(commandSender,args);
    }
 else     if (commandName.toLowerCase().equals("String_Node_Str")) {
      CommandSounds.processCommand(commandSender,args);
    }
  }
 else {
    throw new WrongUsageException("String_Node_Str",new Object[0]);
  }
}

Fixed version (ground truth):
public void processCommand(ICommandSender commandSender,String[] args){
  if (args.length > 0) {
    String commandName=args[0];
    System.arraycopy(args,1,args,0,args.length - 1);
    if (commandName.equalsIgnoreCase(getLocalizedString(COMMAND_OVERLAY))) {
      CommandOverlay.processCommand(commandSender,args);
    }
 else     if (commandName.equalsIgnoreCase(getLocalizedString(COMMAND_PARTICLES))) {
      CommandParticles.processCommand(commandSender,args);
    }
 else     if (commandName.equalsIgnoreCase(getLocalizedString(COMMAND_SOUNDS))) {
      CommandSounds.processCommand(commandSender,args);
    }
  }
 else {
    throw new WrongUsageException(getLocalizedString(COMMAND_EE3_USAGE),new Object[0]);
  }
}
Program: 157102
Project: 157102
Buggy source:
private static void processScaleCommand(ICommandSender commandSender,String[] args){
  if (args.length >= 2) {
    try {
      float scale=Float.parseFloat(args[1]);
      if (scale <= 0F) {
        throw new WrongUsageException("String_Node_Str",new Object[0]);
      }
 else {
        ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE=scale;
        ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME,args[1]);
        commandSender.sendChatToPlayer("String_Node_Str");
      }
    }
 catch (    Exception e) {
      throw new WrongUsageException("String_Node_Str",new Object[0]);
    }
  }
 else {
    throw new WrongUsageException("String_Node_Str",new Object[0]);
  }
}

Fixed version (ground truth):
private static void processScaleCommand(ICommandSender commandSender,String[] args){
  if (args.length >= 2) {
    try {
      float scale=Float.parseFloat(args[1]);
      if (scale <= 0F) {
        throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_SCALE_USAGE),new Object[0]);
      }
 else {
        ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE=scale;
        ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME,args[1]);
        commandSender.sendChatToPlayer(getLocalizedString(COMMAND_OVERLAY_SCALE_UPDATED));
      }
    }
 catch (    Exception e) {
      throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_SCALE_USAGE),new Object[0]);
    }
  }
 else {
    throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_SCALE_USAGE),new Object[0]);
  }
}
Program: 157104
Project: 157104
Buggy source:
private static void processOffCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION=false;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME,"String_Node_Str");
  commandSender.sendChatToPlayer("String_Node_Str");
}

Fixed version (ground truth):
private static void processOffCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION=false;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME,FALSE);
  commandSender.sendChatToPlayer(getLocalizedString(COMMAND_OVERLAY_TURNED_OFF));
}
Program: 157105
Project: 157105
Buggy source:
private static void processOnCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION=true;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME,"String_Node_Str");
  commandSender.sendChatToPlayer("String_Node_Str");
}

Fixed version (ground truth):
private static void processOnCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION=true;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_OVERLAY_WORLD_TRANSMUTATION_CONFIGNAME,TRUE);
  commandSender.sendChatToPlayer(getLocalizedString(COMMAND_OVERLAY_TURNED_ON));
}
Program: 157106
Project: 157106
Buggy source:
private static void processOpacityCommand(ICommandSender commandSender,String[] args){
  if (args.length >= 2) {
    try {
      float opacity=Float.parseFloat(args[1]);
      if ((opacity < 0F) || (opacity > 1F)) {
        throw new WrongUsageException("String_Node_Str",new Object[0]);
      }
 else {
        ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY=opacity;
        ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME,args[1]);
        commandSender.sendChatToPlayer("String_Node_Str");
      }
    }
 catch (    Exception e) {
      throw new WrongUsageException("String_Node_Str",new Object[0]);
    }
  }
 else {
    throw new WrongUsageException("String_Node_Str",new Object[0]);
  }
}

Fixed version (ground truth):
private static void processOpacityCommand(ICommandSender commandSender,String[] args){
  if (args.length >= 2) {
    try {
      float opacity=Float.parseFloat(args[1]);
      if ((opacity < 0F) || (opacity > 1F)) {
        throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_OPACITY_USAGE),new Object[0]);
      }
 else {
        ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY=opacity;
        ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.TARGET_BLOCK_OVERLAY_OPACITY_CONFIGNAME,args[1]);
        commandSender.sendChatToPlayer(getLocalizedString(COMMAND_OVERLAY_OPACITY_UPDATED));
      }
    }
 catch (    Exception e) {
      throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_OPACITY_USAGE),new Object[0]);
    }
  }
 else {
    throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_OPACITY_USAGE),new Object[0]);
  }
}
Program: 157107
Project: 157107
Buggy source:
public static void processCommand(ICommandSender commandSender,String[] args){
  if (args.length > 0) {
    String subCommand=args[0];
    if (subCommand.toLowerCase().equals("String_Node_Str")) {
      processOnCommand(commandSender);
    }
 else     if (subCommand.toLowerCase().equals("String_Node_Str")) {
      processOffCommand(commandSender);
    }
 else     if (subCommand.toLowerCase().equals("String_Node_Str")) {
      processOpacityCommand(commandSender,args);
    }
 else     if (subCommand.toLowerCase().equals("String_Node_Str")) {
      processScaleCommand(commandSender,args);
    }
 else     if (subCommand.toLowerCase().equals("String_Node_Str")) {
      processPositionCommand(commandSender,args);
    }
 else {
      throw new WrongUsageException("String_Node_Str",new Object[0]);
    }
  }
 else {
    throw new WrongUsageException("String_Node_Str",new Object[0]);
  }
}

Fixed version (ground truth):
public static void processCommand(ICommandSender commandSender,String[] args){
  if (args.length > 0) {
    String subCommand=args[0];
    if (subCommand.equalsIgnoreCase(getLocalizedString(COMMAND_ON))) {
      processOnCommand(commandSender);
    }
 else     if (subCommand.equalsIgnoreCase(getLocalizedString(COMMAND_OFF))) {
      processOffCommand(commandSender);
    }
 else     if (subCommand.equalsIgnoreCase(getLocalizedString(COMMAND_OPACITY))) {
      processOpacityCommand(commandSender,args);
    }
 else     if (subCommand.equalsIgnoreCase(getLocalizedString(COMMAND_SCALE))) {
      processScaleCommand(commandSender,args);
    }
 else     if (subCommand.equalsIgnoreCase(getLocalizedString(COMMAND_POSITION))) {
      processPositionCommand(commandSender,args);
    }
 else {
      throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_USAGE),new Object[0]);
    }
  }
 else {
    throw new WrongUsageException(getLocalizedString(COMMAND_OVERLAY_USAGE),new Object[0]);
  }
}
Program: 157108
Project: 157108
Buggy source:
private static void processOffCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_PARTICLE_FX=false;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME,"String_Node_Str");
  commandSender.sendChatToPlayer("String_Node_Str");
}

Fixed version (ground truth):
private static void processOffCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_PARTICLE_FX=false;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME,FALSE);
  commandSender.sendChatToPlayer(getLocalizedString(COMMAND_PARTICLES_TURNED_OFF));
}
Program: 157109
Project: 157109
Buggy source:
private static void processOnCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_PARTICLE_FX=true;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME,"String_Node_Str");
  commandSender.sendChatToPlayer("String_Node_Str");
}

Fixed version (ground truth):
private static void processOnCommand(ICommandSender commandSender){
  ConfigurationSettings.ENABLE_PARTICLE_FX=true;
  ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS,ConfigurationSettings.ENABLE_PARTICLE_FX_CONFIGNAME,TRUE);
  commandSender.sendChatToPlayer(getLocalizedString(COMMAND_PARTICLES_TURNED_ON));
}
Program: 157110
Project: 157110
Buggy source:
public static void processCommand(ICommandSender commandSender,String[] args){
  String subCommand;
  if (args.length > 0) {
    subCommand=args[0];
    if (subCommand.toLowerCase().equals("String_Node_Str")) {
      processOnCommand(commandSender);
    }
 else     if (subCommand.toLowerCase().equals("String_Node_Str")) {
      processOffCommand(commandSender);
    }
 else {
      throw new WrongUsageException("String_Node_Str",new Object[0]);
    }
  }
 else {
    throw new WrongUsageException("String_Node_Str",new Object[0]);
  }
}

Fixed version (ground truth):
public static void processCommand(ICommandSender commandSender,String[] args){
  String subCommand;
  if (args.length > 0) {
    subCommand=args[0];
    if (subCommand.toLowerCase().equals(getLocalizedString(COMMAND_ON))) {
      processOnCommand(commandSender);
    }
 else     if (subCommand.toLowerCase().equals(getLocalizedString(COMMAND_OFF))) {
      processOffCommand(commandSender);
    }
 else {
      throw new WrongUsageException(getLocalizedString(COMMAND_PARTICLES_USAGE),new Object[0]);
    }
  }
 else {
    throw new WrongUsageException(getLocalizedString(COMMAND_PARTICLES_USAGE),new Object[0]);
  }
}
Program: 157111
Project: 157111
Buggy source:
@ForgeSubscribe public void onWorldTransmutationEvent(WorldTransmutationEvent event){
  int id=event.world.getBlockId(event.x,event.y,event.z);
  int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
  Material material=event.world.getBlockMaterial(event.x,event.y,event.z);
  boolean result=false;
  if ((material == Material.leaves) && (id == Block.leaves.blockID)) {
    meta=meta & 4;
  }
 else   if ((material == Material.pumpkin) && (id == Block.pumpkin.blockID)) {
    meta=0;
  }
  ItemStack worldStack=new ItemStack(id,1,meta);
  ItemStack targetStack=new ItemStack(event.targetID,1,event.targetMeta);
  if (!worldStack.isItemEqual(targetStack)) {
    if (EquivalencyHandler.instance().areEquivalent(worldStack,targetStack)) {
      if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) {
        result=TransmutationHelper.transmuteInWorld(event.world,event.player,event.player.getCurrentEquippedItem(),event.x,event.y,event.z,event.targetID,event.targetMeta);
      }
    }
  }
  if (result) {
    event.actionResult=ActionResult.SUCCESS;
  }
 else {
    event.actionResult=ActionResult.FAILURE;
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onWorldTransmutationEvent(WorldTransmutationEvent event){
  int id=event.world.getBlockId(event.x,event.y,event.z);
  int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
  Material material=event.world.getBlockMaterial(event.x,event.y,event.z);
  boolean result=false;
  if ((material == Material.leaves) && (id == Block.leaves.blockID)) {
    meta=meta & 4;
  }
 else   if ((material == Material.pumpkin) && (id == Block.pumpkin.blockID)) {
    meta=0;
  }
  ItemStack worldStack=new ItemStack(id,1,meta);
  ItemStack targetStack=new ItemStack(event.targetID,1,event.targetMeta);
  if (!worldStack.isItemEqual(targetStack)) {
    if (EquivalencyHandler.instance().areWorldEquivalent(worldStack,targetStack)) {
      if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) {
        result=TransmutationHelper.transmuteInWorld(event.world,event.player,event.player.getCurrentEquippedItem(),event.x,event.y,event.z,event.targetID,event.targetMeta);
      }
    }
  }
  if (result) {
    event.actionResult=ActionResult.SUCCESS;
  }
 else {
    event.actionResult=ActionResult.FAILURE;
  }
}
Program: 157112
Project: 157112
Buggy source:
@Override public void keyDown(EnumSet<TickType> types,KeyBinding kb,boolean tickEnd,boolean isRepeat){
  if (tickEnd) {
    if (FMLClientHandler.instance().getClient().inGameHasFocus) {
      EntityPlayer player=FMLClientHandler.instance().getClient().thePlayer;
      if (player != null) {
        ItemStack currentItem=FMLClientHandler.instance().getClient().thePlayer.getCurrentEquippedItem();
        if (currentItem != null) {
          if (currentItem.getItem() instanceof IKeyBound) {
            PacketDispatcher.sendPacketToServer(PacketTypeHandler.populatePacket(new PacketKeyPressed(kb.keyDescription)));
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void keyDown(EnumSet<TickType> types,KeyBinding kb,boolean tickEnd,boolean isRepeat){
  if (tickEnd) {
    if (FMLClientHandler.instance().getClient().inGameHasFocus) {
      EntityPlayer player=FMLClientHandler.instance().getClient().thePlayer;
      if (player != null) {
        ItemStack currentItem=FMLClientHandler.instance().getClient().thePlayer.getCurrentEquippedItem();
        if (currentItem != null) {
          if (currentItem.getItem() instanceof IKeyBound) {
            if (!KeyBindingHelper.isClientSided(kb.keyDescription)) {
              PacketDispatcher.sendPacketToServer(PacketTypeHandler.populatePacket(new PacketKeyPressed(kb.keyDescription)));
            }
 else {
              ((IKeyBound)currentItem.getItem()).doKeyBindingAction(player,currentItem,kb.keyDescription);
            }
          }
        }
      }
    }
  }
}
Program: 157113
Project: 157113
Buggy source:
@Override public boolean onItemUse(ItemStack itemStack,EntityPlayer entityPlayer,World world,int x,int y,int z,int sideHit,float hitVecX,float hitVecY,float hitVecZ){
  transmuteBlocks(itemStack,entityPlayer,world,x,y,z,sideHit);
  return true;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack itemStack,EntityPlayer entityPlayer,World world,int x,int y,int z,int sideHit,float hitVecX,float hitVecY,float hitVecZ){
  transmuteBlock(itemStack,entityPlayer,world,x,y,z,sideHit);
  return true;
}
Program: 157114
Project: 157114
Buggy source:
@Override public boolean onItemUse(ItemStack itemStack,EntityPlayer entityPlayer,World world,int x,int y,int z,int sideHit,float hitVecX,float hitVecY,float hitVecZ){
  transmuteBlocks(itemStack,entityPlayer,world,x,y,z,sideHit);
  return true;
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack itemStack,EntityPlayer entityPlayer,World world,int x,int y,int z,int sideHit,float hitVecX,float hitVecY,float hitVecZ){
  transmuteBlock(itemStack,entityPlayer,world,x,y,z,sideHit);
  return true;
}
Program: 157115
Project: 157115
Buggy source:
@ForgeSubscribe public void onWorldTransmutationEvent(WorldTransmutationEvent event){
  int id=event.world.getBlockId(event.x,event.y,event.z);
  int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
  Material material=event.world.getBlockMaterial(event.x,event.y,event.z);
  boolean result=false;
  if ((material == Material.leaves) && (id == Block.leaves.blockID)) {
    meta=meta & 4;
  }
 else   if ((material == Material.pumpkin) && (id == Block.pumpkin.blockID)) {
    meta=0;
  }
  ItemStack worldStack=new ItemStack(id,1,meta);
  ItemStack targetStack=new ItemStack(event.targetID,1,event.targetMeta);
  if (!worldStack.isItemEqual(targetStack)) {
    if (EquivalencyHandler.instance().areEquivalent(worldStack,targetStack)) {
      if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) {
        result=TransmutationHelper.transmuteInWorld(event.world,event.player,event.player.getCurrentEquippedItem(),event.x,event.y,event.z,event.targetID,event.targetMeta);
      }
    }
  }
  if (result) {
    event.actionResult=ActionResult.SUCCESS;
  }
 else {
    event.actionResult=ActionResult.FAILURE;
  }
}

Fixed version (ground truth):
@ForgeSubscribe public void onWorldTransmutationEvent(WorldTransmutationEvent event){
  int id=event.world.getBlockId(event.x,event.y,event.z);
  int meta=event.world.getBlockMetadata(event.x,event.y,event.z);
  Material material=event.world.getBlockMaterial(event.x,event.y,event.z);
  boolean result=false;
  if ((material == Material.leaves) && (id == Block.leaves.blockID)) {
    meta=meta & 4;
  }
 else   if ((material == Material.pumpkin) && (id == Block.pumpkin.blockID)) {
    meta=0;
  }
  ItemStack worldStack=new ItemStack(id,1,meta);
  ItemStack targetStack=new ItemStack(event.targetID,1,event.targetMeta);
  if (!worldStack.isItemEqual(targetStack)) {
    if (EquivalencyHandler.instance().areWorldEquivalent(worldStack,targetStack)) {
      if (event.itemStack.getItemDamage() < event.itemStack.getMaxDamage()) {
        result=TransmutationHelper.transmuteInWorld(event.world,event.player,event.player.getCurrentEquippedItem(),event.x,event.y,event.z,event.targetID,event.targetMeta);
      }
    }
  }
  if (result) {
    event.actionResult=ActionResult.SUCCESS;
  }
 else {
    event.actionResult=ActionResult.FAILURE;
  }
}
Program: 157118
Project: 157118
Buggy source:
@PreInit public void preInit(FMLPreInitializationEvent event){
  LogHelper.init();
  LocalizationHandler.loadLanguages();
  ConfigurationHandler.init(event.getSuggestedConfigurationFile());
  if (ConfigurationSettings.ENABLE_VERSION_CHECK) {
    VersionHelper.checkVersion();
  }
  VersionHelper.logResult();
  TickRegistry.registerTickHandler(new VersionCheckTickHandler(),Side.CLIENT);
  TickRegistry.registerTickHandler(new RenderTickHandler(),Side.CLIENT);
  proxy.registerKeyBindingHandler();
  proxy.registerSoundHandler();
}

Fixed version (ground truth):
@PreInit public void preInit(FMLPreInitializationEvent event){
  LogHelper.init();
  LocalizationHandler.loadLanguages();
  ConfigurationHandler.init(event.getSuggestedConfigurationFile());
  if (ConfigurationSettings.ENABLE_VERSION_CHECK) {
    VersionHelper.checkVersion();
  }
  VersionHelper.logResult();
  TickRegistry.registerTickHandler(new VersionCheckTickHandler(),Side.CLIENT);
  proxy.registerRenderTickHandler();
  proxy.registerKeyBindingHandler();
  proxy.registerSoundHandler();
}