nus-yam/ex-repair huggingface dataset:
Program: 156382
Project: 156382
Buggy source:
public Vec3d getRenderPosition(BlockPos pos,long tick,float partialTicks){
  long diff=tickFinished - tickStarted;
  long afterTick=tick - tickStarted;
  float interp=(afterTick + partialTicks) / diff;
  interp=Math.max(0,Math.min(1,interp));
  Vec3d center=new Vec3d(pos).addVector(0.5,0.5,0.5);
  Vec3d start=VecUtil.offset(center,from,0.5);
  Vec3d end=center;
  if (to != null) {
    end=VecUtil.offset(center,to,0.5);
  }
  Vec3d vecFrom;
  Vec3d vecTo;
  if (interp < 0.5) {
    vecFrom=start;
    vecTo=center;
    interp*=2;
  }
 else {
    vecFrom=center;
    vecTo=end;
    interp=(interp - 0.5f) * 2;
  }
  return VecUtil.scale(vecFrom,1 - interp).add(VecUtil.scale(vecTo,interp));
}

Fixed version (ground truth):
public Vec3d getRenderPosition(BlockPos pos,long tick,float partialTicks){
  long diff=tickFinished - tickStarted;
  long afterTick=tick - tickStarted;
  float interp=(afterTick + partialTicks) / diff;
  interp=Math.max(0,Math.min(1,interp));
  Vec3d center=new Vec3d(pos).addVector(0.5,0.5,0.5);
  Vec3d vecSide=side == null ? center : VecUtil.offset(center,side,0.5);
  Vec3d vecFrom;
  Vec3d vecTo;
  if (toCenter) {
    vecFrom=vecSide;
    vecTo=center;
  }
 else {
    vecFrom=center;
    vecTo=vecSide;
  }
  return VecUtil.scale(vecFrom,1 - interp).add(VecUtil.scale(vecTo,interp));
}
Program: 156383
Project: 156383
Buggy source:
public NBTTagCompound writeToNbt(long tickNow){
  NBTTagCompound nbt=new NBTTagCompound();
  nbt.setTag("String_Node_Str",stack.serializeNBT());
  nbt.setByte("String_Node_Str",(byte)(colour == null ? 0 : colour.getMetadata() + 1));
  nbt.setBoolean("String_Node_Str",state == EnumTravelState.SERVER_TO_CENTER);
  nbt.setDouble("String_Node_Str",speed);
  nbt.setInteger("String_Node_Str",(int)(tickStarted - tickNow));
  nbt.setInteger("String_Node_Str",(int)(tickFinished - tickNow));
  nbt.setInteger("String_Node_Str",timeToCenter);
  nbt.setInteger("String_Node_Str",timeToExit);
  nbt.setByte("String_Node_Str",(byte)(from == null ? 0 : from.ordinal() + 1));
  nbt.setByte("String_Node_Str",(byte)(to == null ? 0 : to.ordinal() + 1));
  if (toTryOrder != null) {
    int[] order=new int[toTryOrder.size()];
    for (int i=toTryOrder.size() - 1; i >= 0; i--) {
      order[i]=toTryOrder.get(i).getIndex();
    }
    nbt.setIntArray("String_Node_Str",order);
  }
  if (tried != null) {
    int[] order=new int[tried.size()];
    for (int i=tried.size() - 1; i >= 0; i--) {
      order[i]=tried.get(i).getIndex();
    }
    nbt.setIntArray("String_Node_Str",order);
  }
  return nbt;
}

Fixed version (ground truth):
public NBTTagCompound writeToNbt(long tickNow){
  NBTTagCompound nbt=new NBTTagCompound();
  nbt.setTag("String_Node_Str",stack.serializeNBT());
  nbt.setByte("String_Node_Str",(byte)(colour == null ? 0 : colour.getMetadata() + 1));
  nbt.setBoolean("String_Node_Str",toCenter);
  nbt.setDouble("String_Node_Str",speed);
  nbt.setInteger("String_Node_Str",(int)(tickStarted - tickNow));
  nbt.setInteger("String_Node_Str",(int)(tickFinished - tickNow));
  nbt.setInteger("String_Node_Str",timeToDest);
  nbt.setTag("String_Node_Str",NBTUtilBC.writeEnum(side));
  nbt.setTag("String_Node_Str",NBTUtilBC.writeEnumSet(tried,EnumFacing.class));
  return nbt;
}
Program: 156384
Project: 156384
Buggy source:
public void genTimings(long now,double distance){
  tickStarted=now;
  int time=(int)Math.ceil(distance / speed);
  tickFinished=now + (time);
  timeToCenter=time / 2;
  timeToExit=time - timeToCenter;
}

Fixed version (ground truth):
public void genTimings(long now,double distance){
  tickStarted=now;
  timeToDest=(int)Math.ceil(distance / speed);
  tickFinished=now + timeToDest;
}
Program: 156385
Project: 156385
Buggy source:
@PipeEventHandler public static void sideCheck(PipeEventItem.SideCheck event){
  for (  EnumFacing side : EnumFacing.VALUES) {
    if (!event.isAllowed(side)) {
      continue;
    }
    IPipe neighbour=event.holder.getNeighbouringPipe(side);
    if (neighbour == null) {
      continue;
    }
    PipePluggable plug=neighbour.getHolder().getPluggable(side.getOpposite());
    if (plug instanceof PluggableLens) {
      PluggableLens lens=(PluggableLens)plug;
      lens.sideCheckAnyPos(event,side);
    }
  }
}

Fixed version (ground truth):
@PipeEventHandler public static void sideCheck(PipeEventItem.SideCheck event){
  for (  EnumFacing side : EnumFacing.VALUES) {
    if (!event.isAllowed(side)) {
      continue;
    }
    IPipe neighbour=event.holder.getNeighbouringPipe(side);
    if (neighbour == null) {
      continue;
    }
    PipePluggable neighbourPlug=neighbour.getHolder().getPluggable(side.getOpposite());
    PipePluggable atPlug=event.holder.getPluggable(side);
    if (neighbourPlug instanceof PluggableLens) {
      EnumDyeColor colourAt=event.colour;
      if (atPlug instanceof PluggableLens) {
        PluggableLens lens=(PluggableLens)atPlug;
        if (!lens.isFilter) {
          colourAt=lens.colour;
        }
      }
      PluggableLens lens=(PluggableLens)neighbourPlug;
      if (lens.isFilter) {
        if (colourAt == lens.colour) {
          event.increasePriority(side);
        }
 else         if (colourAt == null) {
          event.decreasePriority(side);
        }
      }
    }
  }
}
Program: 156386
Project: 156386
Buggy source:
@PipeEventHandler public void sideCheck(PipeEventItem.SideCheck event){
  sideCheckAnyPos(event,side);
}

Fixed version (ground truth):
@PipeEventHandler public void sideCheck(PipeEventItem.SideCheck event){
  if (isFilter) {
    if (event.colour == colour) {
      event.increasePriority(side);
    }
 else     if (event.colour != null) {
      event.disallow(side);
    }
 else {
      event.decreasePriority(side);
    }
  }
}
Program: 156387
Project: 156387
Buggy source:
@PipeEventHandler public void beforeInsert(PipeEventItem.BeforeInsert event){
  if (!isFilter) {
    if (event.from == side) {
      event.colour=colour;
    }
  }
}

Fixed version (ground truth):
@PipeEventHandler public void beforeInsert(PipeEventItem.OnInsert event){
  if (!isFilter) {
    if (event.from == side) {
      event.colour=colour;
    }
  }
}
Program: 156388
Project: 156388
Buggy source:
@Override public void reconfigure(){
  PipeEventPower.Configure configure=new PipeEventPower.Configure(pipe.getHolder(),this);
  configure.setMaxPower(maxPower);
  configure.setReceiver(isReceiver);
  pipe.getHolder().fireEvent(configure);
  maxPower=MathUtil.clamp(configure.getMaxPower(),MjAPI.MJ,ABSOLUTE_MAX_POWER);
  isReceiver=configure.isReceiver();
}

Fixed version (ground truth):
@Override public void reconfigure(){
  PipeEventPower.Configure configure=new PipeEventPower.Configure(pipe.getHolder(),this);
  configure.setMaxPower(maxPower);
  configure.setReceiver(isReceiver);
  pipe.getHolder().fireEvent(configure);
  maxPower=configure.getMaxPower();
  if (maxPower <= 0) {
    maxPower=DEFAULT_MAX_POWER;
  }
  isReceiver=configure.isReceiver();
}
Program: 156389
Project: 156389
Buggy source:
public boolean tryPairEntity(EntityQuarryFrame frame,Axis axis,int listIndex){
  List<EntityQuarryFrame> entities=getArmList(axis);
  if (world.isRemote && entities.size() == 0) {
    BlockPos size=frameBox.size();
    resizeTo(xArm,size.getX());
    resizeTo(zArm,size.getZ());
    int ySize=frameBox.max().getY() - (int)Math.ceil(drillPos.yCoord);
    resizeTo(yArm,ySize + 10);
  }
  if (listIndex < 0 || listIndex >= entities.size()) {
    return false;
  }
  EntityQuarryFrame current=entities.get(listIndex);
  if (current == null || current.isDead || !current.isConnected(this)) {
    if (current != null) {
      current.setDead();
    }
    entities.set(listIndex,frame);
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean tryPairEntity(EntityQuarryFrame frame,Axis axis,int listIndex){
  if (!frameBox.isInitialized()) {
    return false;
  }
  List<EntityQuarryFrame> entities=getArmList(axis);
  if (world.isRemote && entities.size() == 0) {
    BlockPos size=frameBox.size();
    resizeTo(xArm,size.getX());
    resizeTo(zArm,size.getZ());
    int ySize=frameBox.max().getY() - (int)Math.ceil(drillPos.yCoord);
    resizeTo(yArm,ySize + 10);
  }
  if (listIndex < 0 || listIndex >= entities.size()) {
    return false;
  }
  EntityQuarryFrame current=entities.get(listIndex);
  if (current == null || current.isDead || !current.isConnected(this)) {
    if (current != null) {
      current.setDead();
    }
    entities.set(listIndex,frame);
    return true;
  }
  return false;
}
Program: 156390
Project: 156390
Buggy source:
private static MutableQuad[] getEngineQuads(ModelHolderVariable model,TileEngineRedstone_BC8 tile,float partialTicks){
  ENGINE_PROGRESS.value=tile.getProgressClient(partialTicks);
  ENGINE_STAGE.value=tile.getPowerStage().getModelName();
  return model.getCutoutQuads();
}

Fixed version (ground truth):
private static MutableQuad[] getEngineQuads(ModelHolderVariable model,TileEngineBase_BC8 tile,float partialTicks){
  ENGINE_PROGRESS.value=tile.getProgressClient(partialTicks);
  ENGINE_STAGE.value=tile.getPowerStage().getModelName();
  ENGINE_FACING.value=tile.getCurrentFacing().getName();
  return model.getCutoutQuads();
}
Program: 156391
Project: 156391
Buggy source:
public static final MutableQuad[] getCreativeEngineQuads(TileEngineRedstone_BC8 tile,float partialTicks){
  return getEngineQuads(ENGINE_CREATIVE,tile,partialTicks);
}

Fixed version (ground truth):
public static final MutableQuad[] getCreativeEngineQuads(TileEngineBase_BC8 tile,float partialTicks){
  return getEngineQuads(ENGINE_CREATIVE,tile,partialTicks);
}
Program: 156392
Project: 156392
Buggy source:
@Override protected MutableQuad[] getEngineModel(TileEngineRedstone_BC8 engine,float partialTicks){
}

Fixed version (ground truth):
@Override protected MutableQuad[] getEngineModel(TileEngineRedstone_BC8 engine,float partialTicks){
  return BCCoreModels.getRedstoneEngineQuads(engine,partialTicks);
}
Program: 156393
Project: 156393
Buggy source:
@SideOnly(Side.CLIENT) public float getProgressClient(float partialTicks){
  return progress;
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public float getProgressClient(float partialTicks){
  return lastProgress * (1 - partialTicks) + progress * partialTicks;
}
Program: 156394
Project: 156394
Buggy source:
@Override protected void drawBackgroundLayer(float partialTicks){
  ICON_GUI.drawAt(rootElement);
  DeltaInt delta=container.tile.deltaProgress;
  double dynamic=delta.getDynamic(partialTicks);
  double p=dynamic / 100;
  GuiRectangle progress=RECT_PROGRESS.createProgress(p,1);
  ICON_PROGRESS.drawCutInside(progress.offset(rootElement));
  fontRendererObj.drawString("String_Node_Str" + delta.getStatic(true),10,10,-1);
  fontRendererObj.drawString("String_Node_Str" + dynamic,10,20,-1);
  fontRendererObj.drawString("String_Node_Str" + delta.getStatic(false),10,30,-1);
  fontRendererObj.drawString("String_Node_Str" + delta.changingEntries.size(),10,40,-1);
  if (container.tile.currentRecipe != null) {
    RenderHelper.enableGUIStandardItemLighting();
    ItemStack output=container.tile.getOutput();
    int x=rootElement.getX() + 93;
    int y=rootElement.getY() + 27;
    this.itemRender.renderItemAndEffectIntoGUI(this.mc.thePlayer,output,x,y);
    this.itemRender.renderItemOverlayIntoGUI(this.mc.fontRendererObj,output,x,y,null);
    RenderHelper.enableStandardItemLighting();
  }
}

Fixed version (ground truth):
@Override protected void drawBackgroundLayer(float partialTicks){
  ICON_GUI.drawAt(rootElement);
  DeltaInt delta=container.tile.deltaProgress;
  double dynamic=delta.getDynamic(partialTicks);
  double p=dynamic / 100;
  GuiRectangle progress=RECT_PROGRESS.createProgress(p,1);
  ICON_PROGRESS.drawCutInside(progress.offset(rootElement));
  fontRendererObj.drawString("String_Node_Str" + delta.getStatic(true),10,10,-1);
  fontRendererObj.drawString("String_Node_Str" + dynamic,10,20,-1);
  fontRendererObj.drawString("String_Node_Str" + delta.getStatic(false),10,30,-1);
  fontRendererObj.drawString("String_Node_Str" + delta.changingEntries.size(),10,40,-1);
  if (container.tile.currentRecipe != null) {
    RenderHelper.enableGUIStandardItemLighting();
    ItemStack output=container.tile.getOutput();
    int x=rootElement.getX() + 93;
    int y=rootElement.getY() + 27;
    this.itemRender.renderItemAndEffectIntoGUI(this.mc.player,output,x,y);
    this.itemRender.renderItemOverlayIntoGUI(this.mc.fontRendererObj,output,x,y,null);
    RenderHelper.enableStandardItemLighting();
  }
}
Program: 156395
Project: 156395
Buggy source:
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack stack,World world,EntityPlayer player,EnumHand hand){
  Vec3d start=player.getPositionVector().addVector(0,player.getEyeHeight(),0);
  Vec3d look=player.getLookVec();
  Vec3d end=start.add(look.scale(7));
  RayTraceResult ray=world.rayTraceBlocks(start,end,true,false,true);
  if (ray == null || ray.getBlockPos() == null) {
    return new ActionResult<>(EnumActionResult.FAIL,stack);
  }
  Block b=world.getBlockState(ray.getBlockPos()).getBlock();
  if (b != Blocks.WATER) {
    return new ActionResult<>(EnumActionResult.FAIL,stack);
  }
  if (!player.capabilities.isCreativeMode) {
    stack.setCount(stack.getCount() - 1);
  }
  world.playSound((EntityPlayer)null,player.posX,player.posY,player.posZ,SoundEvents.ENTITY_SNOWBALL_THROW,SoundCategory.NEUTRAL,0.5F,0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
  if (!world.isRemote) {
    world.setBlockState(ray.getBlockPos(),BCFactoryBlocks.waterGel.getDefaultState().withProperty(BlockWaterGel.PROP_STAGE,GelStage.SPREAD_0));
    world.scheduleUpdate(ray.getBlockPos(),BCFactoryBlocks.waterGel,200);
  }
  return new ActionResult<>(EnumActionResult.SUCCESS,stack);
}

Fixed version (ground truth):
@Override public ActionResult<ItemStack> onItemRightClick(World world,EntityPlayer player,EnumHand hand){
  ItemStack stack=player.getHeldItem(hand);
  Vec3d start=player.getPositionVector().addVector(0,player.getEyeHeight(),0);
  Vec3d look=player.getLookVec();
  Vec3d end=start.add(look.scale(7));
  RayTraceResult ray=world.rayTraceBlocks(start,end,true,false,true);
  if (ray == null || ray.getBlockPos() == null) {
    return new ActionResult<>(EnumActionResult.FAIL,stack);
  }
  Block b=world.getBlockState(ray.getBlockPos()).getBlock();
  if (b != Blocks.WATER) {
    return new ActionResult<>(EnumActionResult.FAIL,stack);
  }
  if (!player.capabilities.isCreativeMode) {
    stack.setCount(stack.getCount() - 1);
  }
  world.playSound((EntityPlayer)null,player.posX,player.posY,player.posZ,SoundEvents.ENTITY_SNOWBALL_THROW,SoundCategory.NEUTRAL,0.5F,0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
  if (!world.isRemote) {
    world.setBlockState(ray.getBlockPos(),BCFactoryBlocks.waterGel.getDefaultState().withProperty(BlockWaterGel.PROP_STAGE,GelStage.SPREAD_0));
    world.scheduleUpdate(ray.getBlockPos(),BCFactoryBlocks.waterGel,200);
  }
  return new ActionResult<>(EnumActionResult.SUCCESS,stack);
}
Program: 156396
Project: 156396
Buggy source:
private void putInInventories(EnumFacing currentSide){
  List<EnumFacing> sides=Arrays.asList(EnumFacing.values());
  Collections.shuffle(sides,new Random());
  for (  EnumFacing side : sides) {
    if (side == currentSide) {
      return;
    }
    TileEntity tile=worldObj.getTileEntity(pos.offset(side));
    IItemTransactor transactor=ItemTransactorHelper.getTransactor(tile,side.getOpposite());
    if (transactor == NoSpaceTransactor.INSTANCE) {
      continue;
    }
    IStackFilter filter=(stack) -> {
      if (stack == null) {
        return false;
      }
      ItemStack leftOver=transactor.insert(stack.copy(),false,true);
      if (leftOver == null) {
        return true;
      }
      return leftOver.getCount() < stack.getCount();
    }
;
    ItemStack extracted=inv.extract(filter,1,1,false);
    transactor.insert(extracted,false,false);
  }
}

Fixed version (ground truth):
private void putInInventories(EnumFacing currentSide){
  List<EnumFacing> sides=Arrays.asList(EnumFacing.values());
  Collections.shuffle(sides,new Random());
  for (  EnumFacing side : sides) {
    if (side == currentSide) {
      return;
    }
    TileEntity tile=world.getTileEntity(pos.offset(side));
    IItemTransactor transactor=ItemTransactorHelper.getTransactor(tile,side.getOpposite());
    if (transactor == NoSpaceTransactor.INSTANCE) {
      continue;
    }
    IStackFilter filter=(stack) -> {
      if (stack.isEmpty()) {
        return false;
      }
      ItemStack leftOver=transactor.insert(stack.copy(),false,true);
      if (leftOver.isEmpty()) {
        return true;
      }
      return leftOver.getCount() < stack.getCount();
    }
;
    ItemStack extracted=inv.extract(filter,1,1,false);
    transactor.insert(extracted,false,false);
  }
}
Program: 156397
Project: 156397
Buggy source:
private void putItemsFromGround(EnumFacing currentSide){
  int radius=3;
  BlockPos offset=new BlockPos(currentSide.getDirectionVec());
  offset=new BlockPos(offset.getX() * radius,offset.getY() * radius,offset.getZ() * radius);
  AxisAlignedBB aabb=new AxisAlignedBB(this.pos,this.pos).expandXyz(radius).offset(offset);
  List<EntityItem> entityItems=worldObj.getEntitiesWithinAABB(EntityItem.class,aabb);
  int index=0, max=3;
  for (  EntityItem entityItem : entityItems) {
    ItemStack stack=entityItem.getEntityItem();
    stack=inv.insert(stack,false,false);
    if (stack == null) {
      entityItem.setDead();
    }
 else {
      entityItem.setEntityItemStack(stack);
    }
    if (index++ >= max) {
      break;
    }
  }
}

Fixed version (ground truth):
private void putItemsFromGround(EnumFacing currentSide){
  int radius=3;
  BlockPos offset=new BlockPos(currentSide.getDirectionVec());
  offset=new BlockPos(offset.getX() * radius,offset.getY() * radius,offset.getZ() * radius);
  AxisAlignedBB aabb=new AxisAlignedBB(this.pos,this.pos).expandXyz(radius).offset(offset);
  List<EntityItem> entityItems=world.getEntitiesWithinAABB(EntityItem.class,aabb);
  int index=0, max=3;
  for (  EntityItem entityItem : entityItems) {
    ItemStack stack=entityItem.getEntityItem();
    stack=inv.insert(stack,false,false);
    if (stack.isEmpty()) {
      entityItem.setDead();
    }
 else {
      entityItem.setEntityItemStack(stack);
    }
    if (index++ >= max) {
      break;
    }
  }
}
Program: 156398
Project: 156398
Buggy source:
@Override public void update(){
  if (worldObj.isRemote) {
    return;
  }
  if (!(worldObj.getBlockState(pos).getBlock() instanceof BlockChute)) {
    return;
  }
  battery.tick(getWorld(),getPos());
  battery.addPower(1000);
  EnumFacing currentSide=worldObj.getBlockState(pos).getValue(BlockBCBase_Neptune.BLOCK_FACING_6);
  int target=100000;
  if (currentSide == EnumFacing.UP.getOpposite()) {
    progress+=1000;
  }
  progress+=battery.extractPower(0,target - progress);
  if (progress >= target) {
    progress=0;
    putItemsFromGround(currentSide);
  }
  putInInventories(currentSide);
}

Fixed version (ground truth):
@Override public void update(){
  if (world.isRemote) {
    return;
  }
  if (!(world.getBlockState(pos).getBlock() instanceof BlockChute)) {
    return;
  }
  battery.tick(getWorld(),getPos());
  battery.addPower(1000);
  EnumFacing currentSide=world.getBlockState(pos).getValue(BlockBCBase_Neptune.BLOCK_FACING_6);
  int target=100000;
  if (currentSide == EnumFacing.UP.getOpposite()) {
    progress+=1000;
  }
  progress+=battery.extractPower(0,target - progress);
  if (progress >= target) {
    progress=0;
    putItemsFromGround(currentSide);
  }
  putInInventories(currentSide);
}
Program: 156399
Project: 156399
Buggy source:
@Override public void update(){
  deltaManager.tick();
  if (worldObj.isRemote) {
    return;
  }
  battery.tick(getWorld(),getPos());
  if (mode != Mode.On) {
    return;
  }
  if (true) {
    sendNetworkUpdate(NET_LED_STATUS);
  }
  if (isComplete) {
    return;
  }
  initCurrentPos();
  if (hasTubeStopped()) {
    mine();
  }
}

Fixed version (ground truth):
@Override public void update(){
  deltaManager.tick();
  if (world.isRemote) {
    return;
  }
  battery.tick(getWorld(),getPos());
  if (mode != Mode.On) {
    return;
  }
  if (true) {
    sendNetworkUpdate(NET_LED_STATUS);
  }
  if (isComplete) {
    return;
  }
  initCurrentPos();
  if (hasTubeStopped()) {
    mine();
  }
}
Program: 156400
Project: 156400
Buggy source:
protected void setComplete(boolean isComplete){
  this.isComplete=isComplete;
  if (!worldObj.isRemote) {
    sendNetworkUpdate(NET_LED_STATUS);
  }
}

Fixed version (ground truth):
protected void setComplete(boolean isComplete){
  this.isComplete=isComplete;
  if (!world.isRemote) {
    sendNetworkUpdate(NET_LED_STATUS);
  }
}
Program: 156401
Project: 156401
Buggy source:
@Mod.EventHandler public static void init(FMLInitializationEvent evt){
  BCLibProxy.getProxy().fmlInit();
  VanillaSchematics.fmlInit();
  VanillaListHandlers.fmlInit();
  VanillaPaintHandlers.fmlInit();
  VanillaRotationHandlers.fmlInit();
  ItemManager.fmlInit();
  BCLibRecipes.fmlInit();
  BCLibDatabase.fmlInit();
}

Fixed version (ground truth):
@Mod.EventHandler public static void init(FMLInitializationEvent evt){
  BCLibProxy.getProxy().fmlInit();
  VanillaListHandlers.fmlInit();
  VanillaPaintHandlers.fmlInit();
  VanillaRotationHandlers.fmlInit();
  ItemManager.fmlInit();
  BCLibRecipes.fmlInit();
  BCLibDatabase.fmlInit();
}
Program: 156402
Project: 156402
Buggy source:
public ArrayStackFilter(ItemStack... stacks){
  this.stacks=stacks;
}

Fixed version (ground truth):
public ArrayStackFilter(ItemStack... stacks){
  this.stacks=StackUtil.listOf(stacks);
}
Program: 156403
Project: 156403
Buggy source:
@Override public boolean matches(ItemStack stack){
  if (stacks.length == 0 || !hasFilter()) {
    return true;
  }
  for (  ItemStack s : stacks) {
    if (StackUtil.isMatchingItemOrList(s,stack)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean matches(ItemStack stack){
  if (stacks.size() == 0 || !hasFilter()) {
    return true;
  }
  for (  ItemStack s : stacks) {
    if (StackUtil.isMatchingItemOrList(s,stack)) {
      return true;
    }
  }
  return false;
}
Program: 156404
Project: 156404
Buggy source:
public CraftingFilter(ItemStack... stacks){
  this.stacks=stacks;
}

Fixed version (ground truth):
public CraftingFilter(ItemStack... stacks){
  this.stacks=StackUtil.listOf(stacks);
}
Program: 156405
Project: 156405
Buggy source:
@Override public boolean matches(ItemStack stack){
  if (stacks.length == 0 || !hasFilter()) {
    return true;
  }
  for (  ItemStack s : stacks) {
    if (StackUtil.isCraftingEquivalent(s,stack,true)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean matches(ItemStack stack){
  if (stacks.size() == 0 || !hasFilter()) {
    return true;
  }
  for (int i=0; i < stacks.size(); i++) {
    if (StackUtil.isCraftingEquivalent(stacks.get(i),stack,true)) {
      return true;
    }
  }
  return false;
}
Program: 156406
Project: 156406
Buggy source:
@Override public <T extends Enum<T>>T readEnumValue(Class<T> enumClass){
  boolean exists=readBoolean();
  if (!exists) {
    return null;
  }
  T[] enums=enumClass.getEnumConstants();
  int length=MathHelper.smallestEncompassingPowerOfTwo(enums.length);
  int index=readFixedBits(length);
  return enums[index];
}

Fixed version (ground truth):
@Override public <T extends Enum<T>>T readEnumValue(Class<T> enumClass){
  T[] enums=enumClass.getEnumConstants();
  int length=MathHelper.log2DeBruijn(enums.length);
  int index=readFixedBits(length);
  return enums[index];
}
Program: 156407
Project: 156407
Buggy source:
/** 
 * @param length
 * @return The read bits, compacted into an int.
 * @throws IllegalArgumentException if the length argument was less than 1 or greater than 32. 
 */
public int readFixedBits(int length) throws IllegalArgumentException {
  if (length <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + length + "String_Node_Str");
  }
  if (length > 32) {
    throw new IllegalArgumentException("String_Node_Str" + length + "String_Node_Str");
  }
  readPartialBitsBegin();
  throw new AbstractMethodError("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param length
 * @return The read bits, compacted into an int.
 * @throws IllegalArgumentException if the length argument was less than 1 or greater than 32. 
 */
public int readFixedBits(int length) throws IllegalArgumentException {
  if (length <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + length + "String_Node_Str");
  }
  if (length > 32) {
    throw new IllegalArgumentException("String_Node_Str" + length + "String_Node_Str");
  }
  readPartialBitsBegin();
  int value=0;
  if (readPartialOffset > 0) {
    int avalibleBits=8 - readPartialOffset;
    if (avalibleBits >= length) {
      int mask=(1 << length) - 1;
      value=(readPartialCache >>> readPartialOffset) & mask;
      readPartialOffset+=length;
      return value;
    }
 else {
      int bitsRead=readPartialCache >>> readPartialOffset;
      value=bitsRead;
      readPartialCache=0;
      readPartialOffset=8;
      length-=avalibleBits;
    }
  }
  while (length >= 8) {
    readPartialBitsBegin();
    length-=8;
    value<<=8;
    value|=readPartialCache;
    readPartialOffset=8;
  }
  if (length > 0) {
    readPartialBitsBegin();
    int mask=(1 << length) - 1;
    value<<=length;
    value|=readPartialCache & mask;
    readPartialOffset=length;
  }
  return value;
}
Program: 156409
Project: 156409
Buggy source:
/** 
 * Writes a single boolean out to some position in this buffer. The boolean flag might be written to a new byte (increasing the writerIndex) or it might be added to an existing byte that was written with a previous call to this method. 
 */
@Override public PacketBufferBC writeBoolean(boolean flag){
  writePartialBitsBegin();
  writePartialCache|=(flag ? 1 : 0) << writePartialOffset;
  writePartialOffset++;
  setByte(writePartialIndex,writePartialCache);
  return this;
}

Fixed version (ground truth):
/** 
 * Writes a single boolean out to some position in this buffer. The boolean flag might be written to a new byte (increasing the writerIndex) or it might be added to an existing byte that was written with a previous call to this method. 
 */
@Override public PacketBufferBC writeBoolean(boolean flag){
  writePartialBitsBegin();
  int toWrite=(flag ? 1 : 0) << writePartialOffset;
  writePartialCache|=toWrite;
  writePartialOffset++;
  setByte(writePartialIndex,writePartialCache);
  return this;
}
Program: 156410
Project: 156410
Buggy source:
@Override public PacketBufferBC writeEnumValue(Enum<?> value){
  if (value == null) {
    writeBoolean(false);
  }
 else {
    writeBoolean(true);
    Enum<?>[] possible=value.getClass().getEnumConstants();
    writeFixedBits(value.ordinal(),MathHelper.smallestEncompassingPowerOfTwo(possible.length));
  }
  return this;
}

Fixed version (ground truth):
@Override public PacketBufferBC writeEnumValue(Enum<?> value){
  Enum<?>[] possible=value.getClass().getEnumConstants();
  writeFixedBits(value.ordinal(),MathHelper.log2DeBruijn(possible.length));
  return this;
}
Program: 156411
Project: 156411
Buggy source:
@Override public FluidStack tryExtractFluidAdv(int millibuckets,EnumFacing from,IFluidFilter filter){
  if (from == null || filter == null || millibuckets <= 0) {
    return null;
  }
  TileEntity connected=pipe.getConnectedTile(from);
  if (connected == null) {
    return null;
  }
  IFluidHandler fluidHandler=connected.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,from.getOpposite());
  if (!(fluidHandler instanceof IFluidHandlerAdv)) {
    return null;
  }
  IFluidHandlerAdv handlerAdv=(IFluidHandlerAdv)fluidHandler;
  if (currentFluid != null) {
    if (!filter.matches(currentFluid)) {
      return null;
    }
    final IFluidFilter existing=filter;
    filter=(fluid) -> currentFluid.isFluidEqual(fluid) && existing.matches(fluid);
  }
  Section section=sections.get(EnumPipePart.fromFacing(from));
  millibuckets=Math.min(millibuckets,section.getMaxFilled());
  if (millibuckets <= 0) {
    return null;
  }
  FluidStack toAdd=handlerAdv.drain(filter,millibuckets,true);
  if (toAdd == null) {
    return null;
  }
  if (currentFluid == null) {
    setFluid(toAdd);
  }
  int reallyFilled=section.fill(millibuckets,true);
  section.ticksInDirection=COOLDOWN_INPUT;
  if (reallyFilled != millibuckets) {
    BCLog.logger.warn("String_Node_Str" + reallyFilled + "String_Node_Str"+ millibuckets);
  }
  return toAdd;
}

Fixed version (ground truth):
@Override public FluidStack tryExtractFluidAdv(int millibuckets,EnumFacing from,IFluidFilter filter){
  if (from == null || filter == null || millibuckets <= 0) {
    return null;
  }
  TileEntity connected=pipe.getConnectedTile(from);
  if (connected == null) {
    return null;
  }
  IFluidHandler fluidHandler=connected.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,from.getOpposite());
  if (!(fluidHandler instanceof IFluidHandlerAdv)) {
    return null;
  }
  IFluidHandlerAdv handlerAdv=(IFluidHandlerAdv)fluidHandler;
  if (currentFluid != null) {
    if (!filter.matches(currentFluid)) {
      return null;
    }
    final IFluidFilter existing=filter;
    filter=(fluid) -> currentFluid.isFluidEqual(fluid) && existing.matches(fluid);
  }
  Section section=sections.get(EnumPipePart.fromFacing(from));
  millibuckets=Math.min(millibuckets,section.getMaxFilled());
  if (millibuckets <= 0) {
    return null;
  }
  FluidStack toAdd=handlerAdv.drain(filter,millibuckets,true);
  if (toAdd == null || toAdd.amount <= 0) {
    return null;
  }
  millibuckets=toAdd.amount;
  if (currentFluid == null) {
    setFluid(toAdd);
  }
  int reallyFilled=section.fill(millibuckets,true);
  section.ticksInDirection=COOLDOWN_INPUT;
  if (reallyFilled != millibuckets) {
    BCLog.logger.warn("String_Node_Str" + reallyFilled + "String_Node_Str"+ millibuckets);
  }
  return toAdd;
}
Program: 156412
Project: 156412
Buggy source:
@Override public FluidStack tryExtractFluid(int millibuckets,EnumFacing from,FluidStack filter){
  if (from == null) {
    return null;
  }
  TileEntity connected=pipe.getConnectedTile(from);
  if (connected == null) {
    return null;
  }
  IFluidHandler fluidHandler=connected.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,from.getOpposite());
  if (fluidHandler == null) {
    return null;
  }
  if (filter == null) {
    filter=this.currentFluid;
  }
 else   if (currentFluid != null && !filter.isFluidEqual(currentFluid)) {
    return null;
  }
  Section section=sections.get(EnumPipePart.fromFacing(from));
  millibuckets=Math.min(millibuckets,section.getMaxFilled());
  if (millibuckets <= 0) {
    return null;
  }
  FluidStack toAdd;
  if (filter == null) {
    toAdd=fluidHandler.drain(millibuckets,true);
  }
 else {
    filter=filter.copy();
    filter.amount=millibuckets;
    toAdd=fluidHandler.drain(filter,true);
  }
  if (toAdd == null) {
    return null;
  }
  if (currentFluid == null) {
    setFluid(toAdd);
  }
  int reallyFilled=section.fill(millibuckets,true);
  section.ticksInDirection=COOLDOWN_INPUT;
  if (reallyFilled != millibuckets) {
    BCLog.logger.warn("String_Node_Str" + reallyFilled + "String_Node_Str"+ millibuckets);
  }
  return toAdd;
}

Fixed version (ground truth):
@Override public FluidStack tryExtractFluid(int millibuckets,EnumFacing from,FluidStack filter){
  if (from == null) {
    return null;
  }
  TileEntity connected=pipe.getConnectedTile(from);
  if (connected == null) {
    return null;
  }
  IFluidHandler fluidHandler=connected.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,from.getOpposite());
  if (fluidHandler == null) {
    return null;
  }
  if (filter == null) {
    filter=this.currentFluid;
  }
 else   if (currentFluid != null && !filter.isFluidEqual(currentFluid)) {
    return null;
  }
  Section section=sections.get(EnumPipePart.fromFacing(from));
  millibuckets=Math.min(millibuckets,section.getMaxFilled());
  if (millibuckets <= 0) {
    return null;
  }
  FluidStack toAdd;
  if (filter == null) {
    toAdd=fluidHandler.drain(millibuckets,true);
  }
 else {
    filter=filter.copy();
    filter.amount=millibuckets;
    toAdd=fluidHandler.drain(filter,true);
  }
  if (toAdd == null || toAdd.amount <= 0) {
    return null;
  }
  millibuckets=toAdd.amount;
  if (currentFluid == null) {
    setFluid(toAdd);
  }
  int reallyFilled=section.fill(millibuckets,true);
  section.ticksInDirection=COOLDOWN_INPUT;
  if (reallyFilled != millibuckets) {
    BCLog.logger.warn("String_Node_Str" + reallyFilled + "String_Node_Str"+ millibuckets);
  }
  return toAdd;
}
Program: 156414
Project: 156414
Buggy source:
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer player,EnumHand hand,ItemStack held,EnumFacing side,float hitX,float hitY,float hitZ){
  TilePipeHolder tile=getPipe(world,pos,false);
  if (tile == null) {
    return false;
  }
  RayTraceResult trace=rayTrace(world,pos,player);
  if (trace == null) {
    return false;
  }
  EnumFacing realSide=getPartSideHit(trace);
  if (realSide == null) {
    realSide=side;
  }
  PipePluggable existing=tile.getPluggable(realSide);
  if (existing != null) {
    return existing.onPluggableActivate(player,trace,hitX,hitY,hitZ);
  }
  EnumPipePart part=trace.subHit == 0 ? EnumPipePart.CENTER : EnumPipePart.fromFacing(realSide);
  Item item=held == null ? null : held.getItem();
  if (item instanceof IItemPluggable) {
    IItemPluggable itemPlug=(IItemPluggable)item;
    PipePluggable plug=itemPlug.onPlace(held,tile,realSide);
    if (plug == null) {
      return false;
    }
 else {
      tile.replacePluggable(realSide,plug);
      if (!player.capabilities.isCreativeMode) {
        held.stackSize--;
      }
      return true;
    }
  }
  if (tile.getPipe().behaviour.onPipeActivate(player,trace,hitX,hitY,hitZ,part)) {
    return true;
  }
  if (tile.getPipe().flow.onFlowActivate(player,trace,hitX,hitY,hitZ,part)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,BlockPos pos,IBlockState state,EntityPlayer player,EnumHand hand,ItemStack held,EnumFacing side,float hitX,float hitY,float hitZ){
  TilePipeHolder tile=getPipe(world,pos,false);
  if (tile == null) {
    return false;
  }
  RayTraceResult trace=rayTrace(world,pos,player);
  if (trace == null) {
    return false;
  }
  EnumFacing realSide=getPartSideHit(trace);
  if (realSide == null) {
    realSide=side;
  }
  if (trace.subHit > 6 && trace.subHit <= 12) {
    PipePluggable existing=tile.getPluggable(realSide);
    if (existing != null) {
      return existing.onPluggableActivate(player,trace,hitX,hitY,hitZ);
    }
  }
  EnumPipePart part=trace.subHit == 0 ? EnumPipePart.CENTER : EnumPipePart.fromFacing(realSide);
  Item item=held == null ? null : held.getItem();
  if (item instanceof IItemPluggable) {
    IItemPluggable itemPlug=(IItemPluggable)item;
    PipePluggable plug=itemPlug.onPlace(held,tile,realSide);
    if (plug == null) {
      return false;
    }
 else {
      tile.replacePluggable(realSide,plug);
      if (!player.capabilities.isCreativeMode) {
        held.stackSize--;
      }
      return true;
    }
  }
  if (tile.getPipe().behaviour.onPipeActivate(player,trace,hitX,hitY,hitZ,part)) {
    return true;
  }
  if (tile.getPipe().flow.onFlowActivate(player,trace,hitX,hitY,hitZ,part)) {
    return true;
  }
  return false;
}
Program: 156416
Project: 156416
Buggy source:
public TriggerFluidContainerLevel(TriggerType type){
  super("String_Node_Str" + type.name().toLowerCase(Locale.ROOT),"String_Node_Str" + type.name().toLowerCase(Locale.ROOT));
  setBuildCraftLocation("String_Node_Str","String_Node_Str" + type.name().toLowerCase(Locale.ROOT));
  this.type=type;
}

Fixed version (ground truth):
public TriggerFluidContainerLevel(TriggerType type){
  super("String_Node_Str" + type.name().toLowerCase(Locale.ROOT),"String_Node_Str" + type.name().toLowerCase(Locale.ROOT));
  this.type=type;
}
Program: 156417
Project: 156417
Buggy source:
@Override public boolean isTriggerActive(TileEntity tile,EnumFacing side,IStatementContainer statementContainer,IStatementParameter[] parameters){
  if (tile instanceof IFluidHandler) {
    IFluidHandler container=(IFluidHandler)tile;
    FluidStack searchedFluid=null;
    if (parameters != null && parameters.length >= 1 && parameters[0] != null && parameters[0].getItemStack() != null) {
      searchedFluid=FluidContainerRegistry.getFluidForFilledItem(parameters[0].getItemStack());
    }
    if (searchedFluid != null) {
      searchedFluid.amount=1;
    }
    FluidTankInfo[] liquids=container.getTankInfo(side);
    if (liquids == null || liquids.length == 0) {
      return false;
    }
    for (    FluidTankInfo c : liquids) {
      if (c == null) {
        continue;
      }
      if (c.fluid == null) {
        if (searchedFluid == null) {
          return true;
        }
        return container.fill(side,searchedFluid,false) > 0;
      }
      if (searchedFluid == null || searchedFluid.isFluidEqual(c.fluid)) {
        float percentage=(float)c.fluid.amount / (float)c.capacity;
        return percentage < type.level;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isTriggerActive(TileEntity tile,EnumFacing side,IStatementContainer statementContainer,IStatementParameter[] parameters){
  IFluidHandler handler=tile.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,side.getOpposite());
  if (handler == null) {
    return false;
  }
  FluidStack searchedFluid=null;
  if (parameters != null && parameters.length >= 1 && parameters[0] != null && parameters[0].getItemStack() != null) {
    searchedFluid=FluidUtil.getFluidContained(parameters[0].getItemStack());
    if (searchedFluid != null) {
      searchedFluid.amount=1;
    }
  }
  IFluidTankProperties[] liquids=handler.getTankProperties();
  if (liquids == null || liquids.length == 0) {
    return false;
  }
  for (  IFluidTankProperties c : liquids) {
    if (c == null) {
      continue;
    }
    FluidStack fluid=c.getContents();
    if (fluid == null) {
      if (searchedFluid == null) {
        return true;
      }
      return handler.fill(searchedFluid,false) > 0;
    }
    if (searchedFluid == null || searchedFluid.isFluidEqual(fluid)) {
      float percentage=fluid.amount / (float)c.getCapacity();
      return percentage < type.level;
    }
  }
  return false;
}
Program: 156418
Project: 156418
Buggy source:
@Override public void handleUpdateTag(NBTTagCompound tag){
  super.readFromNBT(tag);
  byte[] bytes=tag.getByteArray("String_Node_Str");
  ByteBuf buf=Unpooled.copiedBuffer(bytes);
  try {
    int id=buf.readUnsignedShort();
    readPayload(id,new PacketBuffer(buf),worldObj.isRemote ? Side.CLIENT : Side.SERVER,null);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void handleUpdateTag(NBTTagCompound tag){
  super.readFromNBT(tag);
  byte[] bytes=tag.getByteArray("String_Node_Str");
  ByteBuf buf=Unpooled.copiedBuffer(bytes);
  try {
    int id=buf.readUnsignedShort();
    readPayload(id,new PacketBuffer(buf),worldObj.isRemote ? Side.CLIENT : Side.SERVER,null);
    MessageUtil.ensureEmpty(buf,worldObj.isRemote,getClass().getSimpleName());
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 156419
Project: 156419
Buggy source:
/** 
 * Tells MC to redraw this block. Note that (in 1.9) this ALSO sends a description packet. 
 */
public final void redrawBlock(){
  if (hasWorldObj()) {
    IBlockState state=worldObj.getBlockState(getPos());
    worldObj.notifyBlockUpdate(pos,state,state,0);
  }
}

Fixed version (ground truth):
/** 
 * Tells MC to redraw this block. Note that (in 1.9) this ALSO sends a description packet. 
 */
public final void redrawBlock(){
  if (hasWorldObj()) {
    IBlockState state=worldObj.getBlockState(pos);
    worldObj.notifyBlockUpdate(pos,state,state,0);
  }
}
Program: 156420
Project: 156420
Buggy source:
@Override public final NBTTagCompound getUpdateTag(){
  MessageUpdateTile message=createNetworkUpdate(NET_RENDER_DATA);
  ByteBuf buf=Unpooled.buffer();
  message.toBytes(buf);
  byte[] bytes=new byte[buf.readableBytes()];
  buf.readBytes(bytes);
  NBTTagCompound nbt=super.getUpdateTag();
  nbt.setByteArray("String_Node_Str",bytes);
  return nbt;
}

Fixed version (ground truth):
@Override public final NBTTagCompound getUpdateTag(){
  ByteBuf buf=Unpooled.buffer();
  buf.writeShort(NET_RENDER_DATA);
  writePayload(NET_RENDER_DATA,new PacketBuffer(buf),worldObj.isRemote ? Side.CLIENT : Side.SERVER);
  byte[] bytes=new byte[buf.readableBytes()];
  buf.readBytes(bytes);
  NBTTagCompound nbt=super.getUpdateTag();
  nbt.setByteArray("String_Node_Str",bytes);
  return nbt;
}
Program: 156422
Project: 156422
Buggy source:
@SideOnly(Side.CLIENT) public final void handleMessageMain(MessageMarker message){
  if (handleMessage(message)) {
    return;
  }
  if (!message.connection) {
    List<BlockPos> positions=message.positions;
    if (message.add) {
      for (      BlockPos p : positions) {
        removeMarker(p);
      }
    }
 else {
      for (      BlockPos p : positions) {
        loadMarker(p,null);
      }
    }
  }
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public final void handleMessageMain(MessageMarker message){
  if (handleMessage(message)) {
    return;
  }
  if (!message.connection) {
    List<BlockPos> positions=message.positions;
    if (message.add) {
      for (      BlockPos p : positions) {
        loadMarker(p,null);
      }
    }
 else {
      for (      BlockPos p : positions) {
        removeMarker(p);
      }
    }
  }
}
Program: 156423
Project: 156423
Buggy source:
@SubscribeEvent public void itemTooltipEvent(ItemTooltipEvent event){
  if (event.itemStack != null && event.entityPlayer != null && event.entityPlayer.openContainer != null && event.entityPlayer.openContainer instanceof ContainerBuilder) {
    ContainerBuilder containerBuilder=(ContainerBuilder)event.entityPlayer.openContainer;
    TileBuilder builder=containerBuilder.getBuilder();
    if (builder != null) {
      List<RequirementItemStack> needs=builder.getNeededItems();
      if (needs != null) {
        for (        RequirementItemStack ris : needs) {
          if (ris.stack == event.itemStack) {
            event.toolTip.add(EnumChatFormatting.GRAY + "String_Node_Str" + EnumChatFormatting.ITALIC+ "String_Node_Str"+ ris.size);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public void itemTooltipEvent(ItemTooltipEvent event){
  EntityPlayer player=event.getEntityPlayer();
  if (event.getItemStack() != null && player != null && player.openContainer != null && player.openContainer instanceof ContainerBuilder) {
    ContainerBuilder containerBuilder=(ContainerBuilder)player.openContainer;
    TileBuilder builder=containerBuilder.getBuilder();
    if (builder != null) {
      List<RequirementItemStack> needs=builder.getNeededItems();
      if (needs != null) {
        for (        RequirementItemStack ris : needs) {
          if (ris.stack == event.getItemStack()) {
            event.getToolTip().add(TextFormatting.GRAY + "String_Node_Str" + TextFormatting.ITALIC+ "String_Node_Str"+ ris.size);
          }
        }
      }
    }
  }
}
Program: 156424
Project: 156424
Buggy source:
@SubscribeEvent public void handleWorldUnload(WorldEvent.Unload event){
  if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
    TilePathMarker.clearAvailableMarkersList(event.world);
  }
}

Fixed version (ground truth):
@SubscribeEvent public void handleWorldUnload(WorldEvent.Unload event){
  if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
    TilePathMarker.clearAvailableMarkersList(event.getWorld());
  }
}
Program: 156425
Project: 156425
Buggy source:
@SubscribeEvent public void handleWorldLoad(WorldEvent.Load event){
  if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
    TilePathMarker.clearAvailableMarkersList(event.world);
  }
}

Fixed version (ground truth):
@SubscribeEvent public void handleWorldLoad(WorldEvent.Load event){
  if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
    TilePathMarker.clearAvailableMarkersList(event.getWorld());
  }
}
Program: 156426
Project: 156426
Buggy source:
public static void start(){
  Iterator<Block> i=Block.blockRegistry.iterator();
  while (i.hasNext()) {
    Block block=i.next();
    if (block == null || block == Blocks.air) {
      continue;
    }
    for (    Object obj : block.getBlockState().getValidStates()) {
      IBlockState state=(IBlockState)obj;
      if (!SchematicRegistry.INSTANCE.isSupported(state)) {
        try {
          if (block.hasTileEntity(state)) {
            SchematicRegistry.INSTANCE.registerSchematicBlock(state,SchematicTileCreative.class);
            continue;
          }
          try {
            if (block instanceof IFluidBlock) {
              IFluidBlock fblock=(IFluidBlock)block;
              if (fblock.getFluid() != null) {
                SchematicRegistry.INSTANCE.registerSchematicBlock(state,SchematicFluid.class,new FluidStack(fblock.getFluid(),1000));
              }
            }
 else {
              SchematicRegistry.INSTANCE.registerSchematicBlock(state,SchematicBlock.class);
            }
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
 catch (        Exception e) {
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void start(){
  Iterator<Block> i=Block.REGISTRY.iterator();
  while (i.hasNext()) {
    Block block=i.next();
    if (block == null || block == Blocks.AIR) {
      continue;
    }
    for (    Object obj : block.getBlockState().getValidStates()) {
      IBlockState state=(IBlockState)obj;
      if (!SchematicRegistry.INSTANCE.isSupported(state)) {
        try {
          if (block.hasTileEntity(state)) {
            SchematicRegistry.INSTANCE.registerSchematicBlock(state,SchematicTileCreative.class);
            continue;
          }
          try {
            if (block instanceof IFluidBlock) {
              IFluidBlock fblock=(IFluidBlock)block;
              if (fblock.getFluid() != null) {
                SchematicRegistry.INSTANCE.registerSchematicBlock(state,SchematicFluid.class,new FluidStack(fblock.getFluid(),1000));
              }
            }
 else {
              SchematicRegistry.INSTANCE.registerSchematicBlock(state,SchematicBlock.class);
            }
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
 catch (        Exception e) {
        }
      }
    }
  }
}
Program: 156427
Project: 156427
Buggy source:
@Override public ItemStack load(ItemStack stack,NBTTagCompound compound){
  ItemStack out=new ItemStack(Items.written_book);
  NBTTagCompound outNBT=new NBTTagCompound();
  outNBT.setString("String_Node_Str",compound.getString("String_Node_Str"));
  outNBT.setString("String_Node_Str",compound.getString("String_Node_Str"));
  outNBT.setTag("String_Node_Str",compound.getTagList("String_Node_Str",8));
  out.setTagCompound(outNBT);
  return out;
}

Fixed version (ground truth):
@Override public ItemStack load(ItemStack stack,NBTTagCompound compound){
  ItemStack out=new ItemStack(Items.WRITTEN_BOOK);
  NBTTagCompound outNBT=new NBTTagCompound();
  outNBT.setString("String_Node_Str",compound.getString("String_Node_Str"));
  outNBT.setString("String_Node_Str",compound.getString("String_Node_Str"));
  outNBT.setTag("String_Node_Str",compound.getTagList("String_Node_Str",8));
  out.setTagCompound(outNBT);
  return out;
}
Program: 156428
Project: 156428
Buggy source:
@Override public boolean isHandler(ItemStack stack,HandlerType type){
  if (type == HandlerType.STORE) {
    return stack.getItem() == Items.written_book;
  }
 else {
    return stack.getItem() == Items.writable_book || stack.getItem() == Items.written_book;
  }
}

Fixed version (ground truth):
@Override public boolean isHandler(ItemStack stack,HandlerType type){
  if (type == HandlerType.STORE) {
    return stack.getItem() == Items.WRITTEN_BOOK;
  }
 else {
    return stack.getItem() == Items.WRITABLE_BOOK || stack.getItem() == Items.WRITTEN_BOOK;
  }
}