nus-yam/ex-repair huggingface dataset:
Program: 117118
Project: 117118
Buggy source:
/** 
 * Checks if the stored   {@code Map} has a given {@code size}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not have the given {@code size}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 */
public void toHaveSize(final int size){
  expectNotNull(this.getValue(),"String_Node_Str",size);
  expectTrue(this.getValue().size() == size,"String_Node_Str",this.getValue(),size,this.getValue().size());
}

Fixed version (ground truth):
/** 
 * Checks if the stored   {@code Map} has a given {@code size}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not have the given {@code size}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 * @param size the expected size
 */
public void toHaveSize(final int size){
  expectNotNull(this.getValue(),"String_Node_Str",size);
  expectTrue(this.getValue().size() == size,"String_Node_Str",this.getValue(),size,this.getValue().size());
}
Program: 117119
Project: 117119
Buggy source:
/** 
 * Checks if the stored   {@code Map} contains the given {@code key}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not contain the given {@code key}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 */
public void toContainKey(final K key){
  expectNotNull(this.getValue(),"String_Node_Str",key);
  expectTrue(this.getValue().containsKey(key),"String_Node_Str",this.getValue(),key);
}

Fixed version (ground truth):
/** 
 * Checks if the stored   {@code Map} contains the given {@code key}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not contain the given {@code key}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 * @param key the expected key
 */
public void toContainKey(final K key){
  expectNotNull(this.getValue(),"String_Node_Str",key);
  expectTrue(this.getValue().containsKey(key),"String_Node_Str",this.getValue(),key);
}
Program: 117120
Project: 117120
Buggy source:
/** 
 * Checks if the stored   {@code Map} does not contain the given {@code value}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not contain the given {@code value}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 */
public void toNotContainValue(final V value){
  expectNotNull(this.getValue(),"String_Node_Str",value);
  expectTrue(!this.getValue().containsValue(value),"String_Node_Str",this.getValue(),value);
}

Fixed version (ground truth):
/** 
 * Checks if the stored   {@code Map} does not contain the given {@code value}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not contain the given {@code value}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 * @param value the expected value
 */
public void toNotContainValue(final V value){
  expectNotNull(this.getValue(),"String_Node_Str",value);
  expectTrue(!this.getValue().containsValue(value),"String_Node_Str",this.getValue(),value);
}
Program: 117121
Project: 117121
Buggy source:
/** 
 * Checks if the stored   {@code Map} contains the given {@code value}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not contain the given {@code value}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 */
public void toContainValue(final V value){
  expectNotNull(this.getValue(),"String_Node_Str",value);
  expectTrue(this.getValue().containsValue(value),"String_Node_Str",this.getValue(),value);
}

Fixed version (ground truth):
/** 
 * Checks if the stored   {@code Map} contains the given {@code value}. <p>This method throws an   {@code AssertionError} if<ul> <li>the stored  {@code Map} does not contain the given {@code value}</li> <li>the stored   {@code Map} is {@code null}</li> </ul>
 * @param value the expected value
 */
public void toContainValue(final V value){
  expectNotNull(this.getValue(),"String_Node_Str",value);
  expectTrue(this.getValue().containsValue(value),"String_Node_Str",this.getValue(),value);
}
Program: 117122
Project: 117122
Buggy source:
/** 
 * Checks if the stored value is an instance of the   {@code expectedClass}<p>This method throws an   {@code AssertionError} if the stored value is not of instance of {@code expectedClass}.
 * @param expectedClass
 */
public void toBeInstanceOf(Class<?> expectedClass){
  expectTrue(expectedClass.isInstance(value),"String_Node_Str",this.value,expectedClass.getName());
}

Fixed version (ground truth):
/** 
 * Checks if the stored value is an instance of the   {@code expectedClass}<p>This method throws an   {@code AssertionError} if the stored value is not of instance of {@code expectedClass}.
 * @param expectedClass The expected class
 */
public void toBeInstanceOf(Class<?> expectedClass){
  expectTrue(expectedClass.isInstance(value),"String_Node_Str",this.value,expectedClass.getName());
}
Program: 117123
Project: 117123
Buggy source:
/** 
 * Checks if an exception of type   {@code expectedExceptionClass} with message {@code expectedMessage} was thrown.<p>This method throws an  {@code AssertionError} if:<ul> <li>no exception was thrown.</li> <li>the thrown exception is not an instance of  {@code expectedExceptionClass}</li> <li>the message of the thrown exception is not equal   {@code expectedMessage}</li> </ul>
 * @param expectedExceptionClass the expected exception
 * @param expectedMessage the expected message
 */
public <T extends Exception>void toThrow(Class<T> expectedExceptionClass,String expectedMessage){
  Arguments.ensureNotNull(expectedMessage,"String_Node_Str");
  this.toThrow(expectedExceptionClass);
  String exceptionMessage=this.exception.getMessage();
  Expectations.expectTrue(expectedMessage.equals(exceptionMessage),"String_Node_Str",exceptionMessage,exceptionMessage);
}

Fixed version (ground truth):
/** 
 * Checks if an exception of type   {@code expectedExceptionClass} with message {@code expectedMessage} was thrown.<p>This method throws an  {@code AssertionError} if:<ul> <li>no exception was thrown.</li> <li>the thrown exception is not an instance of  {@code expectedExceptionClass}</li> <li>the message of the thrown exception is not equal   {@code expectedMessage}</li> </ul>
 * @param expectedExceptionClass the expected exception
 * @param expectedMessage the expected message
 */
public <T extends Exception>void toThrow(Class<T> expectedExceptionClass,String expectedMessage){
  Arguments.ensureNotNull(expectedMessage,"String_Node_Str");
  this.toThrow(expectedExceptionClass);
  String exceptionMessage=this.exception.getMessage();
  Expectations.expectTrue(expectedMessage.equals(exceptionMessage),"String_Node_Str",expectedMessage,exceptionMessage);
}
Program: 117124
Project: 117124
Buggy source:
/** 
 * Gets the stack in the fusion crafting core. Also known as the crafting catalyst.<br> slot 0 = Input Slot<br> slot 1 == output slot
 */
ItemStack getStackInCore(int slot);

Fixed version (ground truth):
/** 
 * Gets the stack in the fusion crafting core. Also known as the crafting catalyst.<br> slot 0 = Input Slot<br> slot 1 == output slot
 */
@Nonnull ItemStack getStackInCore(int slot);
Program: 117125
Project: 117125
Buggy source:
/** 
 * Sets the stack in the specified slot.<br> slot 0 = Input Slot<br> slot 1 == output slot
 */
void setStackInCore(int slot,ItemStack stack);

Fixed version (ground truth):
/** 
 * Sets the stack in the specified slot.<br> slot 0 = Input Slot<br> slot 1 == output slot
 */
void setStackInCore(int slot,@Nonnull ItemStack stack);
Program: 117126
Project: 117126
Buggy source:
@Override public void craft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!matches(inventory,world,pos)) {
    return;
  }
  List<ICraftingPedestal> pedestals=new ArrayList<>();
  pedestals.addAll(inventory.getPedestals());
  for (  Object ingredient : ingredients) {
    for (    ICraftingPedestal pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal()) && pedestal.getPedestalTier() >= craftingTier) {
        ItemStack stack=pedestal.getStackInPedestal();
        if (stack.getItem().hasContainerItem(stack)) {
          stack=stack.getItem().getContainerItem(stack);
        }
 else {
          stack.shrink(1);
          if (stack.getCount() <= 0) {
            stack=ItemStack.EMPTY;
          }
        }
        pedestal.setStackInPedestal(stack);
        pedestals.remove(pedestal);
        break;
      }
    }
  }
  ItemStack catalyst=inventory.getStackInCore(0);
  catalyst.shrink(this.catalyst.getCount());
  if (catalyst.getCount() <= 0) {
    catalyst=ItemStack.EMPTY;
  }
  inventory.setStackInCore(0,catalyst);
  inventory.setStackInCore(1,result.copy());
}

Fixed version (ground truth):
@Override public void craft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!matches(inventory,world,pos)) {
    return;
  }
  List<ICraftingInjector> pedestals=new ArrayList<>();
  pedestals.addAll(inventory.getInjectors());
  for (  Object ingredient : ingredients) {
    for (    ICraftingInjector pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal()) && pedestal.getPedestalTier() >= craftingTier) {
        ItemStack stack=pedestal.getStackInPedestal();
        if (stack.getItem().hasContainerItem(stack)) {
          stack=stack.getItem().getContainerItem(stack);
        }
 else {
          stack.shrink(1);
          if (stack.getCount() <= 0) {
            stack=ItemStack.EMPTY;
          }
        }
        pedestal.setStackInPedestal(stack);
        pedestals.remove(pedestal);
        break;
      }
    }
  }
  ItemStack catalyst=inventory.getStackInCore(0);
  catalyst.shrink(this.catalyst.getCount());
  if (catalyst.getCount() <= 0) {
    catalyst=ItemStack.EMPTY;
  }
  inventory.setStackInCore(0,catalyst);
  inventory.setStackInCore(1,result.copy());
}
Program: 117127
Project: 117127
Buggy source:
@Override public String canCraft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!inventory.getStackInCore(1).isEmpty()) {
    return "String_Node_Str";
  }
  List<ICraftingPedestal> pedestals=new ArrayList<ICraftingPedestal>();
  pedestals.addAll(inventory.getPedestals());
  for (  ICraftingPedestal pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && pedestal.getPedestalTier() < craftingTier) {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String canCraft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!inventory.getStackInCore(1).isEmpty()) {
    return "String_Node_Str";
  }
  List<ICraftingInjector> pedestals=new ArrayList<ICraftingInjector>();
  pedestals.addAll(inventory.getInjectors());
  for (  ICraftingInjector pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && pedestal.getPedestalTier() < craftingTier) {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}
Program: 117128
Project: 117128
Buggy source:
@Override public boolean matches(IFusionCraftingInventory inventory,World world,BlockPos pos){
  List<ICraftingPedestal> pedestals=new ArrayList<ICraftingPedestal>();
  pedestals.addAll(inventory.getPedestals());
  if (inventory.getStackInCore(0).isEmpty() || !inventory.getStackInCore(0).isItemEqual(catalyst) || inventory.getStackInCore(0).getCount() < catalyst.getCount()) {
    return false;
  }
  if (catalyst.hasTagCompound() && !ItemStack.areItemStackTagsEqual(catalyst,inventory.getStackInCore(0))) {
    return false;
  }
  for (  Object ingredient : ingredients) {
    boolean foundIngredient=false;
    for (    ICraftingPedestal pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal())) {
        ItemStack i=OreDictHelper.resolveObject(ingredient);
        if (i.hasTagCompound() && !ItemStack.areItemStackTagsEqual(i,pedestal.getStackInPedestal())) {
          continue;
        }
        foundIngredient=true;
        pedestals.remove(pedestal);
        break;
      }
    }
    if (!foundIngredient) {
      return false;
    }
  }
  for (  ICraftingPedestal pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty()) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean matches(IFusionCraftingInventory inventory,World world,BlockPos pos){
  List<ICraftingInjector> pedestals=new ArrayList<ICraftingInjector>();
  pedestals.addAll(inventory.getInjectors());
  if (inventory.getStackInCore(0).isEmpty() || !inventory.getStackInCore(0).isItemEqual(catalyst) || inventory.getStackInCore(0).getCount() < catalyst.getCount()) {
    return false;
  }
  if (catalyst.hasTagCompound() && !ItemStack.areItemStackTagsEqual(catalyst,inventory.getStackInCore(0))) {
    return false;
  }
  for (  Object ingredient : ingredients) {
    boolean foundIngredient=false;
    for (    ICraftingInjector pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal())) {
        ItemStack i=OreDictHelper.resolveObject(ingredient);
        if (i.hasTagCompound() && !ItemStack.areItemStackTagsEqual(i,pedestal.getStackInPedestal())) {
          continue;
        }
        foundIngredient=true;
        pedestals.remove(pedestal);
        break;
      }
    }
    if (!foundIngredient) {
      return false;
    }
  }
  for (  ICraftingInjector pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty()) {
      return false;
    }
  }
  return true;
}
Program: 117129
Project: 117129
Buggy source:
@Override public void craft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!matches(inventory,world,pos)) {
    return;
  }
  List<ICraftingPedestal> pedestals=new ArrayList<ICraftingPedestal>();
  pedestals.addAll(inventory.getPedestals());
  for (  Object ingredient : ingredients) {
    for (    ICraftingPedestal pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal()) && pedestal.getPedestalTier() >= craftingTier && !pedestal.getStackInPedestal().isItemEqual(upgradeKey)) {
        ItemStack stack=pedestal.getStackInPedestal();
        if (stack.getItem().hasContainerItem(stack)) {
          stack=stack.getItem().getContainerItem(stack);
        }
 else {
          stack.shrink(1);
          if (stack.getCount() <= 0) {
            stack=ItemStack.EMPTY;
          }
        }
        pedestal.setStackInPedestal(stack);
        pedestals.remove(pedestal);
        break;
      }
    }
  }
  ItemStack stack=inventory.getStackInCore(0);
  inventory.setStackInCore(0,ItemStack.EMPTY);
  UpgradeHelper.setUpgradeLevel(stack,upgrade,upgradeLevel);
  inventory.setStackInCore(1,stack);
}

Fixed version (ground truth):
@Override public void craft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!matches(inventory,world,pos)) {
    return;
  }
  List<ICraftingInjector> pedestals=new ArrayList<ICraftingInjector>();
  pedestals.addAll(inventory.getInjectors());
  for (  Object ingredient : ingredients) {
    for (    ICraftingInjector pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal()) && pedestal.getPedestalTier() >= craftingTier && !pedestal.getStackInPedestal().isItemEqual(upgradeKey)) {
        ItemStack stack=pedestal.getStackInPedestal();
        if (stack.getItem().hasContainerItem(stack)) {
          stack=stack.getItem().getContainerItem(stack);
        }
 else {
          stack.shrink(1);
          if (stack.getCount() <= 0) {
            stack=ItemStack.EMPTY;
          }
        }
        pedestal.setStackInPedestal(stack);
        pedestals.remove(pedestal);
        break;
      }
    }
  }
  ItemStack stack=inventory.getStackInCore(0);
  inventory.setStackInCore(0,ItemStack.EMPTY);
  UpgradeHelper.setUpgradeLevel(stack,upgrade,upgradeLevel);
  inventory.setStackInCore(1,stack);
}
Program: 117130
Project: 117130
Buggy source:
@Override public String canCraft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!isRecipeCatalyst(inventory.getStackInCore(0))) {
    return "String_Node_Str";
  }
  if (!inventory.getStackInCore(1).isEmpty()) {
    return "String_Node_Str";
  }
  IUpgradableItem item=(IUpgradableItem)inventory.getStackInCore(0).getItem();
  if (item.getMaxUpgradeLevel(inventory.getStackInCore(0),upgrade) < upgradeLevel) {
    return "String_Node_Str";
  }
  if (UpgradeHelper.getUpgradeLevel(inventory.getStackInCore(0),upgrade) >= upgradeLevel) {
    return "String_Node_Str";
  }
  if (UpgradeHelper.getUpgradeLevel(inventory.getStackInCore(0),upgrade) < upgradeLevel - 1) {
    return "String_Node_Str";
  }
  List<ICraftingPedestal> pedestals=new ArrayList<ICraftingPedestal>();
  pedestals.addAll(inventory.getPedestals());
  for (  ICraftingPedestal pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && pedestal.getPedestalTier() < craftingTier) {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String canCraft(IFusionCraftingInventory inventory,World world,BlockPos pos){
  if (!isRecipeCatalyst(inventory.getStackInCore(0))) {
    return "String_Node_Str";
  }
  if (!inventory.getStackInCore(1).isEmpty()) {
    return "String_Node_Str";
  }
  IUpgradableItem item=(IUpgradableItem)inventory.getStackInCore(0).getItem();
  if (item.getMaxUpgradeLevel(inventory.getStackInCore(0),upgrade) < upgradeLevel) {
    return "String_Node_Str";
  }
  if (UpgradeHelper.getUpgradeLevel(inventory.getStackInCore(0),upgrade) >= upgradeLevel) {
    return "String_Node_Str";
  }
  if (UpgradeHelper.getUpgradeLevel(inventory.getStackInCore(0),upgrade) < upgradeLevel - 1) {
    return "String_Node_Str";
  }
  List<ICraftingInjector> pedestals=new ArrayList<ICraftingInjector>();
  pedestals.addAll(inventory.getInjectors());
  for (  ICraftingInjector pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && pedestal.getPedestalTier() < craftingTier) {
      return "String_Node_Str";
    }
  }
  return "String_Node_Str";
}
Program: 117131
Project: 117131
Buggy source:
@Override public boolean matches(IFusionCraftingInventory inventory,World world,BlockPos pos){
  List<ICraftingPedestal> pedestals=new ArrayList<ICraftingPedestal>();
  pedestals.addAll(inventory.getPedestals());
  if (!isRecipeCatalyst(inventory.getStackInCore(0))) {
    return false;
  }
  boolean flag=false;
  for (  ICraftingPedestal pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && upgradeKey.isItemEqual(pedestal.getStackInPedestal())) {
      flag=true;
      break;
    }
  }
  if (!flag) {
    return false;
  }
  for (  Object ingredient : ingredients) {
    flag=false;
    for (    ICraftingPedestal pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal())) {
        flag=true;
        pedestals.remove(pedestal);
        break;
      }
    }
    if (!flag) {
      return false;
    }
  }
  for (  ICraftingPedestal pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && !pedestal.getStackInPedestal().isItemEqual(upgradeKey)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean matches(IFusionCraftingInventory inventory,World world,BlockPos pos){
  List<ICraftingInjector> pedestals=new ArrayList<ICraftingInjector>();
  pedestals.addAll(inventory.getInjectors());
  if (!isRecipeCatalyst(inventory.getStackInCore(0))) {
    return false;
  }
  boolean flag=false;
  for (  ICraftingInjector pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && upgradeKey.isItemEqual(pedestal.getStackInPedestal())) {
      flag=true;
      break;
    }
  }
  if (!flag) {
    return false;
  }
  for (  Object ingredient : ingredients) {
    flag=false;
    for (    ICraftingInjector pedestal : pedestals) {
      if (!pedestal.getStackInPedestal().isEmpty() && OreDictHelper.areStacksEqual(ingredient,pedestal.getStackInPedestal())) {
        flag=true;
        pedestals.remove(pedestal);
        break;
      }
    }
    if (!flag) {
      return false;
    }
  }
  for (  ICraftingInjector pedestal : pedestals) {
    if (!pedestal.getStackInPedestal().isEmpty() && !pedestal.getStackInPedestal().isItemEqual(upgradeKey)) {
      return false;
    }
  }
  return true;
}
Program: 117132
Project: 117132
Buggy source:
public static boolean isStackValid(ItemStack stack){
  if (stack.getItem() == Item.getItemFromBlock(DEFeatures.draconiumChest)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public static boolean isStackValid(ItemStack stack){
  if (stack.getItem() == Item.getItemFromBlock(DEFeatures.draconiumChest)) {
    return false;
  }
 else   if (!stack.isEmpty()) {
    String name=stack.getUnlocalizedName().toLowerCase();
    if (name.contains("String_Node_Str") || name.contains("String_Node_Str") || name.contains("String_Node_Str")|| name.contains("String_Node_Str")) {
      return false;
    }
  }
  return true;
}
Program: 117133
Project: 117133
Buggy source:
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer player,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  TileEntity tile=world.getTileEntity(pos);
  if (tile instanceof TileFusionCraftingCore) {
    ((TileFusionCraftingCore)tile).updatePedestals();
  }
  if (!world.isRemote) {
    FMLNetworkHandler.openGui(player,DraconicEvolution.instance,GuiHandler.GUIID_FUSION_CRAFTING,world,pos.getX(),pos.getY(),pos.getZ());
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer player,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  TileEntity tile=world.getTileEntity(pos);
  if (tile instanceof TileFusionCraftingCore) {
    ((TileFusionCraftingCore)tile).updateInjectors();
  }
  if (!world.isRemote) {
    FMLNetworkHandler.openGui(player,DraconicEvolution.instance,GuiHandler.GUIID_FUSION_CRAFTING,world,pos.getX(),pos.getY(),pos.getZ());
  }
  return true;
}
Program: 117134
Project: 117134
Buggy source:
public void neighborChanged(IBlockState state,World world,BlockPos pos,Block blockIn){
  if (!world.isRemote) {
    if (world.isBlockPowered(pos)) {
      TileEntity tile=world.getTileEntity(pos);
      if (tile instanceof TileFusionCraftingCore) {
        ((TileFusionCraftingCore)tile).attemptStartCrafting();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void neighborChanged(IBlockState state,World world,BlockPos pos,Block blockIn,BlockPos fromPos){
  if (!world.isRemote) {
    if (world.isBlockPowered(pos)) {
      TileEntity tile=world.getTileEntity(pos);
      if (tile instanceof TileFusionCraftingCore) {
        ((TileFusionCraftingCore)tile).attemptStartCrafting();
      }
    }
  }
}
Program: 117135
Project: 117135
Buggy source:
private boolean validateCraftingInventory(){
  if (getStackInPedestal() != null && currentCraftingInventory != null && currentCraftingInventory.craftingInProgress() && !((TileEntity)currentCraftingInventory).isInvalid()) {
    return true;
  }
  currentCraftingInventory=null;
  return false;
}

Fixed version (ground truth):
private boolean validateCraftingInventory(){
  if (!getStackInPedestal().isEmpty() && currentCraftingInventory != null && currentCraftingInventory.craftingInProgress() && !((TileEntity)currentCraftingInventory).isInvalid()) {
    return true;
  }
  currentCraftingInventory=null;
  return false;
}
Program: 117137
Project: 117137
Buggy source:
private void releaseShader(){
  if (DEShaders.useShaders() && DEConfig.useCrystalShaders) {
    shaderProgram.releaseShader();
  }
}

Fixed version (ground truth):
private void releaseShader(){
  if (DEShaders.useShaders() && DEConfig.useCrystalShaders && shaderProgram != null) {
    shaderProgram.releaseShader();
  }
}
Program: 117138
Project: 117138
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float f,int X,int Y){
  GL11.glColor4f(1,1,1,1);
  ResourceHelperDE.bindTexture(DETextures.GUI_GRINDER);
  drawTexturedModalRect(guiLeft,guiTop,0,0,xSize,ySize);
  float power=(float)tile.energySync.value / (float)tile.getMaxEnergyStored(EnumFacing.DOWN) * -1 + 1;
  drawTexturedModalRect(guiLeft + 68,guiTop + 12 + (int)(power * 40),xSize,(int)(power * 40),12,40 - (int)(power * 40));
  drawCenteredString(fontRendererObj,I18n.format(DEFeatures.grinder.getUnlocalizedName() + "String_Node_Str"),guiLeft + xSize / 2 + 2,guiTop,0x00FFFF);
  int x=X - guiLeft;
  int y=Y - guiTop;
  if (GuiHelper.isInRect(68,10,12,40,x,y)) {
    ArrayList<String> internal=new ArrayList<>();
    internal.add(I18n.format("String_Node_Str"));
    internal.add("String_Node_Str" + TextFormatting.DARK_BLUE + tile.energySync.value+ "String_Node_Str"+ tile.getMaxEnergyStored(EnumFacing.UP));
    drawHoveringText(internal,x + guiLeft,y + guiTop,fontRendererObj);
  }
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float f,int X,int Y){
  GlStateManager.color(1,1,1,1);
  ResourceHelperDE.bindTexture(DETextures.GUI_GRINDER);
  drawTexturedModalRect(guiLeft,guiTop,0,0,xSize,ySize);
  float power=(float)tile.energySync.value / (float)tile.getMaxEnergyStored(EnumFacing.DOWN) * -1 + 1;
  drawTexturedModalRect(guiLeft + 68,guiTop + 12 + (int)(power * 40),xSize,(int)(power * 40),12,40 - (int)(power * 40));
  drawCenteredString(fontRendererObj,I18n.format(DEFeatures.grinder.getUnlocalizedName() + "String_Node_Str"),guiLeft + xSize / 2 + 2,guiTop,0x00FFFF);
  int x=X - guiLeft;
  int y=Y - guiTop;
  if (GuiHelper.isInRect(68,10,12,40,x,y)) {
    ArrayList<String> internal=new ArrayList<>();
    internal.add(I18n.format("String_Node_Str"));
    internal.add("String_Node_Str" + TextFormatting.DARK_BLUE + tile.energySync.value+ "String_Node_Str"+ tile.getMaxEnergyStored(EnumFacing.UP));
    drawHoveringText(internal,x + guiLeft,y + guiTop,fontRendererObj);
  }
}
Program: 117140
Project: 117140
Buggy source:
@Override public void render(Entity entity,float rotation,float brightness,float invRender,float f3,float f4,float f5){
  GL11.glPushMatrix();
  this.basePlate.render(f5);
  GL11.glRotatef(rotation,0F,0F,1F);
  this.hub1.render(f5);
  GL11.glRotatef(rotation * 2F,0F,0F,-1F);
  this.hub2.render(f5);
  float lastBrightnessX=OpenGlHelper.lastBrightnessX;
  float lastBrightnessY=OpenGlHelper.lastBrightnessY;
  float b=brightness * 200F;
  float colour=Math.min(2F,(brightness * 2F) + 0.1F);
  OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,Math.min(200F,lastBrightnessX + b),Math.min(200F,lastBrightnessY + b));
  if (brightness > 0F && invRender == 0) {
    GL11.glDisable(GL11.GL_LIGHTING);
  }
  GL11.glColor4f(colour,colour,colour,1F);
  this.rotor2R.render(f5);
  GL11.glRotatef(rotation * 2F,0F,0F,1F);
  this.rotor1R.render(f5);
  GL11.glColor4f(1F,1F,1F,1F);
  OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,lastBrightnessX,lastBrightnessY);
  if (brightness > 0F && invRender == 0) {
    GL11.glEnable(GL11.GL_LIGHTING);
  }
  GL11.glPopMatrix();
}

Fixed version (ground truth):
@Override public void render(Entity entity,float rotation,float brightness,float invRender,float f3,float f4,float f5){
  GlStateManager.pushMatrix();
  this.basePlate.render(f5);
  GlStateManager.rotate(rotation,0F,0F,1F);
  this.hub1.render(f5);
  GlStateManager.rotate(rotation * 2F,0F,0F,-1F);
  this.hub2.render(f5);
  float lastBrightnessX=OpenGlHelper.lastBrightnessX;
  float lastBrightnessY=OpenGlHelper.lastBrightnessY;
  float b=brightness * 200F;
  float colour=Math.min(2F,(brightness * 2F) + 0.1F);
  OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,Math.min(200F,lastBrightnessX + b),Math.min(200F,lastBrightnessY + b));
  if (brightness > 0F && invRender == 0) {
    GlStateManager.disableLighting();
  }
  GlStateManager.color(colour,colour,colour,1F);
  this.rotor2R.render(f5);
  GlStateManager.rotate(rotation * 2F,0F,0F,1F);
  this.rotor1R.render(f5);
  GlStateManager.rotate(1F,1F,1F,1F);
  OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,lastBrightnessX,lastBrightnessY);
  if (brightness > 0F && invRender == 0) {
    GlStateManager.enableLighting();
  }
  GlStateManager.popMatrix();
}
Program: 117141
Project: 117141
Buggy source:
@Override public Pair<? extends IBakedModel,Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType){
  return MapWrapper.handlePerspective(this,TransformUtils.DEFAULT_ITEM.getTransforms(),cameraTransformType);
}

Fixed version (ground truth):
@Override public Pair<? extends IBakedModel,Matrix4f> handlePerspective(ItemStack stack,ItemCameraTransforms.TransformType cameraTransformType){
  return IPerspectiveAwareModel.MapWrapper.handlePerspective(this,TransformUtils.DEFAULT_ITEM.getTransforms(),cameraTransformType);
}
Program: 117142
Project: 117142
Buggy source:
@Override public void renderItem(ItemStack item,ItemCameraTransforms.TransformType transformType){
  Minecraft mc=Minecraft.getMinecraft();
  GlStateManager.pushMatrix();
  GlStateManager.translate(0.5,0.5,0.5);
  mc.getRenderItem().renderItem(stack,ItemCameraTransforms.TransformType.FIXED);
  if (DEShaders.useShaders()) {
    if (shaderProgram == null) {
      shaderProgram=new ShaderProgram();
      shaderProgram.attachShader(DEShaders.reactorShield);
    }
    shaderProgram.useShader(cache -> {
      cache.glUniform1F("String_Node_Str",((float)ClientEventHandler.elapsedTicks + mc.getRenderPartialTicks()) / -100F);
      cache.glUniform1F("String_Node_Str",0.09F);
    }
);
    mc.getRenderItem().renderItem(stack,ItemCameraTransforms.TransformType.FIXED);
    shaderProgram.useShader(cache -> {
      cache.glUniform1F("String_Node_Str",((float)ClientEventHandler.elapsedTicks + mc.getRenderPartialTicks()) / 100F);
      cache.glUniform1F("String_Node_Str",0.02F);
    }
);
    mc.getRenderItem().renderItem(stack,ItemCameraTransforms.TransformType.FIXED);
    shaderProgram.releaseShader();
  }
  GlStateManager.popMatrix();
}

Fixed version (ground truth):
@Override public void renderItem(ItemStack item,ItemCameraTransforms.TransformType transformType){
  Minecraft mc=Minecraft.getMinecraft();
  GlStateManager.pushMatrix();
  GlStateManager.translate(0.5,0.5,0.5);
  if (transformType == ItemCameraTransforms.TransformType.FIXED) {
    GlStateManager.rotate(180,0,1,0);
  }
  renderSkull();
  if (DEShaders.useShaders()) {
    if (shaderProgram == null) {
      shaderProgram=new ShaderProgram();
      shaderProgram.attachShader(DEShaders.reactorShield);
    }
    shaderProgram.useShader(cache -> {
      cache.glUniform1F("String_Node_Str",((float)ClientEventHandler.elapsedTicks + mc.getRenderPartialTicks()) / -100F);
      cache.glUniform1F("String_Node_Str",0.09F);
    }
);
    renderSkull();
    shaderProgram.useShader(cache -> {
      cache.glUniform1F("String_Node_Str",((float)ClientEventHandler.elapsedTicks + mc.getRenderPartialTicks()) / 100F);
      cache.glUniform1F("String_Node_Str",0.02F);
    }
);
    renderSkull();
    shaderProgram.releaseShader();
  }
  GlStateManager.popMatrix();
}
Program: 117143
Project: 117143
Buggy source:
@Override public void renderItem(ItemStack item,ItemCameraTransforms.TransformType transformType){
  CrystalType type=CrystalType.fromMeta(item.getItemDamage());
  int tier=CrystalType.getTier(item.getItemDamage());
  GlStateManager.pushMatrix();
  GlStateTracker.pushState();
  GlStateManager.disableLighting();
  CCRenderState ccrs=CCRenderState.instance();
  Matrix4 mat=RenderUtils.getMatrix(new Vector3(0.5,type == CrystalType.CRYSTAL_IO ? 0 : 0.5,0.5),new Rotation(0,0,0,0),1);
  ResourceHelperDE.bindTexture(DETextures.ENERGY_CRYSTAL_BASE);
  if (type == CrystalType.CRYSTAL_IO) {
    ccrs.startDrawing(GL11.GL_TRIANGLES,DefaultVertexFormats.POSITION_TEX);
    crystalBase.render(ccrs,mat);
    ccrs.draw();
    mat.apply(new Rotation((ClientEventHandler.elapsedTicks) / 400F,0,1,0));
    ResourceHelperDE.bindTexture(DETextures.REACTOR_CORE);
    bindShader(0,tier);
    ccrs.startDrawing(GL11.GL_TRIANGLES,DefaultVertexFormats.POSITION_TEX);
    crystalHalf.render(ccrs,mat);
    ccrs.draw();
    releaseShader();
  }
 else {
    bindShader(0,tier);
    ccrs.startDrawing(GL11.GL_TRIANGLES,DefaultVertexFormats.POSITION_TEX);
    crystalFull.render(ccrs,mat);
    ccrs.draw();
    releaseShader();
  }
  GlStateTracker.popState();
  GlStateManager.popMatrix();
}

Fixed version (ground truth):
@Override public void renderItem(ItemStack item,ItemCameraTransforms.TransformType transformType){
  CrystalType type=CrystalType.fromMeta(item.getItemDamage());
  int tier=CrystalType.getTier(item.getItemDamage());
  GlStateManager.pushMatrix();
  GlStateTracker.pushState();
  CCRenderState ccrs=CCRenderState.instance();
  Matrix4 mat=RenderUtils.getMatrix(new Vector3(0.5,type == CrystalType.CRYSTAL_IO ? 0 : 0.5,0.5),new Rotation(0,0,0,0),1);
  ResourceHelperDE.bindTexture(DETextures.ENERGY_CRYSTAL_BASE);
  if (type == CrystalType.CRYSTAL_IO) {
    ccrs.startDrawing(GL11.GL_TRIANGLES,DefaultVertexFormats.POSITION_TEX);
    crystalBase.render(ccrs,mat);
    ccrs.draw();
    mat.apply(new Rotation((ClientEventHandler.elapsedTicks) / 400F,0,1,0));
    ResourceHelperDE.bindTexture(DETextures.REACTOR_CORE);
    bindShader(0,tier);
    ccrs.startDrawing(GL11.GL_TRIANGLES,DefaultVertexFormats.POSITION_TEX);
    crystalHalf.render(ccrs,mat);
    ccrs.draw();
    releaseShader();
  }
 else {
    bindShader(0,tier);
    ccrs.startDrawing(GL11.GL_TRIANGLES,DefaultVertexFormats.POSITION_TEX);
    crystalFull.render(ccrs,mat);
    ccrs.draw();
    releaseShader();
  }
  GlStateTracker.popState();
  GlStateManager.popMatrix();
}
Program: 117144
Project: 117144
Buggy source:
@Override public void renderTileEntityAt(TileDislocatorPedestal te,double x,double y,double z,float partialTicks,int destroyStage){
  if (modelQuads == null) {
    modelQuads=Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(DEFeatures.dislocatorPedestal.getDefaultState()).getQuads(DEFeatures.dislocatorPedestal.getDefaultState(),null,0);
  }
  GlStateManager.pushMatrix();
  GlStateManager.translate(x + 0.5,y,z + 0.5);
  if (!te.getStackInSlot(0).isEmpty()) {
    GlStateManager.pushMatrix();
    GL11.glScalef(1F,-1F,-1F);
    drawNameString(te.getStackInSlot(0),0,te,partialTicks);
    GlStateManager.popMatrix();
  }
  GlStateManager.rotate(-te.rotation.value * 22.5F,0,1,0);
  GlStateManager.translate(-0.5,0,-0.5);
  TextureUtils.bindBlockTexture();
  ModelUtils.renderQuads(modelQuads);
  if (!te.getStackInSlot(0).isEmpty()) {
    GlStateManager.translate(0.5,0.79,0.52);
    GlStateManager.rotate(-67.5F,1,0,0);
    GlStateManager.scale(0.5F,0.5F,0.5F);
    renderItem(te.getStackInSlot(0));
  }
  GlStateManager.popMatrix();
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileDislocatorPedestal te,double x,double y,double z,float partialTicks,int destroyStage){
  if (modelQuads == null) {
    modelQuads=Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(DEFeatures.dislocatorPedestal.getDefaultState()).getQuads(DEFeatures.dislocatorPedestal.getDefaultState(),null,0);
  }
  GlStateManager.pushMatrix();
  GlStateManager.translate(x + 0.5,y,z + 0.5);
  if (!te.getStackInSlot(0).isEmpty()) {
    GlStateManager.pushMatrix();
    GlStateManager.scale(1F,-1F,-1F);
    drawNameString(te.getStackInSlot(0),0,te,partialTicks);
    GlStateManager.popMatrix();
  }
  GlStateManager.rotate(-te.rotation.value * 22.5F,0,1,0);
  GlStateManager.translate(-0.5,0,-0.5);
  TextureUtils.bindBlockTexture();
  ModelUtils.renderQuads(modelQuads);
  if (!te.getStackInSlot(0).isEmpty()) {
    GlStateManager.translate(0.5,0.79,0.52);
    GlStateManager.rotate(-67.5F,1,0,0);
    GlStateManager.scale(0.5F,0.5F,0.5F);
    renderItem(te.getStackInSlot(0));
  }
  GlStateManager.popMatrix();
}
Program: 117145
Project: 117145
Buggy source:
public static void stopLoading(EntityChaosGuardian guardian){
  if (!DEConfig.chaosGuardianLoading) {
    return;
  }
  if (!ticketList.containsKey(guardian)) {
    return;
  }
  ForgeChunkManager.releaseTicket(ticketList.get(guardian));
  ticketList.remove(guardian);
}

Fixed version (ground truth):
public static void stopLoading(EntityChaosGuardian guardian){
  if (!DEConfig.chaosGuardianLoading) {
    return;
  }
  if (!ticketList.containsKey(guardian)) {
    return;
  }
  Ticket ticket=ticketList.get(guardian);
  for (  ChunkPos pos : ticket.getChunkList()) {
    ForgeChunkManager.unforceChunk(ticket,pos);
    ((WorldServer)guardian.worldObj).getChunkProvider().unload(guardian.worldObj.getChunkFromChunkCoords(pos.chunkXPos,pos.chunkZPos));
  }
  ForgeChunkManager.releaseTicket(ticket);
  ticketList.remove(guardian);
}
Program: 117147
Project: 117147
Buggy source:
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack,World world,EntityPlayer player,EnumHand hand){
  if (!world.isRemote) {
  }
  MODES.clear();
  MODES.put(0,"String_Node_Str");
  MODES.put(1,"String_Node_Str");
  MODES.put(2,"String_Node_Str");
  MODES.put(3,"String_Node_Str");
  MODES.put(4,"String_Node_Str");
  MODES.put(5,"String_Node_Str");
  MODES.put(6,"String_Node_Str");
  MODES.put(7,"String_Node_Str");
  handleRightClick(itemStack,world,player,hand);
  return super.onItemRightClick(itemStack,world,player,hand);
}

Fixed version (ground truth):
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack,World world,EntityPlayer player,EnumHand hand){
  double posX=player.posX - (player.posX % 16) + 8;
  double posZ=player.posZ - (player.posZ % 16) + 8;
  player.setPosition(posX,player.posY,posZ);
  MODES.clear();
  MODES.put(0,"String_Node_Str");
  MODES.put(1,"String_Node_Str");
  MODES.put(2,"String_Node_Str");
  MODES.put(3,"String_Node_Str");
  MODES.put(4,"String_Node_Str");
  MODES.put(5,"String_Node_Str");
  MODES.put(6,"String_Node_Str");
  MODES.put(7,"String_Node_Str");
  handleRightClick(itemStack,world,player,hand);
  return super.onItemRightClick(itemStack,world,player,hand);
}
Program: 117150
Project: 117150
Buggy source:
private void killnextEnderman(){
  if (worldObj.isRemote) {
    return;
  }
  List<EntityEnderman> list=worldObj.getEntitiesWithinAABB(EntityEnderman.class,getEntityBoundingBox().expand(8,15,8),EntitySelectors.IS_ALIVE);
  LogHelper.dev(getEntityBoundingBox().expand(8,15,8));
  if (!list.isEmpty()) {
    EntityEnderman enderman=list.get(rand.nextInt(list.size()));
    enderman.captureDrops=true;
    Vec3D dirVec=Vec3D.getDirectionVec(new Vec3D(enderman),new Vec3D(0.5,67.5,0.5));
    enderman.motionX=dirVec.x;
    enderman.motionY=dirVec.y;
    enderman.motionZ=dirVec.z;
    enderman.attackEntityFrom(DamageSource.magic,10000F);
    soulsCollected++;
    BCEffectHandler.spawnFX(DEParticles.SOUL_EXTRACTION,worldObj,new Vec3D(enderman),new Vec3D(this),100);
  }
}

Fixed version (ground truth):
private void killnextEnderman(){
  if (worldObj.isRemote) {
    return;
  }
  List<EntityEnderman> list=worldObj.getEntitiesWithinAABB(EntityEnderman.class,getEntityBoundingBox().expand(8,15,8),EntitySelectors.IS_ALIVE);
  if (!list.isEmpty()) {
    EntityEnderman enderman=list.get(rand.nextInt(list.size()));
    enderman.captureDrops=true;
    Vec3D dirVec=Vec3D.getDirectionVec(new Vec3D(enderman),new Vec3D(0.5,exitPortalLocation.getY() + 0.5,0.5));
    enderman.motionX=dirVec.x;
    enderman.motionY=dirVec.y;
    enderman.motionZ=dirVec.z;
    enderman.attackEntityFrom(DamageSource.magic,10000F);
    soulsCollected++;
    BCEffectHandler.spawnFX(DEParticles.SOUL_EXTRACTION,worldObj,new Vec3D(enderman),new Vec3D(this),100);
  }
}
Program: 117155
Project: 117155
Buggy source:
public TileFusionCraftingCore(){
  setInventorySize(2);
  registerSyncableObject(isCrafting,false);
  registerSyncableObject(craftingStage,false);
  setShouldRefreshOnBlockChange();
}

Fixed version (ground truth):
public TileFusionCraftingCore(){
  setInventorySize(2);
  registerSyncableObject(isCrafting,true);
  registerSyncableObject(craftingStage,false);
  setShouldRefreshOnBlockChange();
}
Program: 117156
Project: 117156
Buggy source:
@Override public void fromBytes(ByteBuf buf){
  boolean isCompressed=buf.readBoolean();
  if (!isCompressed) {
    readBytes(buf);
    return;
  }
  Inflater inflater=new Inflater();
  try {
    int rawSize=buf.readInt();
    buf=buf.unwrap();
    byte[] rawBytes=new byte[rawSize];
    inflater.inflate(rawBytes);
    buf.clear();
    buf.ensureWritable(rawBytes.length + 8000,true);
    buf.writeBytes(rawBytes);
    buf.readerIndex(0);
    readBytes(buf);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new EncoderException(e);
  }
 finally {
    inflater.end();
  }
}

Fixed version (ground truth):
@Override public void fromBytes(ByteBuf buf){
  boolean isCompressed=buf.readBoolean();
  if (!isCompressed) {
    readBytes(buf);
    return;
  }
  Inflater inflater=new Inflater();
  try {
    int rawSize=buf.readInt();
    byte[] compressedBytes=new byte[buf.readableBytes()];
    buf.readBytes(compressedBytes);
    buf=Unpooled.buffer();
    inflater.setInput(compressedBytes);
    byte[] rawBytes=new byte[rawSize];
    inflater.inflate(rawBytes);
    buf.clear();
    buf.writeBytes(rawBytes);
    buf.readerIndex(0);
    readBytes(buf);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new EncoderException(e);
  }
 finally {
    inflater.end();
  }
}
Program: 117158
Project: 117158
Buggy source:
public void updateCriticalState(){
  if (!(worldObj instanceof WorldServer)) {
    return;
  }
  shieldCharge.value=worldObj.rand.nextInt(Math.max(1,(int)(maxShieldCharge.value * 0.01)));
  animExtractState.value=1;
  temperature.value=MathHelper.approachExp(temperature.value,MAX_TEMPERATURE * 1.2,0.0005);
  if (explosionProcess == null) {
    explosionProcess=new ProcessExplosion(pos,(int)Utils.map(convertedFuel.value + reactableFuel.value,144,10368,50,350),(WorldServer)worldObj,-1);
    ProcessHandler.addProcess(explosionProcess);
    explosionCountdown.value=-1;
    minExplosionDelay=1200 + worldObj.rand.nextInt(2400);
    return;
  }
  minExplosionDelay--;
  if (!explosionProcess.isCalculationComplete()) {
    return;
  }
  if (explosionCountdown.value == -1) {
    explosionCountdown.value=(60 * 20) + Math.max(0,minExplosionDelay);
  }
  if (explosionCountdown.value-- <= 0) {
    explosionProcess.detonate();
  }
}

Fixed version (ground truth):
public void updateCriticalState(){
  if (!(worldObj instanceof WorldServer)) {
    return;
  }
  shieldCharge.value=worldObj.rand.nextInt(Math.max(1,(int)(maxShieldCharge.value * 0.01)));
  animExtractState.value=1;
  temperature.value=MathHelper.approachExp(temperature.value,MAX_TEMPERATURE * 1.2,0.0005);
  if (explosionProcess == null) {
    explosionProcess=new ProcessExplosion(pos,(int)Utils.map(convertedFuel.value + reactableFuel.value,144,10368,50,350),(WorldServer)worldObj,-1);
    ProcessHandler.addProcess(explosionProcess);
    explosionCountdown.value=-1;
    minExplosionDelay=1200 + worldObj.rand.nextInt(2400);
    return;
  }
  minExplosionDelay--;
  if (!explosionProcess.isCalculationComplete()) {
    return;
  }
  if (explosionCountdown.value == -1) {
    explosionCountdown.value=(60 * 20) + Math.max(0,minExplosionDelay);
  }
  if (explosionCountdown.value > 200)   explosionCountdown.value=200;
  if (explosionCountdown.value-- <= 0) {
    explosionProcess.detonate();
  }
}
Program: 117159
Project: 117159
Buggy source:
public void removeBlock(BlockPos pos){
  if (!hasBlockStorage(pos) || isAirBlock(pos)) {
    return;
  }
  Chunk chunk=getChunk(pos);
  IBlockState oldState=chunk.getBlockState(pos);
  if (oldState.getBlock().hasTileEntity(oldState)) {
    serverWorld.setBlockToAir(pos);
    PlayerChunkMap playerChunkMap=serverWorld.getPlayerChunkMap();
    if (playerChunkMap != null) {
      PlayerChunkMapEntry watcher=playerChunkMap.getEntry(pos.getX() >> 4,pos.getZ() >> 4);
      if (watcher != null) {
        watcher.sendPacket(new SPacketBlockChange(serverWorld,pos));
      }
    }
  }
  setRecalcPrecipitationHeightMap(pos);
  ExtendedBlockStorage storage=getBlockStorage(pos);
  storage.set(pos.getX() & 15,pos.getY() & 15,pos.getZ() & 15,AIR);
  fireBlockBreak(pos,oldState);
  removeTileEntity(pos);
  setChunkModified(pos);
}

Fixed version (ground truth):
public void removeBlock(BlockPos pos){
  if (!hasBlockStorage(pos) || isAirBlock(pos)) {
    return;
  }
  Chunk chunk=getChunk(pos);
  IBlockState oldState=chunk.getBlockState(pos);
  if (oldState.getBlock().hasTileEntity(oldState)) {
    serverWorld.setBlockToAir(pos);
    PlayerChunkMap playerChunkMap=serverWorld.getPlayerChunkMap();
    if (playerChunkMap != null) {
      PlayerChunkMapEntry watcher=playerChunkMap.getEntry(pos.getX() >> 4,pos.getZ() >> 4);
      if (watcher != null) {
        watcher.sendPacket(new SPacketBlockChange(serverWorld,pos));
      }
    }
  }
  ExtendedBlockStorage storage=getBlockStorage(pos);
  storage.set(pos.getX() & 15,pos.getY() & 15,pos.getZ() & 15,AIR);
  fireBlockBreak(pos,oldState);
  setChunkModified(pos);
}
Program: 117160
Project: 117160
Buggy source:
private Chunk getChunk(BlockPos pos){
  return serverWorld.getChunkFromChunkCoords(pos.getX() >> 4,pos.getZ() >> 4);
}

Fixed version (ground truth):
private Chunk getChunk(BlockPos pos){
  ChunkPos cp=new ChunkPos(pos);
  if (!chunkCache.containsKey(cp)) {
    chunkCache.put(cp,serverWorld.getChunkFromChunkCoords(pos.getX() >> 4,pos.getZ() >> 4));
  }
  return chunkCache.get(cp);
}
Program: 117161
Project: 117161
Buggy source:
/** 
 * Call when finished removing blocks to calculate lighting and send chunk updates to the client.
 */
public void finish(){
  LogHelperBC.startTimer("String_Node_Str");
  PlayerChunkMap playerChunkMap=serverWorld.getPlayerChunkMap();
  if (playerChunkMap == null) {
    return;
  }
  for (  Chunk chunk : modifiedChunks) {
    chunk.setModified(true);
    chunk.generateSkylightMap();
    PlayerChunkMapEntry watcher=playerChunkMap.getEntry(chunk.xPosition,chunk.zPosition);
    if (watcher != null) {
      watcher.sendPacket(new SPacketChunkData(chunk,65535));
    }
  }
  LogHelperBC.stopTimer();
  LogHelperBC.startTimer("String_Node_Str");
  try {
    LogHelperBC.dev("String_Node_Str" + blocksToUpdate.size() + "String_Node_Str");
    BlockFalling.fallInstantly=true;
    for (    BlockPos pos : blocksToUpdate) {
      IBlockState state=serverWorld.getBlockState(pos);
      if (state.getBlock() instanceof BlockFalling) {
        state.getBlock().updateTick(serverWorld,pos,state,serverWorld.rand);
      }
      state.neighborChanged(serverWorld,pos,Blocks.AIR);
    }
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
  LogHelperBC.stopTimer();
  BlockFalling.fallInstantly=false;
  modifiedChunks.clear();
}

Fixed version (ground truth):
/** 
 * Call when finished removing blocks to calculate lighting and send chunk updates to the client.
 */
public void finish(){
  LogHelperBC.startTimer("String_Node_Str");
  PlayerChunkMap playerChunkMap=serverWorld.getPlayerChunkMap();
  if (playerChunkMap == null) {
    return;
  }
  for (  Chunk chunk : modifiedChunks) {
    chunk.setModified(true);
    chunk.generateSkylightMap();
    PlayerChunkMapEntry watcher=playerChunkMap.getEntry(chunk.xPosition,chunk.zPosition);
    if (watcher != null) {
      watcher.sendPacket(new SPacketChunkData(chunk,65535));
    }
  }
  LogHelperBC.stopTimer();
  LogHelperBC.startTimer("String_Node_Str");
  try {
    LogHelperBC.dev("String_Node_Str" + blocksToUpdate.size() + "String_Node_Str");
    BlockFalling.fallInstantly=true;
    for (    BlockPos pos : blocksToUpdate) {
      IBlockState state=serverWorld.getBlockState(pos);
      if (state.getBlock() instanceof BlockFalling) {
        state.getBlock().updateTick(serverWorld,pos,state,serverWorld.rand);
      }
      state.neighborChanged(serverWorld,pos,Blocks.AIR);
    }
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
  LogHelperBC.stopTimer();
  BlockFalling.fallInstantly=false;
}