nus-yam/ex-repair huggingface dataset:
Program: 156601
Project: 156601
Buggy source:
@Override public boolean handle(World world,BlockPos pos,EnumFacing direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  int pipesToTry=8;
  int pipeWireColor=stack.getItemDamage();
  Vec3 p=new Vec3(pos);
  p.orientation=direction;
  while (pipesToTry > 0) {
    p.moveBackwards(1.0);
    TileEntity tile=world.getTileEntity((int)p.x,(int)p.y,(int)p.z);
    if (tile instanceof TileGenericPipe) {
      TileGenericPipe pipeTile=(TileGenericPipe)tile;
      if (!pipeTile.pipe.wireSet[pipeWireColor]) {
        pipeTile.pipe.wireSet[pipeWireColor]=true;
        pipeTile.pipe.signalStrength[pipeWireColor]=0;
        pipeTile.pipe.updateSignalState();
        pipeTile.scheduleRenderUpdate();
        world.notifyBlocksOfNeighborChange(pipeTile.xCoord,pipeTile.yCoord,pipeTile.zCoord,pipeTile.getBlock());
        return true;
      }
 else {
        pipesToTry--;
        continue;
      }
    }
 else {
      break;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean handle(World world,BlockPos pos,EnumFacing direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  int pipesToTry=8;
  int pipeWireColor=stack.getItemDamage();
  Vec3 p=Utils.convert(pos);
  while (pipesToTry > 0) {
    p=p.add(Utils.convert(direction,-1));
    TileEntity tile=world.getTileEntity(Utils.convertFloor(p));
    if (tile instanceof TileGenericPipe) {
      TileGenericPipe pipeTile=(TileGenericPipe)tile;
      if (!pipeTile.pipe.wireSet[pipeWireColor]) {
        pipeTile.pipe.wireSet[pipeWireColor]=true;
        pipeTile.pipe.signalStrength[pipeWireColor]=0;
        pipeTile.pipe.updateSignalState();
        pipeTile.scheduleRenderUpdate();
        world.notifyNeighborsOfStateChange(pipeTile.getPos(),pipeTile.getBlock());
        return true;
      }
 else {
        pipesToTry--;
        continue;
      }
    }
 else {
      break;
    }
  }
  return false;
}
Program: 156602
Project: 156602
Buggy source:
/** 
 * Every parameter needs a unique tag, it should be in the format of "&lt;modi&gt;:&lt;name&gt;".
 * @return the unique id 
 */
String getUniqueTag();

Fixed version (ground truth):
/** 
 * Every parameter needs a unique tag, it should be in the format of "&lt;modid&gt;:&lt;name&gt;".
 * @return the unique id 
 */
String getUniqueTag();
Program: 156603
Project: 156603
Buggy source:
protected BCStatement(ResourceLocation loc,String... uniqueTag){
  this.uniqueTag=uniqueTag[0];
  for (  String tag : uniqueTag) {
    StatementManager.statements.put(tag,this);
  }
  location=loc;
  MinecraftForge.EVENT_BUS.register(this);
}

Fixed version (ground truth):
/** 
 * UniqueTag accepts multiple possible tags, use this feature to migrate to more standardized tags if needed, otherwise just pass a single string. The first passed string will be the one used when saved to disk. The ResourceLocation is the location of the icon to be displayed for this statement
 * @param uniqueTag 
 */
protected BCStatement(ResourceLocation loc,String... uniqueTag){
  this.uniqueTag=uniqueTag[0];
  for (  String tag : uniqueTag) {
    StatementManager.statements.put(tag,this);
  }
  location=loc;
  MinecraftForge.EVENT_BUS.register(this);
}
Program: 156604
Project: 156604
Buggy source:
@SubscribeEvent @SideOnly(Side.CLIENT) public void textureHook(TextureStitchEvent.Pre event){
  for (  Item i : BlockGenericPipe.pipes.keySet()) {
    Pipe<?> dummyPipe=BlockGenericPipe.createPipe(i);
    if (dummyPipe != null) {
      dummyPipe.getIconProvider().registerIcons(event.map);
    }
  }
  wireIconProvider.registerIcons(event.map);
  for (  GateDefinition.GateMaterial material : GateDefinition.GateMaterial.VALUES) {
    material.registerBlockIcon(event.map);
  }
  for (  GateDefinition.GateLogic logic : GateDefinition.GateLogic.VALUES) {
    logic.registerBlockIcon(event.map);
  }
  for (  IGateExpansion expansion : GateExpansions.getExpansions()) {
    expansion.registerBlockOverlay(event.map);
  }
}

Fixed version (ground truth):
@SubscribeEvent @SideOnly(Side.CLIENT) public void textureHook(TextureStitchEvent.Pre event){
  for (  Item i : BlockGenericPipe.pipes.keySet()) {
    Pipe<?> dummyPipe=BlockGenericPipe.createPipe(i);
    if (dummyPipe != null) {
      dummyPipe.getIconProvider().registerIcons(event.map);
    }
  }
  wireIconProvider.registerIcons(event.map);
  for (  GateDefinition.GateMaterial material : GateDefinition.GateMaterial.VALUES) {
    material.registerBlockIcon(event.map);
  }
  for (  GateDefinition.GateLogic logic : GateDefinition.GateLogic.VALUES) {
    logic.registerBlockIcon(event.map);
  }
  for (  IGateExpansion expansion : GateExpansions.getExpansions()) {
    expansion.registerBlockOverlay(event.map);
  }
  TriggerParameterSignal.registerIcons(event);
  ActionParameterSignal.registerIcons(event);
}
Program: 156605
Project: 156605
Buggy source:
public ActionExtractionPreset(EnumColor color){
  super("String_Node_Str" + color.getTag(),"String_Node_Str" + color.getTag());
  this.color=color;
}

Fixed version (ground truth):
public ActionExtractionPreset(EnumColor color){
  super(new ResourceLocation("String_Node_Str" + color.name().toLowerCase(Locale.ENGLISH)),"String_Node_Str" + color.getTag(),"String_Node_Str" + color.getTag());
  this.color=color;
}
Program: 156606
Project: 156606
Buggy source:
@Override public void registerIcons(TextureAtlasSpriteRegister iconRegister){
  icons=new TextureAtlasSprite[]{iconRegister.registerIcon("String_Node_Str"),iconRegister.registerIcon("String_Node_Str"),iconRegister.registerIcon("String_Node_Str"),iconRegister.registerIcon("String_Node_Str")};
}

Fixed version (ground truth):
public static void registerIcons(TextureStitchEvent.Pre event){
  icons=new TextureAtlasSprite[4];
  icons[0]=event.map.registerSprite(new ResourceLocation("String_Node_Str"));
  icons[1]=event.map.registerSprite(new ResourceLocation("String_Node_Str"));
  icons[2]=event.map.registerSprite(new ResourceLocation("String_Node_Str"));
  icons[3]=event.map.registerSprite(new ResourceLocation("String_Node_Str"));
}
Program: 156607
Project: 156607
Buggy source:
public ActionPipeColor(EnumColor color){
  super("String_Node_Str" + color.getTag(),"String_Node_Str" + color.getTag());
  this.color=color;
}

Fixed version (ground truth):
public ActionPipeColor(EnumColor color){
  super(new ResourceLocation("String_Node_Str" + color.name().toLowerCase(Locale.ENGLISH)),"String_Node_Str" + color.getTag(),"String_Node_Str" + color.getTag());
  this.color=color;
}
Program: 156608
Project: 156608
Buggy source:
@Override public IStatement rotateLeft(){
  return BuildCraftTransport.actionPipeDirection[direction.getRotation(EnumFacing.UP).ordinal()];
}

Fixed version (ground truth):
@Override public IStatement rotateLeft(){
  EnumFacing face=direction.getAxis() == Axis.Y ? direction : direction.rotateY();
  return BuildCraftTransport.actionPipeDirection[face.ordinal()];
}
Program: 156609
Project: 156609
Buggy source:
public ActionPowerLimiter(PowerMode limit){
  super("String_Node_Str" + limit.name().toLowerCase(Locale.ENGLISH),"String_Node_Str" + limit.name().toLowerCase(Locale.ENGLISH));
  this.limit=limit;
}

Fixed version (ground truth):
public ActionPowerLimiter(PowerMode limit){
  super(new ResourceLocation("String_Node_Str" + limit.name().toLowerCase(Locale.ENGLISH)),"String_Node_Str" + limit.name().toLowerCase(Locale.ENGLISH),"String_Node_Str" + limit.name().toLowerCase(Locale.ENGLISH));
  this.limit=limit;
}
Program: 156610
Project: 156610
Buggy source:
public ActionRedstoneFaderOutput(int level){
  super(String.format("String_Node_Str",level));
  this.level=level;
}

Fixed version (ground truth):
public ActionRedstoneFaderOutput(int level){
  super(String.format("String_Node_Str",level));
  location=new ResourceLocation(String.format("String_Node_Str",level));
  this.level=level;
}
Program: 156611
Project: 156611
Buggy source:
public ActionSignalOutput(PipeWire color){
  super("String_Node_Str" + color.name().toLowerCase(Locale.ENGLISH),"String_Node_Str" + color.name().toLowerCase(Locale.ENGLISH));
  this.color=color;
}

Fixed version (ground truth):
public ActionSignalOutput(PipeWire color){
  super("String_Node_Str" + color.name().toLowerCase(Locale.ENGLISH),"String_Node_Str" + color.name().toLowerCase(Locale.ENGLISH));
  location=new ResourceLocation("String_Node_Str" + color.name().toLowerCase() + "String_Node_Str");
  this.color=color;
}
Program: 156612
Project: 156612
Buggy source:
public ActionSingleEnergyPulse(){
  super("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public ActionSingleEnergyPulse(){
  super("String_Node_Str","String_Node_Str");
  location=new ResourceLocation("String_Node_Str");
}
Program: 156613
Project: 156613
Buggy source:
public ActionValve(ValveState valveState){
  super("String_Node_Str" + valveState.name().toLowerCase(Locale.ENGLISH));
  state=valveState;
}

Fixed version (ground truth):
public ActionValve(ValveState valveState){
  super("String_Node_Str" + valveState.name().toLowerCase(Locale.ENGLISH));
  state=valveState;
  location=new ResourceLocation("String_Node_Str" + state.name().toLowerCase(Locale.ENGLISH));
}
Program: 156614
Project: 156614
Buggy source:
@Override public void actionActivate(IStatementContainer container,IStatementParameter[] parameters){
  IPipe pipe=((Gate)container).getPipe();
  if (pipe != null && pipe instanceof Pipe) {
    PipeTransport transport=((Pipe)pipe).transport;
    if (parameters[0] != null && parameters[0] instanceof StatementParameterDirection) {
      EnumFacing side=((StatementParameterDirection)parameters[0]).direction;
      if (side != null) {
        transport.allowInput(side,state.inputOpen);
        transport.allowOutput(side,state.outputOpen);
      }
    }
 else {
      for (      EnumFacing side : EnumFacing.VALUES) {
        transport.allowInput(side,state.inputOpen);
        transport.allowOutput(side,state.outputOpen);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void actionActivate(IStatementContainer container,IStatementParameter[] parameters){
  IPipe pipe=((Gate)container).getPipe();
  if (pipe != null && pipe instanceof Pipe) {
    PipeTransport transport=((Pipe<?>)pipe).transport;
    if (parameters[0] != null && parameters[0] instanceof StatementParameterDirection) {
      EnumFacing side=((StatementParameterDirection)parameters[0]).direction;
      if (side != null) {
        transport.allowInput(side,state.inputOpen);
        transport.allowOutput(side,state.outputOpen);
      }
    }
 else {
      for (      EnumFacing side : EnumFacing.VALUES) {
        transport.allowInput(side,state.inputOpen);
        transport.allowOutput(side,state.outputOpen);
      }
    }
  }
}
Program: 156615
Project: 156615
Buggy source:
public TriggerClockTimer(Time time){
  super("String_Node_Str" + time.name().toLowerCase(Locale.ENGLISH));
  this.time=time;
}

Fixed version (ground truth):
public TriggerClockTimer(Time time){
  super("String_Node_Str" + time.name().toLowerCase(Locale.ENGLISH));
  location=new ResourceLocation("String_Node_Str" + time.name().toLowerCase(Locale.ENGLISH));
  this.time=time;
}
Program: 156616
Project: 156616
Buggy source:
public static BlockPos convertFloor(Vec3 vec){
  return new BlockPos(vec.xCoord,vec.yCoord,vec.zCoord);
}

Fixed version (ground truth):
public static BlockPos convertFloor(EnumFacing face,int multiple){
  return convertFloor(convert(face,multiple));
}
Program: 156617
Project: 156617
Buggy source:
@Override public IFluidHandler getFluidInput(){
  if (getPipe().getPipeType() != IPipeTile.PipeType.FLUID) {
    return null;
  }
  if (!(getPipe().getPipe() instanceof PipeFluidsWood)) {
    return null;
  }
  int meta=((TileEntity)getPipe()).getBlockMetadata();
  EnumFacing dir=EnumFacing.getOrientation(meta);
  TileEntity connectedTile=getPipe().getWorld().getTileEntity(x() + dir.offsetX,y() + dir.offsetY,z() + dir.offsetZ);
  if (connectedTile instanceof IFluidHandler) {
    return (IFluidHandler)connectedTile;
  }
  return null;
}

Fixed version (ground truth):
@Override public IFluidHandler getFluidInput(){
  if (getPipe().getPipeType() != IPipeTile.PipeType.FLUID) {
    return null;
  }
  if (!(getPipe().getPipe() instanceof PipeFluidsWood)) {
    return null;
  }
  int meta=((TileEntity)getPipe()).getBlockMetadata();
  EnumFacing dir=EnumFacing.getFront(meta);
  TileEntity connectedTile=getPipe().getWorld().getTileEntity(getPos().add(Utils.convertFloor(dir)));
  if (connectedTile instanceof IFluidHandler) {
    return (IFluidHandler)connectedTile;
  }
  return null;
}
Program: 156618
Project: 156618
Buggy source:
public IPipeTile getPipe(){
  if (pipe == null) {
    pipe=(IPipeTile)world.getTileEntity(x(),y(),z());
  }
  if (pipe == null || ((TileEntity)pipe).isInvalid()) {
    RobotManager.registryProvider.getRegistry(world).removeStation(this);
    pipe=null;
  }
  return pipe;
}

Fixed version (ground truth):
public IPipeTile getPipe(){
  if (pipe == null) {
    pipe=(IPipeTile)world.getTileEntity(getPos());
  }
  if (pipe == null || ((TileEntity)pipe).isInvalid()) {
    RobotManager.registryProvider.getRegistry(world).removeStation(this);
    pipe=null;
  }
  return pipe;
}
Program: 156619
Project: 156619
Buggy source:
@Override public boolean isInitialized(){
  if (getPipe() == null || getPipe().getPipe() == null) {
    return false;
  }
  return ((Pipe)getPipe().getPipe()).isInitialized();
}

Fixed version (ground truth):
@Override public boolean isInitialized(){
  if (getPipe() == null || getPipe().getPipe() == null) {
    return false;
  }
  return ((Pipe<?>)getPipe().getPipe()).isInitialized();
}
Program: 156620
Project: 156620
Buggy source:
@Override public int injectItem(ItemStack stack,boolean doAdd,EnumFacing from,EnumColor color){
  if (doAdd) {
    float cx=x() + 0.5F + 0.2F * side().offsetX;
    float cy=y() + 0.5F + 0.2F * side().offsetY;
    float cz=z() + 0.5F + 0.2F * side().offsetZ;
    TravelingItem item=TravelingItem.make(cx,cy,cz,stack);
    ((PipeTransportItems)((Pipe)getPipe().getPipe()).transport).injectItem(item,from);
  }
  return stack.stackSize;
}

Fixed version (ground truth):
@Override public int injectItem(ItemStack stack,boolean doAdd,EnumFacing from,EnumColor color){
  if (doAdd) {
    Vec3 vec=Utils.convertMiddle(getPos()).add(Utils.convert(side,0.2));
    TravelingItem item=TravelingItem.make(vec,stack);
    ((PipeTransportItems)((Pipe<?>)getPipe().getPipe()).transport).injectItem(item,from);
  }
  return stack.stackSize;
}
Program: 156621
Project: 156621
Buggy source:
@Override public IFluidHandler getFluidOutput(){
  if (getPipe().getPipeType() != IPipeTile.PipeType.FLUID) {
    return null;
  }
  return (IFluidHandler)((Pipe)getPipe().getPipe()).transport;
}

Fixed version (ground truth):
@Override public IFluidHandler getFluidOutput(){
  if (getPipe().getPipeType() != IPipeTile.PipeType.FLUID) {
    return null;
  }
  return (IFluidHandler)((Pipe<?>)getPipe().getPipe()).transport;
}
Program: 156622
Project: 156622
Buggy source:
@Override public IInventory getItemInput(){
  if (getPipe().getPipeType() != IPipeTile.PipeType.ITEM) {
    return null;
  }
  if (!(getPipe().getPipe() instanceof PipeItemsWood)) {
    return null;
  }
  int meta=((TileEntity)getPipe()).getBlockMetadata();
  EnumFacing dir=EnumFacing.getOrientation(meta);
  TileEntity connectedTile=getPipe().getWorld().getTileEntity(x() + dir.offsetX,y() + dir.offsetY,z() + dir.offsetZ);
  if (connectedTile instanceof IInventory) {
    return (IInventory)connectedTile;
  }
  return null;
}

Fixed version (ground truth):
@Override public IInventory getItemInput(){
  if (getPipe().getPipeType() != IPipeTile.PipeType.ITEM) {
    return null;
  }
  if (!(getPipe().getPipe() instanceof PipeItemsWood)) {
    return null;
  }
  int meta=((TileEntity)getPipe()).getBlockMetadata();
  EnumFacing dir=EnumFacing.getFront(meta);
  TileEntity connectedTile=getPipe().getWorld().getTileEntity(getPos().add(Utils.convertFloor(dir)));
  if (connectedTile instanceof IInventory) {
    return (IInventory)connectedTile;
  }
  return null;
}
Program: 156623
Project: 156623
Buggy source:
@Override public IRequestProvider getRequestProvider(){
  for (  EnumFacing dir : EnumFacing.VALUES) {
    TileEntity nearbyTile=getPipe().getWorld().getTileEntity(x() + dir.offsetX,y() + dir.offsetY,z() + dir.offsetZ);
    if (nearbyTile instanceof IRequestProvider) {
      return (IRequestProvider)nearbyTile;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public IRequestProvider getRequestProvider(){
  for (  EnumFacing dir : EnumFacing.VALUES) {
    TileEntity nearbyTile=getPipe().getWorld().getTileEntity(getPos().add(Utils.convertFloor(dir)));
    if (nearbyTile instanceof IRequestProvider) {
      return (IRequestProvider)nearbyTile;
    }
  }
  return null;
}
Program: 156624
Project: 156624
Buggy source:
protected void findTable(){
  int meta=getBlockMetadata();
  int minX=xCoord - 5;
  int minY=yCoord - 5;
  int minZ=zCoord - 5;
  int maxX=xCoord + 5;
  int maxY=yCoord + 5;
  int maxZ=zCoord + 5;
switch (EnumFacing.getOrientation(meta)) {
case WEST:
    maxX=xCoord;
  break;
case EAST:
minX=xCoord;
break;
case DOWN:
maxY=yCoord;
break;
case UP:
minY=yCoord;
break;
case NORTH:
maxZ=zCoord;
break;
default :
case SOUTH:
minZ=zCoord;
break;
}
List<ILaserTarget> targets=new LinkedList<ILaserTarget>();
if (minY < 0) {
minY=0;
}
if (maxY > 255) {
maxY=255;
}
for (int y=minY; y <= maxY; ++y) {
for (int x=minX; x <= maxX; ++x) {
for (int z=minZ; z <= maxZ; ++z) {
if (BlockUtils.getBlock(worldObj,pos) instanceof ILaserTargetBlock) {
TileEntity tile=BlockUtils.getTileEntity(worldObj,pos);
if (tile instanceof ILaserTarget) {
ILaserTarget table=(ILaserTarget)tile;
if (table.requiresLaserEnergy()) {
targets.add(table);
}
}
}
}
}
}
if (targets.isEmpty()) {
return;
}
laserTarget=targets.get(worldObj.rand.nextInt(targets.size()));
}

Fixed version (ground truth):
protected void findTable(){
  int meta=getBlockMetadata();
  int minX=xCoord - 5;
  int minY=yCoord - 5;
  int minZ=zCoord - 5;
  int maxX=xCoord + 5;
  int maxY=yCoord + 5;
  int maxZ=zCoord + 5;
switch (EnumFacing.getFront(meta)) {
case WEST:
    maxX=xCoord;
  break;
case EAST:
minX=xCoord;
break;
case DOWN:
maxY=yCoord;
break;
case UP:
minY=yCoord;
break;
case NORTH:
maxZ=zCoord;
break;
default :
case SOUTH:
minZ=zCoord;
break;
}
List<ILaserTarget> targets=new LinkedList<ILaserTarget>();
if (minY < 0) {
minY=0;
}
if (maxY > 255) {
maxY=255;
}
for (int y=minY; y <= maxY; ++y) {
for (int x=minX; x <= maxX; ++x) {
for (int z=minZ; z <= maxZ; ++z) {
if (BlockUtils.getBlock(worldObj,pos) instanceof ILaserTargetBlock) {
TileEntity tile=BlockUtils.getTileEntity(worldObj,pos);
if (tile instanceof ILaserTarget) {
ILaserTarget table=(ILaserTarget)tile;
if (table.requiresLaserEnergy()) {
targets.add(table);
}
}
}
}
}
}
if (targets.isEmpty()) {
return;
}
laserTarget=targets.get(worldObj.rand.nextInt(targets.size()));
}
Program: 156625
Project: 156625
Buggy source:
protected void updateLaser(){
  int meta=getBlockMetadata();
  double px=0, py=0, pz=0;
switch (EnumFacing.getOrientation(meta)) {
case WEST:
    px=-LASER_OFFSET;
  break;
case EAST:
px=LASER_OFFSET;
break;
case DOWN:
py=-LASER_OFFSET;
break;
case UP:
py=LASER_OFFSET;
break;
case NORTH:
pz=-LASER_OFFSET;
break;
case SOUTH:
default :
pz=LASER_OFFSET;
break;
}
Vec3 head=new Vec3(xCoord + 0.5 + px,yCoord + 0.5 + py,zCoord + 0.5 + pz);
Vec3 tail=new Vec3(laserTarget.getXCoord() + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F,laserTarget.getYCoord() + 9F / 16F,laserTarget.getZCoord() + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F);
laser.head=head;
laser.tail=tail;
if (!laser.isVisible) {
laser.isVisible=true;
}
}

Fixed version (ground truth):
protected void updateLaser(){
  int meta=getBlockMetadata();
  double px=0, py=0, pz=0;
switch (EnumFacing.getFront(meta)) {
case WEST:
    px=-LASER_OFFSET;
  break;
case EAST:
px=LASER_OFFSET;
break;
case DOWN:
py=-LASER_OFFSET;
break;
case UP:
py=LASER_OFFSET;
break;
case NORTH:
pz=-LASER_OFFSET;
break;
case SOUTH:
default :
pz=LASER_OFFSET;
break;
}
Vec3 head=new Vec3(xCoord + 0.5 + px,yCoord + 0.5 + py,zCoord + 0.5 + pz);
Vec3 tail=new Vec3(laserTarget.getXCoord() + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F,laserTarget.getYCoord() + 9F / 16F,laserTarget.getZCoord() + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F);
laser.head=head;
laser.tail=tail;
if (!laser.isVisible) {
laser.isVisible=true;
}
}
Program: 156627
Project: 156627
Buggy source:
private ItemStack getResult(InventoryCrafting crafting){
  ItemStack oneColorPipeStack=null;
  ItemStack pipeStack=null;
  boolean hasDifferentColorPipes=false;
  boolean hasDifferentPipes=false;
  boolean isBleach=false;
  ItemStack dye=null;
  for (int i=0; i < 9; i++) {
    ItemStack stack=crafting.getStackInSlot(i);
    if (stack == null || stack.getItem() == null || stack.stackSize == 0) {
      continue;
    }
    if (stack.getItem() instanceof ItemPipe) {
      if (pipeStack == null) {
        pipeStack=new ItemStack(stack.getItem(),1,0);
        oneColorPipeStack=new ItemStack(stack.getItem(),1,stack.getItemDamage());
      }
 else {
        if (stack.getItem() == pipeStack.getItem()) {
          pipeStack.stackSize++;
          if (oneColorPipeStack.getItemDamage() == oneColorPipeStack.getItemDamage()) {
            oneColorPipeStack.stackSize++;
          }
 else {
            hasDifferentColorPipes=true;
          }
        }
 else {
          hasDifferentColorPipes=true;
          hasDifferentPipes=true;
        }
      }
    }
 else     if (stack.getItem() == Items.water_bucket) {
      isBleach=true;
    }
 else     if (ColorUtils.isDye(stack)) {
      dye=stack;
    }
  }
  if (isBleach && dye != null) {
    return null;
  }
 else   if (pipeStack != null && (isBleach || (dye != null && pipeStack.stackSize == 8)) && !hasDifferentPipes) {
    ItemStack result=pipeStack;
    if (dye != null) {
      result.setItemDamage(ColorUtils.getColorIDFromDye(dye) + 1);
    }
    return result;
  }
  return null;
}

Fixed version (ground truth):
private ItemStack getResult(InventoryCrafting crafting){
  ItemStack oneColorPipeStack=null;
  ItemStack pipeStack=null;
  boolean hasDifferentPipes=false;
  boolean isBleach=false;
  ItemStack dye=null;
  for (int i=0; i < 9; i++) {
    ItemStack stack=crafting.getStackInSlot(i);
    if (stack == null || stack.getItem() == null || stack.stackSize == 0) {
      continue;
    }
    if (stack.getItem() instanceof ItemPipe) {
      if (pipeStack == null) {
        pipeStack=new ItemStack(stack.getItem(),1,0);
        oneColorPipeStack=new ItemStack(stack.getItem(),1,stack.getItemDamage());
      }
 else {
        if (stack.getItem() == pipeStack.getItem()) {
          pipeStack.stackSize++;
          if (oneColorPipeStack.getItemDamage() == oneColorPipeStack.getItemDamage()) {
            oneColorPipeStack.stackSize++;
          }
        }
 else {
          hasDifferentPipes=true;
        }
      }
    }
 else     if (stack.getItem() == Items.water_bucket) {
      isBleach=true;
    }
 else     if (ColorUtils.isDye(stack)) {
      dye=stack;
    }
  }
  if (isBleach && dye != null) {
    return null;
  }
 else   if (pipeStack != null && (isBleach || (dye != null && pipeStack.stackSize == 8)) && !hasDifferentPipes) {
    ItemStack result=pipeStack;
    if (dye != null) {
      result.setItemDamage(ColorUtils.getColorIDFromDye(dye) + 1);
    }
    return result;
  }
  return null;
}
Program: 156628
Project: 156628
Buggy source:
public void initFromPipe(Class<? extends Pipe> pipeClass){
  capacity=LIQUID_IN_PIPE;
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16 / (flowRate / 10)),1,MAX_TRAVEL_DELAY);
}

Fixed version (ground truth):
public void initFromPipe(Class<? extends Pipe<?>> pipeClass){
  capacity=LIQUID_IN_PIPE;
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16 / (flowRate / 10)),1,MAX_TRAVEL_DELAY);
}
Program: 156629
Project: 156629
Buggy source:
private short computeCurrentConnectionStatesAndTickFlows(short newTimeSlot){
  short outputCount=0;
  for (  EnumFacing direction : orientations) {
    sections[direction.ordinal()].setTime(newTimeSlot);
    sections[direction.ordinal()].moveFluids();
    if (direction == null) {
      continue;
    }
    if (transferState[direction.ordinal()] == TransferState.Input) {
      inputTTL[direction.ordinal()]--;
      if (inputTTL[direction.ordinal()] <= 0) {
        transferState[direction.ordinal()]=TransferState.None;
      }
      continue;
    }
    if (!container.pipe.outputOpen(direction)) {
      transferState[direction.ordinal()]=TransferState.None;
      continue;
    }
    if (outputCooldown[direction.ordinal()] > 0) {
      outputCooldown[direction.ordinal()]--;
      continue;
    }
    if (outputTTL[direction.ordinal()] <= 0) {
      transferState[direction.ordinal()]=TransferState.None;
      outputCooldown[direction.ordinal()]=OUTPUT_COOLDOWN;
      outputTTL[direction.ordinal()]=OUTPUT_TTL;
      continue;
    }
    if (canReceiveCache[direction.ordinal()] && outputOpen(direction)) {
      transferState[direction.ordinal()]=TransferState.Output;
      outputCount++;
    }
  }
  return outputCount;
}

Fixed version (ground truth):
private short computeCurrentConnectionStatesAndTickFlows(short newTimeSlot){
  short outputCount=0;
  for (  EnumFacing direction : orientations) {
    sections[direction.ordinal()].setTime(newTimeSlot);
    sections[direction.ordinal()].moveFluids();
    if (transferState[direction.ordinal()] == TransferState.Input) {
      inputTTL[direction.ordinal()]--;
      if (inputTTL[direction.ordinal()] <= 0) {
        transferState[direction.ordinal()]=TransferState.None;
      }
      continue;
    }
    if (!container.pipe.outputOpen(direction)) {
      transferState[direction.ordinal()]=TransferState.None;
      continue;
    }
    if (outputCooldown[direction.ordinal()] > 0) {
      outputCooldown[direction.ordinal()]--;
      continue;
    }
    if (outputTTL[direction.ordinal()] <= 0) {
      transferState[direction.ordinal()]=TransferState.None;
      outputCooldown[direction.ordinal()]=OUTPUT_COOLDOWN;
      outputTTL[direction.ordinal()]=OUTPUT_TTL;
      continue;
    }
    if (canReceiveCache[direction.ordinal()] && outputOpen(direction)) {
      transferState[direction.ordinal()]=TransferState.Output;
      outputCount++;
    }
  }
  return outputCount;
}
Program: 156630
Project: 156630
Buggy source:
public void initFromPipe(Class<? extends Pipe> pipeClass){
  capacity=25 * Math.min(1000,BuildCraftTransport.pipeFluidsBaseFlowRate);
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16F / (flowRate / 10)),1,MAX_TRAVEL_DELAY);
}

Fixed version (ground truth):
public void initFromPipe(Class<? extends Pipe> pipeClass){
  capacity=25 * Math.min(1000,BuildCraftTransport.pipeFluidsBaseFlowRate);
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16F / (flowRate / BuildCraftTransport.pipeFluidsBaseFlowRate)),1,MAX_TRAVEL_DELAY);
}
Program: 156631
Project: 156631
Buggy source:
private void computeTTLs(){
  for (int i=0; i < 6; i++) {
    if (transferState[i] == TransferState.Input) {
      if (inputTTL[i] > 0) {
        inputTTL[i]--;
      }
 else {
        transferState[i]=TransferState.None;
      }
    }
    if (outputCooldown[i] > 0) {
      outputCooldown[i]--;
    }
 else {
      if (outputTTL[i] > 0) {
        outputTTL[i]--;
      }
 else {
        transferState[i]=TransferState.None;
      }
    }
  }
}

Fixed version (ground truth):
private void computeTTLs(){
  for (int i=0; i < 6; i++) {
    if (transferState[i] == TransferState.Input) {
      if (inputTTL[i] > 0) {
        inputTTL[i]--;
      }
 else {
        transferState[i]=TransferState.None;
      }
    }
    if (outputCooldown[i] > 0) {
      outputCooldown[i]--;
    }
  }
}
Program: 156632
Project: 156632
Buggy source:
private void moveFromPipe(int outputCount){
  if (outputCount > 0) {
    for (    ForgeDirection o : directions) {
      if (transferState[o.ordinal()] == TransferState.Output) {
        TileEntity target=this.container.getTile(o);
        if (!(target instanceof IFluidHandler)) {
          continue;
        }
        PipeSection section=sections[o.ordinal()];
        FluidStack liquidToPush=new FluidStack(fluidType,section.drain(flowRate,false));
        if (liquidToPush.amount > 0) {
          int filled=((IFluidHandler)target).fill(o.getOpposite(),liquidToPush,true);
          section.drain(filled,true);
          if (filled <= 0) {
            outputTTL[o.ordinal()]--;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void moveFromPipe(int outputCount){
  if (outputCount > 0) {
    for (    ForgeDirection o : directions) {
      if (transferState[o.ordinal()] == TransferState.Output) {
        TileEntity target=this.container.getTile(o);
        if (!(target instanceof IFluidHandler)) {
          continue;
        }
        PipeSection section=sections[o.ordinal()];
        FluidStack liquidToPush=new FluidStack(fluidType,section.drain(flowRate,false));
        if (liquidToPush.amount > 0) {
          int filled=((IFluidHandler)target).fill(o.getOpposite(),liquidToPush,true);
          if (filled <= 0) {
            outputTTL[o.ordinal()]--;
          }
 else {
            section.drain(filled,true);
          }
        }
      }
    }
  }
}
Program: 156633
Project: 156633
Buggy source:
@Override public ItemStack craft(ItemStack input,List<ItemStack> expansions,boolean preview){
  PipeWire wire=null;
  ItemStack facade=null;
  for (  ItemStack stack : expansions) {
    if (wire == null && stack.getItem() instanceof ItemPipeWire) {
      wire=PipeWire.fromOrdinal(stack.getItemDamage());
      if (!preview) {
        stack.stackSize--;
      }
    }
 else     if (facade == null && (stack.getItem() instanceof ItemFacade || stack.getItem() == BuildCraftTransport.pipeWire)) {
      facade=stack;
      if (!preview) {
        stack.stackSize--;
      }
    }
  }
  if (wire != null && facade != null) {
    ItemFacade.FacadeState[] states=ItemFacade.getFacadeStates(input);
    ItemFacade.FacadeState additionalState;
    if (facade.getItem() == BuildCraftTransport.plugItem) {
      additionalState=ItemFacade.FacadeState.createTransparent(wire);
    }
 else {
      additionalState=ItemFacade.getFacadeStates(facade)[0];
      additionalState=ItemFacade.FacadeState.create(additionalState.block,additionalState.metadata,wire);
    }
    for (int i=0; i < states.length; i++) {
      if (states[i].wire == wire) {
        states[i]=additionalState;
        return ItemFacade.getFacade(states);
      }
    }
    return ItemFacade.getFacade(JavaTools.concat(states,new ItemFacade.FacadeState[]{additionalState}));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public ItemStack craft(ItemStack input,List<ItemStack> expansions,boolean preview){
  PipeWire wire=null;
  ItemStack facade=null;
  for (  ItemStack stack : expansions) {
    if (wire == null && stack.getItem() instanceof ItemPipeWire) {
      wire=PipeWire.fromOrdinal(stack.getItemDamage());
      if (!preview) {
        stack.stackSize--;
      }
    }
 else     if (facade == null && (stack.getItem() instanceof ItemFacade || stack.getItem() == BuildCraftTransport.pipeWire)) {
      facade=stack;
      if (!preview) {
        stack.stackSize--;
      }
    }
  }
  if (wire != null && facade != null) {
    ItemFacade.FacadeState[] states=ItemFacade.getFacadeStates(input);
    ItemFacade.FacadeState additionalState;
    if (facade.getItem() == BuildCraftTransport.plugItem) {
      additionalState=ItemFacade.FacadeState.createTransparent(wire);
    }
 else {
      additionalState=ItemFacade.getFacadeStates(facade)[0];
      additionalState=new ItemFacade.FacadeState(additionalState.block,additionalState.metadata,wire,additionalState.hollow);
    }
    for (int i=0; i < states.length; i++) {
      if (states[i].wire == wire) {
        states[i]=additionalState;
        return ItemFacade.getFacade(states);
      }
    }
    return ItemFacade.getFacade(JavaTools.concat(states,new ItemFacade.FacadeState[]{additionalState}));
  }
 else {
    return null;
  }
}
Program: 156634
Project: 156634
Buggy source:
public void initFromPipe(Class<? extends Pipe> pipeClass){
  capacity=LIQUID_IN_PIPE;
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16F / (flowRate / 10)),1,MAX_TRAVEL_DELAY);
}

Fixed version (ground truth):
public void initFromPipe(Class<? extends Pipe> pipeClass){
  capacity=LIQUID_IN_PIPE;
  flowRate=fluidCapacities.get(pipeClass);
  travelDelay=MathUtils.clamp(Math.round(16F / (flowRate / BuildCraftTransport.pipeFluidsBaseFlowRate)),1,MAX_TRAVEL_DELAY);
}
Program: 156635
Project: 156635
Buggy source:
private void computeTTLs(){
  for (int i=0; i < 6; i++) {
    if (transferState[i] == TransferState.Input) {
      if (inputTTL[i] > 0) {
        inputTTL[i]--;
      }
 else {
        transferState[i]=TransferState.None;
      }
    }
    if (outputCooldown[i] > 0) {
      outputCooldown[i]--;
    }
 else {
      if (outputTTL[i] > 0) {
        outputTTL[i]--;
      }
 else {
        transferState[i]=TransferState.None;
      }
    }
  }
}

Fixed version (ground truth):
private void computeTTLs(){
  for (int i=0; i < 6; i++) {
    if (transferState[i] == TransferState.Input) {
      if (inputTTL[i] > 0) {
        inputTTL[i]--;
      }
 else {
        transferState[i]=TransferState.None;
      }
    }
    if (outputCooldown[i] > 0) {
      outputCooldown[i]--;
    }
  }
}
Program: 156636
Project: 156636
Buggy source:
private void moveFromPipe(int outputCount){
  if (outputCount > 0) {
    for (    ForgeDirection o : directions) {
      if (transferState[o.ordinal()] == TransferState.Output) {
        TileEntity target=this.container.getTile(o);
        if (!(target instanceof IFluidHandler)) {
          continue;
        }
        PipeSection section=sections[o.ordinal()];
        FluidStack liquidToPush=new FluidStack(fluidType,section.drain(flowRate,false));
        if (liquidToPush.amount > 0) {
          int filled=((IFluidHandler)target).fill(o.getOpposite(),liquidToPush,true);
          section.drain(filled,true);
          if (filled <= 0) {
            outputTTL[o.ordinal()]--;
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void moveFromPipe(int outputCount){
  if (outputCount > 0) {
    for (    ForgeDirection o : directions) {
      if (transferState[o.ordinal()] == TransferState.Output) {
        TileEntity target=this.container.getTile(o);
        if (!(target instanceof IFluidHandler)) {
          continue;
        }
        PipeSection section=sections[o.ordinal()];
        FluidStack liquidToPush=new FluidStack(fluidType,section.drain(flowRate,false));
        if (liquidToPush.amount > 0) {
          int filled=((IFluidHandler)target).fill(o.getOpposite(),liquidToPush,true);
          if (filled <= 0) {
            outputTTL[o.ordinal()]--;
          }
 else {
            section.drain(filled,true);
          }
        }
      }
    }
  }
}
Program: 156637
Project: 156637
Buggy source:
@Override public ItemStack craft(ItemStack input,List<ItemStack> expansions,boolean preview){
  PipeWire wire=null;
  ItemStack facade=null;
  for (  ItemStack stack : expansions) {
    if (wire == null && stack.getItem() instanceof ItemPipeWire) {
      wire=PipeWire.fromOrdinal(stack.getItemDamage());
      if (!preview) {
        stack.stackSize--;
      }
    }
 else     if (facade == null && (stack.getItem() instanceof ItemFacade || stack.getItem() == BuildCraftTransport.pipeWire)) {
      facade=stack;
      if (!preview) {
        stack.stackSize--;
      }
    }
  }
  if (wire != null && facade != null) {
    ItemFacade.FacadeState[] states=ItemFacade.getFacadeStates(input);
    ItemFacade.FacadeState additionalState;
    if (facade.getItem() == BuildCraftTransport.plugItem) {
      additionalState=ItemFacade.FacadeState.createTransparent(wire);
    }
 else {
      additionalState=ItemFacade.getFacadeStates(facade)[0];
      additionalState=ItemFacade.FacadeState.create(additionalState.block,additionalState.metadata,wire);
    }
    for (int i=0; i < states.length; i++) {
      if (states[i].wire == wire) {
        states[i]=additionalState;
        return ItemFacade.getFacade(states);
      }
    }
    return ItemFacade.getFacade(JavaTools.concat(states,new ItemFacade.FacadeState[]{additionalState}));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public ItemStack craft(ItemStack input,List<ItemStack> expansions,boolean preview){
  PipeWire wire=null;
  ItemStack facade=null;
  for (  ItemStack stack : expansions) {
    if (wire == null && stack.getItem() instanceof ItemPipeWire) {
      wire=PipeWire.fromOrdinal(stack.getItemDamage());
      if (!preview) {
        stack.stackSize--;
      }
    }
 else     if (facade == null && (stack.getItem() instanceof ItemFacade || stack.getItem() == BuildCraftTransport.pipeWire)) {
      facade=stack;
      if (!preview) {
        stack.stackSize--;
      }
    }
  }
  if (wire != null && facade != null) {
    ItemFacade.FacadeState[] states=ItemFacade.getFacadeStates(input);
    ItemFacade.FacadeState additionalState;
    if (facade.getItem() == BuildCraftTransport.plugItem) {
      additionalState=ItemFacade.FacadeState.createTransparent(wire);
    }
 else {
      additionalState=ItemFacade.getFacadeStates(facade)[0];
      additionalState=new ItemFacade.FacadeState(additionalState.block,additionalState.metadata,wire,additionalState.hollow);
    }
    for (int i=0; i < states.length; i++) {
      if (states[i].wire == wire) {
        states[i]=additionalState;
        return ItemFacade.getFacade(states);
      }
    }
    return ItemFacade.getFacade(JavaTools.concat(states,new ItemFacade.FacadeState[]{additionalState}));
  }
 else {
    return null;
  }
}
Program: 156638
Project: 156638
Buggy source:
public final void loadFromNBT(NBTTagCompound nbt){
  loadSelfFromNBT(nbt.getCompoundTag("String_Node_Str"));
  if (nbt.hasKey("String_Node_Str")) {
    NBTTagCompound sub=nbt.getCompoundTag("String_Node_Str");
    try {
      Class<?> aiRobotClass=null;
      if (sub.hasKey("String_Node_Str")) {
        aiRobotClass=RobotManager.getAIRobotByLegacyClassName(sub.getString("String_Node_Str"));
      }
 else {
        aiRobotClass=RobotManager.getAIRobotByName(sub.getString("String_Node_Str"));
      }
      if (aiRobotClass != null) {
        delegateAI=(AIRobot)aiRobotClass.getConstructor(EntityRobotBase.class).newInstance(robot);
        if (delegateAI.canLoadFromNBT()) {
          delegateAI.parentAI=this;
          delegateAI.loadFromNBT(sub);
        }
      }
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public final void loadFromNBT(NBTTagCompound nbt){
  loadSelfFromNBT(nbt.getCompoundTag("String_Node_Str"));
  if (nbt.hasKey("String_Node_Str")) {
    NBTTagCompound sub=nbt.getCompoundTag("String_Node_Str");
    try {
      Class<?> aiRobotClass=null;
      if (sub.hasKey("String_Node_Str")) {
        aiRobotClass=RobotManager.getAIRobotByLegacyClassName(sub.getString("String_Node_Str"));
      }
 else {
        aiRobotClass=RobotManager.getAIRobotByName(sub.getString("String_Node_Str"));
      }
      if (aiRobotClass != null) {
        delegateAI=(AIRobot)aiRobotClass.getConstructor(EntityRobotBase.class).newInstance(robot);
        delegateAI.parentAI=this;
        if (delegateAI.canLoadFromNBT()) {
          delegateAI.loadFromNBT(sub);
        }
      }
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}
Program: 156639
Project: 156639
Buggy source:
@Override public ResourceLocation getTexture(){
  return FluidRenderer.getFluidSheet(fluid);
}

Fixed version (ground truth):
@Override public ResourceLocation getTexture(){
  return TextureMap.locationBlocksTexture;
}
Program: 156640
Project: 156640
Buggy source:
@Override public void draw(GuiBuildCraft gui,int guiX,int guiY,int mouseX,int mouseY){
  if (tank == null) {
    return;
  }
  FluidStack fluidStack=tank.getFluid();
  if (fluidStack == null || fluidStack.amount <= 0 || fluidStack.getFluid() == null) {
    return;
  }
  TextureAtlasSprite liquidIcon=FluidRenderer.getFluidTexture(fluidStack,false);
  if (liquidIcon == null) {
    return;
  }
  float scale=Math.min(fluidStack.amount,tank.getCapacity()) / (float)tank.getCapacity();
  gui.bindTexture(FluidRenderer.getFluidSheet(fluidStack));
  for (int col=0; col < w / 16; col++) {
    for (int row=0; row <= h / 16; row++) {
      gui.drawTexturedModalRect(guiX + x + col * 16,guiY + y + row * 16 - 1,liquidIcon,16,16);
    }
  }
  gui.bindTexture(gui.texture);
  gui.drawTexturedModalRect(guiX + x,guiY + y - 1,x,y - 1,w,h - (int)Math.floor(h * scale) + 1);
  gui.drawTexturedModalRect(guiX + x,guiY + y,u,v,w,h);
}

Fixed version (ground truth):
@Override public void draw(GuiBuildCraft gui,int guiX,int guiY,int mouseX,int mouseY){
  if (tank == null) {
    return;
  }
  FluidStack fluidStack=tank.getFluid();
  if (fluidStack == null || fluidStack.amount <= 0 || fluidStack.getFluid() == null) {
    return;
  }
  TextureAtlasSprite liquidIcon=FluidRenderer.getFluidTexture(fluidStack,false);
  if (liquidIcon == null) {
    return;
  }
  float scale=Math.min(fluidStack.amount,tank.getCapacity()) / (float)tank.getCapacity();
  gui.bindTexture(TextureMap.locationBlocksTexture);
  for (int col=0; col < w / 16; col++) {
    for (int row=0; row <= h / 16; row++) {
      gui.drawTexturedModalRect(guiX + x + col * 16,guiY + y + row * 16 - 1,liquidIcon,16,16);
    }
  }
  gui.bindTexture(gui.texture);
  gui.drawTexturedModalRect(guiX + x,guiY + y - 1,x,y - 1,w,h - (int)Math.floor(h * scale) + 1);
  gui.drawTexturedModalRect(guiX + x,guiY + y,u,v,w,h);
}
Program: 156641
Project: 156641
Buggy source:
@Override public void breakBlock(World world,BlockPos pos,IBlockState state){
  TileEntity tile=world.getTileEntity(pos);
  if (tile != null && tile instanceof TileTank) {
    TileTank tank=(TileTank)tile;
    tank.onBlockBreak();
  }
  TileEntity tileAbove=world.getTileEntity(x,y + 1,z);
  TileEntity tileBelow=world.getTileEntity(x,y - 1,z);
  super.breakBlock(world,pos,block,par6);
  if (tileAbove instanceof TileTank) {
    ((TileTank)tileAbove).updateComparators();
  }
  if (tileBelow instanceof TileTank) {
    ((TileTank)tileBelow).updateComparators();
  }
}

Fixed version (ground truth):
@Override public void breakBlock(World world,BlockPos pos,IBlockState state){
  TileEntity tile=world.getTileEntity(pos);
  if (tile != null && tile instanceof TileTank) {
    TileTank tank=(TileTank)tile;
    tank.onBlockBreak();
  }
  TileEntity tileAbove=world.getTileEntity(pos.up());
  TileEntity tileBelow=world.getTileEntity(pos.down());
  super.breakBlock(world,pos,state);
  if (tileAbove instanceof TileTank) {
    ((TileTank)tileAbove).updateComparators();
    world.setBlockState(pos.up(),world.getBlockState(pos.up()).withProperty(JOINED_BELOW,false));
  }
  if (tileBelow instanceof TileTank) {
    ((TileTank)tileBelow).updateComparators();
  }
}
Program: 156643
Project: 156643
Buggy source:
@Mod.EventHandler public void whiteListAppliedEnergetics(FMLInitializationEvent event){
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileAutoWorkbench.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileFloodGate.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileTank.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileRefinery.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileHopper.class.getCanonicalName());
}

Fixed version (ground truth):
@Mod.EventHandler public void whiteListAppliedEnergetics(FMLInitializationEvent event){
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileAutoWorkbench.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileFloodGate.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileTank.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileRefinery.class.getCanonicalName());
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str",TileChute.class.getCanonicalName());
}
Program: 156646
Project: 156646
Buggy source:
@Mod.EventHandler public void remap(FMLMissingMappingsEvent event){
  for (  FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
    if (mapping.name.equals("String_Node_Str")) {
      if (Loader.isModLoaded("String_Node_Str")) {
        if (mapping.type == GameRegistry.Type.BLOCK) {
          mapping.remap(Block.getBlockFromName("String_Node_Str"));
        }
 else         if (mapping.type == GameRegistry.Type.ITEM) {
          mapping.remap(Item.getItemFromBlock(Block.getBlockFromName("String_Node_Str")));
        }
      }
 else {
        mapping.warn();
      }
    }
 else     if (mapping.name.equals("String_Node_Str")) {
      if (Loader.isModLoaded("String_Node_Str")) {
        if (mapping.type == GameRegistry.Type.BLOCK) {
          mapping.remap(Block.getBlockFromName("String_Node_Str"));
        }
 else         if (mapping.type == GameRegistry.Type.ITEM) {
          mapping.remap(Item.getItemFromBlock(Block.getBlockFromName("String_Node_Str")));
        }
      }
 else {
        mapping.ignore();
      }
    }
  }
}

Fixed version (ground truth):
@Mod.EventHandler public void remap(FMLMissingMappingsEvent event){
  for (  FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
    if (mapping.name.equals("String_Node_Str") || mapping.name.equals("String_Node_Str")) {
      if (Loader.isModLoaded("String_Node_Str")) {
        if (mapping.type == GameRegistry.Type.BLOCK) {
          mapping.remap(Block.getBlockFromName("String_Node_Str"));
        }
 else         if (mapping.type == GameRegistry.Type.ITEM) {
          mapping.remap(Item.getItemFromBlock(Block.getBlockFromName("String_Node_Str")));
        }
      }
 else {
        mapping.warn();
      }
    }
 else     if (mapping.name.equals("String_Node_Str")) {
      if (Loader.isModLoaded("String_Node_Str")) {
        if (mapping.type == GameRegistry.Type.BLOCK) {
          mapping.remap(Block.getBlockFromName("String_Node_Str"));
        }
 else         if (mapping.type == GameRegistry.Type.ITEM) {
          mapping.remap(Item.getItemFromBlock(Block.getBlockFromName("String_Node_Str")));
        }
      }
 else {
        mapping.ignore();
      }
    }
 else     if (mapping.name.equals("String_Node_Str")) {
      mapping.remap(Block.getBlockFromName("String_Node_Str"));
    }
  }
}
Program: 156647
Project: 156647
Buggy source:
@Override public Object getServerGuiElement(int id,EntityPlayer player,World world,BlockPos pos){
  if (!world.blockExists(pos)) {
    return null;
  }
  TileEntity tile=world.getTileEntity(pos);
switch (id) {
case GuiIds.AUTO_CRAFTING_TABLE:
    if (!(tile instanceof TileAutoWorkbench)) {
      return null;
    }
 else {
      return new ContainerAutoWorkbench(player.inventory,(TileAutoWorkbench)tile);
    }
case GuiIds.REFINERY:
  if (!(tile instanceof TileRefinery)) {
    return null;
  }
 else {
    return new ContainerRefinery(player.inventory,(TileRefinery)tile);
  }
case GuiIds.HOPPER:
if (!(tile instanceof TileHopper)) {
  return null;
}
 else {
  return new ContainerHopper(player.inventory,(TileHopper)tile);
}
default :
return null;
}
}

Fixed version (ground truth):
@Override public Object getServerGuiElement(int id,EntityPlayer player,World world,int x,int y,int z){
  BlockPos pos=new BlockPos(x,y,z);
  if (world.isAirBlock(pos)) {
    return null;
  }
  TileEntity tile=world.getTileEntity(pos);
switch (id) {
case GuiIds.AUTO_CRAFTING_TABLE:
    if (!(tile instanceof TileAutoWorkbench)) {
      return null;
    }
 else {
      return new ContainerAutoWorkbench(player.inventory,(TileAutoWorkbench)tile);
    }
case GuiIds.REFINERY:
  if (!(tile instanceof TileRefinery)) {
    return null;
  }
 else {
    return new ContainerRefinery(player.inventory,(TileRefinery)tile);
  }
case GuiIds.HOPPER:
if (!(tile instanceof TileChute)) {
  return null;
}
 else {
  return new ContainerChute(player.inventory,(TileChute)tile);
}
default :
return null;
}
}