nus-yam/ex-repair huggingface dataset:
Program: 156487
Project: 156487
Buggy source:
@Override public List<ItemStack> getDrops(IBlockAccess world,BlockPos pos,IBlockState state,int fortune){
  ArrayList<ItemStack> list=new ArrayList<ItemStack>();
  Pipe<?> pipe=getPipe(world,pos);
  if (pipe == null) {
    pipe=pipeRemoved.get(new BlockPos(pos));
  }
  if (pipe != null) {
    if (pipe.item != null) {
      list.add(new ItemStack(pipe.item,1,pipe.container.getItemMetadata()));
      list.addAll(pipe.computeItemDrop());
      list.addAll(pipe.getDroppedItems());
    }
  }
  return list;
}

Fixed version (ground truth):
@Override public List<ItemStack> getDrops(IBlockAccess world,BlockPos pos,IBlockState state,int fortune){
  ArrayList<ItemStack> list=new ArrayList<>();
  Pipe<?> pipe=getPipe(world,pos);
  if (pipe == null) {
    pipe=pipeRemoved.get(new BlockPos(pos));
  }
  if (pipe != null) {
    if (pipe.item != null) {
      list.add(new ItemStack(pipe.item,1,pipe.container.getItemMetadata()));
      list.addAll(pipe.computeItemDrop());
      list.addAll(pipe.getDroppedItems());
    }
  }
  return list;
}
Program: 156488
Project: 156488
Buggy source:
@Override public boolean onItemUse(ItemStack itemstack,EntityPlayer entityplayer,World world,BlockPos pos,EnumFacing side,float par8,float par9,float par10){
  Block block=BuildCraftTransport.genericPipeBlock;
  Block worldBlock=world.getBlockState(pos).getBlock();
  if (worldBlock == Blocks.snow) {
    side=EnumFacing.UP;
  }
 else   if (worldBlock != Blocks.vine && worldBlock != Blocks.tallgrass && worldBlock != Blocks.deadbush && (worldBlock == null || !worldBlock.isReplaceable(world,pos))) {
    pos=pos.offset(side);
  }
  if (itemstack.stackSize == 0) {
    return false;
  }
  if (world.canBlockBePlaced(block,pos,false,side,entityplayer,itemstack)) {
    Pipe<?> pipe=BlockGenericPipe.createPipe(this);
    if (pipe == null) {
      BCLog.logger.log(Level.WARN,"String_Node_Str",pos);
      return true;
    }
    if (BlockGenericPipe.placePipe(pipe,world,pos,block.getDefaultState(),entityplayer,side)) {
      block.onBlockPlacedBy(world,pos,block.getDefaultState(),entityplayer,itemstack);
      if (!world.isRemote) {
        TileEntity tile=world.getTileEntity(pos);
        ((TileGenericPipe)tile).initializeFromItemMetadata(itemstack.getItemDamage());
      }
      world.playSoundEffect(pos.getX() + 0.5F,pos.getY() + 0.5F,pos.getZ() + 0.5F,block.stepSound.getPlaceSound(),(block.stepSound.getVolume() + 1.0F) / 2.0F,block.stepSound.getFrequency() * 0.8F);
      itemstack.stackSize--;
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean onItemUse(ItemStack stack,EntityPlayer player,World world,BlockPos pos,EnumFacing side,float par8,float par9,float par10){
  Block block=BuildCraftTransport.genericPipeBlock;
  Block worldBlock=world.getBlockState(pos).getBlock();
  if (!worldBlock.isReplaceable(world,pos)) {
    pos=pos.offset(side);
  }
  if (stack.stackSize == 0) {
    return false;
  }
 else   if (!player.canPlayerEdit(pos,side,stack)) {
    return false;
  }
 else   if (world.canBlockBePlaced(block,pos,false,side,null,stack)) {
    Pipe<?> pipe=BlockGenericPipe.createPipe(this);
    if (pipe == null) {
      BCLog.logger.log(Level.WARN,"String_Node_Str",pos);
      return true;
    }
    if (BlockGenericPipe.placePipe(pipe,world,pos,block.getDefaultState(),player,side)) {
      block.onBlockPlacedBy(world,pos,block.getDefaultState(),player,stack);
      if (!world.isRemote) {
        TileEntity tile=world.getTileEntity(pos);
        ((TileGenericPipe)tile).initializeFromItemMetadata(stack.getItemDamage());
      }
      world.playSoundEffect(pos.getX() + 0.5F,pos.getY() + 0.5F,pos.getZ() + 0.5F,block.stepSound.getPlaceSound(),(block.stepSound.getVolume() + 1.0F) / 2.0F,block.stepSound.getFrequency() * 0.8F);
      stack.stackSize--;
      return true;
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}
Program: 156493
Project: 156493
Buggy source:
@Override public int hashCode(){
  return new HashCodeBuilder().append(stack).append(pos).append(display).build();
}

Fixed version (ground truth):
@Override public int hashCode(){
  return new HashCodeBuilder().append(stack).append(pos).append(display).toHashCode();
}
Program: 156494
Project: 156494
Buggy source:
@Override public boolean equals(Object o){
  if (o == null || !(o instanceof StackAtPosition)) {
    return false;
  }
  StackAtPosition other=(StackAtPosition)o;
  return other.stack.equals(stack) && other.pos.equals(pos) && other.display == display;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o == null)   return false;
  if (o.getClass() != getClass())   return false;
  StackAtPosition other=(StackAtPosition)o;
  return new EqualsBuilder().append(stack,other.stack).append(pos,other.pos).append(display,other.display).isEquals();
}
Program: 156495
Project: 156495
Buggy source:
public static BakedQuad transform(BakedQuad quad,Matrix4f matrix4f){
  int[] data=quad.getVertexData();
  if (data.length != 28)   throw new IllegalArgumentException("String_Node_Str" + data.length + "String_Node_Str");
  data=Arrays.copyOf(data,28);
  boolean colour=quad instanceof IColoredBakedQuad;
  for (int i=0; i < 4; i++) {
    Point3f vec=new Point3f();
    vec.x=Float.intBitsToFloat(data[i * 7 + X]);
    vec.y=Float.intBitsToFloat(data[i * 7 + Y]);
    vec.z=Float.intBitsToFloat(data[i * 7 + Z]);
    matrix4f.transform(vec);
    data[i * 7 + X]=Float.floatToRawIntBits(vec.x);
    data[i * 7 + Y]=Float.floatToRawIntBits(vec.y);
    data[i * 7 + Z]=Float.floatToRawIntBits(vec.z);
  }
  return colour ? new ColoredBakedQuad(data,quad.getTintIndex(),quad.getFace()) : new BakedQuad(data,quad.getTintIndex(),quad.getFace());
}

Fixed version (ground truth):
public static BakedQuad transform(BakedQuad quad,Matrix4f matrix4f){
  int[] data=quad.getVertexData();
  data=Arrays.copyOf(data,data.length);
  boolean colour=quad instanceof IColoredBakedQuad;
  int step=data.length / 4;
  for (int i=0; i < 4; i++) {
    Point3f vec=new Point3f();
    vec.x=Float.intBitsToFloat(data[i * step + X]);
    vec.y=Float.intBitsToFloat(data[i * step + Y]);
    vec.z=Float.intBitsToFloat(data[i * step + Z]);
    matrix4f.transform(vec);
    data[i * step + X]=Float.floatToRawIntBits(vec.x);
    data[i * step + Y]=Float.floatToRawIntBits(vec.y);
    data[i * step + Z]=Float.floatToRawIntBits(vec.z);
  }
  return colour ? new ColoredBakedQuad(data,quad.getTintIndex(),quad.getFace()) : new BakedQuad(data,quad.getTintIndex(),quad.getFace());
}
Program: 156496
Project: 156496
Buggy source:
public static BakedQuad replaceShade(BakedQuad quad,int shade){
  int[] data=quad.getVertexData();
  if (data.length != 28)   throw new IllegalArgumentException("String_Node_Str" + data.length + "String_Node_Str");
  data=Arrays.copyOf(data,28);
  boolean colour=quad instanceof IColoredBakedQuad;
  for (int i=0; i < 4; i++) {
    data[i * ARRAY_SIZE + SHADE]=shade;
  }
  return colour ? new ColoredBakedQuad(data,quad.getTintIndex(),quad.getFace()) : new BakedQuad(data,quad.getTintIndex(),quad.getFace());
}

Fixed version (ground truth):
public static BakedQuad replaceShade(BakedQuad quad,int shade){
  int[] data=quad.getVertexData();
  int step=data.length / 4;
  data=Arrays.copyOf(data,data.length);
  boolean colour=quad instanceof IColoredBakedQuad;
  for (int i=0; i < 4; i++) {
    data[i * step + SHADE]=shade;
  }
  return colour ? new ColoredBakedQuad(data,quad.getTintIndex(),quad.getFace()) : new BakedQuad(data,quad.getTintIndex(),quad.getFace());
}
Program: 156497
Project: 156497
Buggy source:
public static Vector3f normal(BakedQuad quad){
  int[] data=quad.getVertexData();
  if (data.length != 28)   throw new IllegalArgumentException("String_Node_Str" + data.length + "String_Node_Str");
  data=Arrays.copyOf(data,28);
  Point3f[] positions=new Point3f[3];
  for (int i=0; i < 3; i++) {
    Point3f vec=new Point3f();
    vec.x=Float.intBitsToFloat(data[i * 7 + X]);
    vec.y=Float.intBitsToFloat(data[i * 7 + Y]);
    vec.z=Float.intBitsToFloat(data[i * 7 + Z]);
    positions[i]=vec;
  }
  Vector3f a=new Vector3f(positions[1]);
  a.sub(positions[0]);
  Vector3f b=new Vector3f(positions[2]);
  b.sub(positions[0]);
  Vector3f c=new Vector3f();
  c.cross(a,b);
  return c;
}

Fixed version (ground truth):
public static Vector3f normal(BakedQuad quad){
  int[] data=quad.getVertexData();
  int step=data.length / 4;
  data=Arrays.copyOf(data,data.length);
  Point3f[] positions=new Point3f[3];
  for (int i=0; i < 3; i++) {
    Point3f vec=new Point3f();
    vec.x=Float.intBitsToFloat(data[i * step + X]);
    vec.y=Float.intBitsToFloat(data[i * step + Y]);
    vec.z=Float.intBitsToFloat(data[i * step + Z]);
    positions[i]=vec;
  }
  Vector3f a=new Vector3f(positions[1]);
  a.sub(positions[0]);
  Vector3f b=new Vector3f(positions[2]);
  b.sub(positions[0]);
  Vector3f c=new Vector3f();
  c.cross(a,b);
  return c;
}
Program: 156498
Project: 156498
Buggy source:
public void deployBlueprint(World world,BlockPos pos,EnumFacing dir,Blueprint bpt){
  bpt.id=new LibraryId();
  bpt.id.extension="String_Node_Str";
  BptContext context=bpt.getContext(world,bpt.getBoxForPos(pos));
  if (bpt.rotate) {
    if (dir == EnumFacing.EAST) {
    }
 else     if (dir == EnumFacing.SOUTH) {
      bpt.rotateLeft(context);
    }
 else     if (dir == EnumFacing.WEST) {
      bpt.rotateLeft(context);
      bpt.rotateLeft(context);
    }
 else     if (dir == EnumFacing.NORTH) {
      bpt.rotateLeft(context);
      bpt.rotateLeft(context);
      bpt.rotateLeft(context);
    }
  }
  Vec3 transform=Utils.convert(pos).subtract(bpt.anchorX,bpt.anchorY,bpt.anchorZ);
  bpt.translateToWorld(transform);
  new BptBuilderBlueprint(bpt,world,pos).deploy();
}

Fixed version (ground truth):
public void deployBlueprint(World world,BlockPos pos,EnumFacing dir,Blueprint bpt){
  bpt.id=new LibraryId();
  bpt.id.extension="String_Node_Str";
  BptContext context=bpt.getContext(world,bpt.getBoxForPos(pos));
  if (bpt.rotate) {
    if (dir == EnumFacing.EAST) {
    }
 else     if (dir == EnumFacing.SOUTH) {
      bpt.rotateLeft(context);
    }
 else     if (dir == EnumFacing.WEST) {
      bpt.rotateLeft(context);
      bpt.rotateLeft(context);
    }
 else     if (dir == EnumFacing.NORTH) {
      bpt.rotateLeft(context);
      bpt.rotateLeft(context);
      bpt.rotateLeft(context);
    }
  }
  Vec3 transform=Utils.convert(pos).subtract(Utils.convert(bpt.anchor));
  bpt.translateToWorld(transform);
  new BptBuilderBlueprint(bpt,world,pos).deploy();
}
Program: 156499
Project: 156499
Buggy source:
public BptBuilderBase(BlueprintBase bluePrint,World world,BlockPos pos){
  this.blueprint=bluePrint;
  this.pos=pos;
  this.usedLocations=new BitSet(bluePrint.sizeX * bluePrint.sizeY * bluePrint.sizeZ);
  done=false;
  Box box=new Box();
  box.initialize(this);
  context=bluePrint.getContext(world,box);
}

Fixed version (ground truth):
public BptBuilderBase(BlueprintBase bluePrint,World world,BlockPos pos){
  this.blueprint=bluePrint;
  this.pos=pos;
  this.usedLocations=new BitSet(bluePrint.size.getX() * bluePrint.size.getY() * bluePrint.size.getZ());
  done=false;
  Box box=new Box();
  box.initialize(this);
  context=bluePrint.getContext(world,box);
}
Program: 156500
Project: 156500
Buggy source:
@Override public void loadContents(NBTTagCompound nbt) throws BptError {
  byte[] data=nbt.getByteArray("String_Node_Str");
  int ind=0;
  for (int x=0; x < sizeX; ++x) {
    for (int y=0; y < sizeY; ++y) {
      for (int z=0; z < sizeZ; ++z) {
        if (data[ind] == 1) {
          set(new BlockPos(x,y,z),new SchematicMask(true));
        }
        ind++;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void loadContents(NBTTagCompound nbt) throws BptError {
  byte[] data=nbt.getByteArray("String_Node_Str");
  int ind=0;
  for (int x=0; x < size.getX(); ++x) {
    for (int y=0; y < size.getY(); ++y) {
      for (int z=0; z < size.getZ(); ++z) {
        if (data[ind] == 1) {
          set(new BlockPos(x,y,z),new SchematicMask(true));
        }
        ind++;
      }
    }
  }
}
Program: 156501
Project: 156501
Buggy source:
@Override public void readFromWorld(IBuilderContext context,TileEntity anchorTile,BlockPos pos){
  Vec3 nPos=Utils.convert(pos).subtract(context.surroundingBox().min());
  int posX=(int)nPos.xCoord;
  int posY=(int)nPos.yCoord;
  int posZ=(int)nPos.zCoord;
  if (!BuildCraftAPI.isSoftBlock(anchorTile.getWorld(),pos)) {
    set(new BlockPos(posX,posY,posZ),new SchematicMask(true));
  }
}

Fixed version (ground truth):
@Override public void readFromWorld(IBuilderContext context,TileEntity anchorTile,BlockPos pos){
  Vec3 nPos=Utils.convert(pos).subtract(Utils.convert(context.surroundingBox().min()));
  if (!BuildCraftAPI.isSoftBlock(anchorTile.getWorld(),pos)) {
    set(Utils.convertFloor(nPos),new SchematicMask(true));
  }
}
Program: 156502
Project: 156502
Buggy source:
public Template(int sizeX,int sizeY,int sizeZ){
  super(sizeX,sizeY,sizeZ);
  id.extension="String_Node_Str";
}

Fixed version (ground truth):
public Template(BlockPos size){
  super(size);
  id.extension="String_Node_Str";
}
Program: 156503
Project: 156503
Buggy source:
@Override public void saveContents(NBTTagCompound nbt){
  byte[] data=new byte[sizeX * sizeY * sizeZ];
  int ind=0;
  for (int x=0; x < sizeX; ++x) {
    for (int y=0; y < sizeY; ++y) {
      for (int z=0; z < sizeZ; ++z) {
        data[ind]=(byte)((get(new BlockPos(x,y,z)) == null) ? 0 : 1);
        ind++;
      }
    }
  }
  nbt.setByteArray("String_Node_Str",data);
}

Fixed version (ground truth):
@Override public void saveContents(NBTTagCompound nbt){
  byte[] data=new byte[size.getX() * size.getY() * size.getZ()];
  int ind=0;
  for (int x=0; x < size.getX(); ++x) {
    for (int y=0; y < size.getY(); ++y) {
      for (int z=0; z < size.getZ(); ++z) {
        data[ind]=(byte)((get(new BlockPos(x,y,z)) == null) ? 0 : 1);
        ind++;
      }
    }
  }
  nbt.setByteArray("String_Node_Str",data);
}
Program: 156504
Project: 156504
Buggy source:
@Override public BlockPos next(){
  BlockPos index=new BlockPos(pos);
  it++;
  blocksDone++;
  if (pos.getX() < box.xMax) {
    pos=pos.east();
  }
 else {
    pos=new BlockPos(box.xMin,pos.getY(),pos.getZ());
    if (pos.getY() < box.yMax) {
      pos=pos.up();
    }
 else {
      pos=new BlockPos(pos.getX(),box.yMin,pos.getZ() + 1);
    }
  }
  return index;
}

Fixed version (ground truth):
@Override public BlockPos next(){
  BlockPos index=new BlockPos(pos);
  it++;
  blocksDone++;
  if (pos.getX() < box.max().getX()) {
    pos=pos.east();
  }
 else {
    pos=new BlockPos(box.min().getX(),pos.getY(),pos.getZ());
    if (pos.getY() < box.max().getY()) {
      pos=pos.up();
    }
 else {
      pos=new BlockPos(pos.getX(),box.min().getY(),pos.getZ() + 1);
    }
  }
  return index;
}
Program: 156505
Project: 156505
Buggy source:
@Override public boolean hasNext(){
  return pos.getZ() <= box.zMax && it <= iterationsPerCycle;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return pos.getZ() <= box.max().getZ() && it <= iterationsPerCycle;
}
Program: 156506
Project: 156506
Buggy source:
public int totalBlocks(){
  return box.sizeX() * box.sizeY() * box.sizeZ();
}

Fixed version (ground truth):
public int totalBlocks(){
  return box.size().getX() * box.size().getY() * box.size().getZ();
}
Program: 156507
Project: 156507
Buggy source:
public FakeWorld(Template template,IBlockState filledBlock){
  this(EnumDecoratedBlock.BLUEPRINT);
  BlockPos start=new BlockPos(-template.sizeX / 2,1,-template.sizeZ / 2);
  BlockPos end=start.add(template.sizeX - 1,template.sizeY - 1,template.sizeZ - 1);
  IBlockState state=BuildCraftCore.decoratedBlock.getDefaultState();
  state=state.withProperty(BuildCraftProperties.DECORATED_BLOCK,EnumDecoratedBlock.TEMPLATE);
  IBlockState roofState=Blocks.dirt.getDefaultState();
  for (  BlockPos pos : Utils.allInBoxIncludingCorners(start,end)) {
    BlockPos array=pos.subtract(start);
    SchematicBlockBase block=template.get(array);
    if (block != null) {
      setBlockState(pos,filledBlock);
    }
    if (pos.getY() == 1) {
      setBlockState(pos.down(),state);
      setBlockState(pos.up(254),roofState);
    }
  }
}

Fixed version (ground truth):
public FakeWorld(Template template,IBlockState filledBlock){
  this(EnumDecoratedBlock.BLUEPRINT);
  BlockPos start=template.getBoxForPos(BlockPos.ORIGIN).center();
  BlockPos end=start.add(template.size).subtract(Utils.POS_ONE);
  IBlockState state=BuildCraftCore.decoratedBlock.getDefaultState();
  state=state.withProperty(BuildCraftProperties.DECORATED_BLOCK,EnumDecoratedBlock.TEMPLATE);
  IBlockState roofState=Blocks.dirt.getDefaultState();
  for (  BlockPos pos : Utils.allInBoxIncludingCorners(start,end)) {
    BlockPos array=pos.subtract(start);
    SchematicBlockBase block=template.get(array);
    if (block != null) {
      setBlockState(pos,filledBlock);
    }
    if (pos.getY() == 1) {
      setBlockState(pos.down(),state);
      setBlockState(pos.up(254),roofState);
    }
  }
}
Program: 156508
Project: 156508
Buggy source:
boolean contains(Vec3 point);

Fixed version (ground truth):
/** 
 * Returns true if the point is enclosed by this zone, such that none of the coordinates lie outside the range specified by this zone. 
 */
boolean contains(Vec3 point);
Program: 156509
Project: 156509
Buggy source:
BlockPos getRandomBlockPos(Random rand);

Fixed version (ground truth):
/** 
 * Gets a random position that   {@link #contains(Vec3)} will return true. 
 */
BlockPos getRandomBlockPos(Random rand);
Program: 156510
Project: 156510
Buggy source:
double distanceToSquared(BlockPos index);

Fixed version (ground truth):
/** 
 * Returns   {@link #distanceTo(BlockPos)} but squared. Usually this will be quicker to calculate. 
 */
double distanceToSquared(BlockPos index);
Program: 156511
Project: 156511
Buggy source:
double distanceTo(BlockPos index);

Fixed version (ground truth):
/** 
 * Returns the smallest possible distance that the index would have to be changed by in order for  {@link #contains(Vec3)} to return true. If the position is already inside then this will return 0 
 */
double distanceTo(BlockPos index);
Program: 156512
Project: 156512
Buggy source:
@Override protected void writeEntityToNBT(NBTTagCompound nbttagcompound){
  nbttagcompound.setDouble("String_Node_Str",xRoot);
  nbttagcompound.setDouble("String_Node_Str",yRoot);
  nbttagcompound.setDouble("String_Node_Str",zRoot);
  nbttagcompound.setDouble("String_Node_Str",armSizeX);
  nbttagcompound.setDouble("String_Node_Str",armSizeZ);
}

Fixed version (ground truth):
@Override protected void writeEntityToNBT(NBTTagCompound nbttagcompound){
  nbttagcompound.setDouble("String_Node_Str",root.xCoord);
  nbttagcompound.setDouble("String_Node_Str",root.yCoord);
  nbttagcompound.setDouble("String_Node_Str",root.zCoord);
  nbttagcompound.setDouble("String_Node_Str",armSizeX);
  nbttagcompound.setDouble("String_Node_Str",armSizeZ);
}
Program: 156513
Project: 156513
Buggy source:
public void updatePosition(){
  double[] headT=getHead();
  this.xArm.setPosition(xRoot,yRoot,headT[2] + 0.25);
  this.yArm.ySize=yRoot - headT[1] - 1;
  this.yArm.setPosition(headT[0] + 0.25,headT[1] + 1,headT[2] + 0.25);
  this.zArm.setPosition(headT[0] + 0.25,yRoot,zRoot);
  this.head.setPosition(headT[0] + 0.4,headT[1] - 0.01,headT[2] + 0.4);
}

Fixed version (ground truth):
public void updatePosition(){
  double[] headT=getHead();
  this.xArm.setPosition(root.xCoord,root.yCoord,headT[2] + 0.25);
  this.yArm.ySize=root.yCoord - headT[1] - 1;
  this.yArm.setPosition(headT[0] + 0.25,headT[1] + 1,headT[2] + 0.25);
  this.zArm.setPosition(headT[0] + 0.25,root.yCoord,root.zCoord);
  this.headEntity.setPosition(headT[0] + 0.4,headT[1] - 0.01,headT[2] + 0.4);
}
Program: 156514
Project: 156514
Buggy source:
@Override protected void readEntityFromNBT(NBTTagCompound nbttagcompound){
  xRoot=nbttagcompound.getDouble("String_Node_Str");
  yRoot=nbttagcompound.getDouble("String_Node_Str");
  zRoot=nbttagcompound.getDouble("String_Node_Str");
  armSizeX=nbttagcompound.getDouble("String_Node_Str");
  armSizeZ=nbttagcompound.getDouble("String_Node_Str");
  setArmSize(armSizeX,armSizeZ);
  updatePosition();
}

Fixed version (ground truth):
@Override protected void readEntityFromNBT(NBTTagCompound nbttagcompound){
  double xRoot=nbttagcompound.getDouble("String_Node_Str");
  double yRoot=nbttagcompound.getDouble("String_Node_Str");
  double zRoot=nbttagcompound.getDouble("String_Node_Str");
  root=new Vec3(xRoot,yRoot,zRoot);
  armSizeX=nbttagcompound.getDouble("String_Node_Str");
  armSizeZ=nbttagcompound.getDouble("String_Node_Str");
  setArmSize(armSizeX,armSizeZ);
  updatePosition();
}
Program: 156515
Project: 156515
Buggy source:
private double[] getHead(){
  return new double[]{this.headX / 32D,this.headY / 32D,this.headZ / 32D};
}

Fixed version (ground truth):
private double[] getHead(){
  return new double[]{head.xCoord,head.yCoord,head.zCoord};
}
Program: 156516
Project: 156516
Buggy source:
public void setHead(double x,double y,double z){
  this.headX=(int)(x * 32D);
  this.headY=(int)(y * 32D);
  this.headZ=(int)(z * 32D);
}

Fixed version (ground truth):
public void setHead(Vec3 vec){
  this.head=vec;
}
Program: 156517
Project: 156517
Buggy source:
private void makeParts(World world){
  xArm=BuilderProxy.proxy.newDrill(world,0,0,0,1,0.5,0.5);
  yArm=BuilderProxy.proxy.newDrill(world,0,0,0,0.5,1,0.5);
  zArm=BuilderProxy.proxy.newDrill(world,0,0,0,0.5,0.5,1);
  head=BuilderProxy.proxy.newDrillHead(world,0,0,0,0.2,1,0.2);
  head.shadowSize=1.0F;
  world.spawnEntityInWorld(xArm);
  world.spawnEntityInWorld(yArm);
  world.spawnEntityInWorld(zArm);
  world.spawnEntityInWorld(head);
}

Fixed version (ground truth):
private void makeParts(World world){
  xArm=BuilderProxy.proxy.newDrill(world,0,0,0,1,0.5,0.5);
  yArm=BuilderProxy.proxy.newDrill(world,0,0,0,0.5,1,0.5);
  zArm=BuilderProxy.proxy.newDrill(world,0,0,0,0.5,0.5,1);
  headEntity=BuilderProxy.proxy.newDrillHead(world,0,0,0,0.2,1,0.2);
  headEntity.shadowSize=1.0F;
  world.spawnEntityInWorld(xArm);
  world.spawnEntityInWorld(yArm);
  world.spawnEntityInWorld(zArm);
  world.spawnEntityInWorld(headEntity);
}
Program: 156518
Project: 156518
Buggy source:
public EntityMechanicalArm(World world,double x,double y,double z,double width,double height,TileQuarry parent){
  this(world);
  setPositionAndRotation(parent.getPos().getX(),parent.getPos().getY(),parent.getPos().getZ(),0,0);
  this.xRoot=x;
  this.yRoot=y;
  this.zRoot=z;
  this.motionX=0.0;
  this.motionY=0.0;
  this.motionZ=0.0;
  setArmSize(width,height);
  setHead(x,y - 2,z);
  this.parent=parent;
  parent.setArm(this);
  updatePosition();
}

Fixed version (ground truth):
public EntityMechanicalArm(World world,Vec3 root,double width,double height,TileQuarry parent){
  this(world);
  setPositionAndRotation(parent.getPos().getX(),parent.getPos().getY(),parent.getPos().getZ(),0,0);
  this.root=root;
  this.motionX=0.0;
  this.motionY=0.0;
  this.motionZ=0.0;
  setArmSize(width,height);
  setHead(root.addVector(0,-2,0));
  this.parent=parent;
  parent.setArm(this);
  updatePosition();
}
Program: 156519
Project: 156519
Buggy source:
@Override public void setDead(){
  if (worldObj != null && worldObj.isRemote) {
    xArm.setDead();
    yArm.setDead();
    zArm.setDead();
    head.setDead();
  }
  super.setDead();
}

Fixed version (ground truth):
@Override public void setDead(){
  if (worldObj != null && worldObj.isRemote) {
    xArm.setDead();
    yArm.setDead();
    zArm.setDead();
    headEntity.setDead();
  }
  super.setDead();
}
Program: 156520
Project: 156520
Buggy source:
private void initTemplate(){
  if (currentPattern != null && box.isInitialized() && box.sizeX() > 0 && box.sizeY() > 0 && box.sizeZ() > 0) {
    currentTemplate=currentPattern.getTemplateBuilder(box,getWorld(),patternParameters);
    currentTemplate.blueprint.excavate=excavate;
  }
}

Fixed version (ground truth):
private void initTemplate(){
  if (currentPattern != null && box.size().distanceSq(BlockPos.ORIGIN) > 0) {
    currentTemplate=currentPattern.getTemplateBuilder(box,getWorld(),patternParameters);
    currentTemplate.blueprint.excavate=excavate;
  }
}
Program: 156521
Project: 156521
Buggy source:
@Override public void initializeFromObjectAt(IBuilderContext context,int x,int y,int z){
  super.initializeFromObjectAt(context,x,y,z);
  if (block.hasTileEntity(meta)) {
    TileEntity tile=context.world().getTileEntity(x,y,z);
    if (tile != null) {
      tile.writeToNBT(tileNBT);
    }
    tileNBT=(NBTTagCompound)tileNBT.copy();
  }
}

Fixed version (ground truth):
@Override public void initializeFromObjectAt(IBuilderContext context,int x,int y,int z){
  super.initializeFromObjectAt(context,x,y,z);
  if (block.hasTileEntity(meta)) {
    TileEntity tile=context.world().getTileEntity(x,y,z);
    if (tile != null) {
      tile.writeToNBT(tileNBT);
    }
    tileNBT=(NBTTagCompound)tileNBT.copy();
    onNBTLoaded();
  }
}
Program: 156522
Project: 156522
Buggy source:
@Override public void readSchematicFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  super.readSchematicFromNBT(nbt,registry);
  tileNBT=nbt.getCompoundTag("String_Node_Str");
}

Fixed version (ground truth):
@Override public void readSchematicFromNBT(NBTTagCompound nbt,MappingRegistry registry){
  super.readSchematicFromNBT(nbt,registry);
  tileNBT=nbt.getCompoundTag("String_Node_Str");
  onNBTLoaded();
}
Program: 156530
Project: 156530
Buggy source:
public void update(Chunk chunk){
  for (int bz=0; bz < 16; bz++) {
    for (int bx=0; bx < 16; bx++) {
      int y=chunk.getHeightValue(bx,bz);
      int color;
      if (y < 0) {
        y=255;
      }
      while ((color=chunk.getBlock(bx,y,bz).getMapColor(0).colorIndex) == MapColor.airColor.colorIndex) {
        y--;
        if (y < 0) {
          break;
        }
      }
      data[(bz << 4) | bx]=(byte)color;
    }
  }
}

Fixed version (ground truth):
public void update(Chunk chunk){
  for (int bz=0; bz < 16; bz++) {
    for (int bx=0; bx < 16; bx++) {
      int y=chunk.getHeightValue(bx,bz);
      int color=MapColor.airColor.colorIndex;
      if (y < 0) {
        y=255;
      }
      Block b;
      while (y >= 0) {
        b=chunk.getBlock(bx,y,bz);
        color=b.getMapColor(0) != null ? b.getMapColor(0).colorIndex : MapColor.airColor.colorIndex;
        if (color != MapColor.airColor.colorIndex) {
          break;
        }
        y--;
      }
      data[(bz << 4) | bx]=(byte)color;
    }
  }
}
Program: 156533
Project: 156533
Buggy source:
@Override public boolean isHandler(ItemStack stack,HandlerType type){
  if (isBlueprint) {
    return stack.getItem() instanceof ItemBlueprintStandard && ItemBlueprint.isContentReadable(stack);
  }
 else {
    return stack.getItem() instanceof ItemBlueprintTemplate && ItemBlueprint.isContentReadable(stack);
  }
}

Fixed version (ground truth):
@Override public boolean isHandler(ItemStack stack,HandlerType type){
  if (isBlueprint) {
    return stack.getItem() instanceof ItemBlueprintStandard && (type == HandlerType.LOAD || ItemBlueprint.isContentReadable(stack));
  }
 else {
    return stack.getItem() instanceof ItemBlueprintTemplate && (type == HandlerType.LOAD || ItemBlueprint.isContentReadable(stack));
  }
}
Program: 156535
Project: 156535
Buggy source:
@Override public void rotateLeft(IBuilderContext context){
  final int xPos=2;
  final int xNeg=1;
  final int zPos=4;
  final int zNeg=3;
switch (meta) {
case xPos:
    meta=zPos;
  break;
case zNeg:
meta=xPos;
break;
case xNeg:
meta=zNeg;
break;
case zPos:
meta=xNeg;
break;
}
}

Fixed version (ground truth):
@Override public void rotateLeft(IBuilderContext context){
  final int xPos=2;
  final int xNeg=1;
  final int zPos=4;
  final int zNeg=3;
switch (meta & 7) {
case xPos:
    meta=(meta & 8) | zPos;
  break;
case zNeg:
meta=(meta & 8) | xPos;
break;
case xNeg:
meta=(meta & 8) | zNeg;
break;
case zPos:
meta=(meta & 8) | xNeg;
break;
}
}
Program: 156536
Project: 156536
Buggy source:
@Override public Set<BlockIndex> getPrerequisiteBlocks(IBuilderContext context){
  final int yPos=0;
  final int yNeg=5;
  final int xPos=2;
  final int xNeg=1;
  final int zPos=4;
  final int zNeg=3;
switch (meta & 7) {
case xPos:
    return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.EAST.ordinal()]);
case xNeg:
  return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.WEST.ordinal()]);
case yPos:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.UP.ordinal()]);
case yNeg:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.DOWN.ordinal()]);
case zPos:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.SOUTH.ordinal()]);
case zNeg:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.NORTH.ordinal()]);
}
return null;
}

Fixed version (ground truth):
@Override public Set<BlockIndex> getPrerequisiteBlocks(IBuilderContext context){
  final int yPos=0;
  final int yNeg=5;
  final int xPos=2;
  final int xNeg=1;
  final int zPos=4;
  final int zNeg=3;
switch (meta & 7) {
case xPos:
    return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.EAST.ordinal()]);
case xNeg:
  return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.WEST.ordinal()]);
case yPos:
case 7:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.UP.ordinal()]);
case yNeg:
case 6:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.DOWN.ordinal()]);
case zPos:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.SOUTH.ordinal()]);
case zNeg:
return Sets.newHashSet(RELATIVE_INDEXES[ForgeDirection.NORTH.ordinal()]);
}
return null;
}
Program: 156537
Project: 156537
Buggy source:
@Override public int receiveEnergy(ForgeDirection from,int maxReceive,boolean simulate){
  int maxR=Math.min(MAX_POWER,maxReceive);
  if (container.getPipe() instanceof IEnergyHandler) {
    int energyCanReceive=((IEnergyHandler)container.getPipe()).receiveEnergy(from,maxR,true);
    if (!simulate) {
      return ((IEnergyHandler)container.getPipe()).receiveEnergy(from,energyCanReceive,false);
    }
 else {
      return energyCanReceive;
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int receiveEnergy(ForgeDirection from,int maxReceive,boolean simulate){
  int maxR=Math.min(MAX_POWER,maxReceive);
  if (container != null && container.getPipe() instanceof IEnergyHandler) {
    int energyCanReceive=((IEnergyHandler)container.getPipe()).receiveEnergy(from,maxR,true);
    if (!simulate) {
      return ((IEnergyHandler)container.getPipe()).receiveEnergy(from,energyCanReceive,false);
    }
 else {
      return energyCanReceive;
    }
  }
  return 0;
}
Program: 156538
Project: 156538
Buggy source:
@Override public void start(){
  if (robot.getDockingStation() != null && filter.matches(robot.getDockingStation())) {
    targetStation=robot.getDockingStation();
    terminate();
    return;
  }
  double potentialStationDistance=Float.MAX_VALUE;
  DockingStation potentialStation=null;
  for (  DockingStation station : robot.getRegistry().getStations()) {
    if (station.isTaken() && station.robotIdTaking() != robot.getRobotId()) {
      continue;
    }
    if (zone != null && !zone.contains(station.x(),station.y(),station.z())) {
      continue;
    }
    if (filter.matches(station)) {
      if (ActionStationForbidRobot.isForbidden(station,robot)) {
        continue;
      }
      double dx=robot.posX - station.x();
      double dy=robot.posY - station.y();
      double dz=robot.posZ - station.z();
      double distance=dx * dx + dy * dy + dz * dz;
      if (potentialStation == null || distance < potentialStationDistance) {
        potentialStation=station;
        potentialStationDistance=distance;
      }
    }
  }
  if (potentialStation != null) {
    targetStation=potentialStation;
  }
  terminate();
}

Fixed version (ground truth):
@Override public void start(){
  if (robot.getDockingStation() != null && filter.matches(robot.getDockingStation())) {
    targetStation=robot.getDockingStation();
    terminate();
    return;
  }
  double potentialStationDistance=Float.MAX_VALUE;
  DockingStation potentialStation=null;
  for (  DockingStation station : robot.getRegistry().getStations()) {
    if (!station.isInitialized()) {
      continue;
    }
    if (station.isTaken() && station.robotIdTaking() != robot.getRobotId()) {
      continue;
    }
    if (zone != null && !zone.contains(station.x(),station.y(),station.z())) {
      continue;
    }
    if (filter.matches(station)) {
      if (ActionStationForbidRobot.isForbidden(station,robot)) {
        continue;
      }
      double dx=robot.posX - station.x();
      double dy=robot.posY - station.y();
      double dz=robot.posZ - station.z();
      double distance=dx * dx + dy * dy + dz * dz;
      if (potentialStation == null || distance < potentialStationDistance) {
        potentialStation=station;
        potentialStationDistance=distance;
      }
    }
  }
  if (potentialStation != null) {
    targetStation=potentialStation;
  }
  terminate();
}
Program: 156539
Project: 156539
Buggy source:
/** 
 * Get the debug information from a tile entity as a list of strings, used for the F3 debug menu
 * @param info The List debug strings should be output to. 
 */
void getDebugInfo(List<String> left,List<String> right,EnumFacing side);

Fixed version (ground truth):
/** 
 * Get the debug information from a tile entity as a list of strings, used for the F3 debug menu. The left and right parameters correspond to the sides of the F3 screen.
 * @param side The side the block was clicked on, may be null if we don't know, or is the "centre" side 
 */
void getDebugInfo(List<String> left,List<String> right,EnumFacing side);
Program: 156541
Project: 156541
Buggy source:
@Optional.Method(modid="String_Node_Str") private static void addGateRecipe(String materialName,int energyCost,GateDefinition.GateMaterial material,ItemRedstoneChipset.Chipset chipset,PipeWire... pipeWire){
  List<ItemStack> temp=new ArrayList<ItemStack>();
  temp.add(chipset.getStack());
  for (  PipeWire wire : pipeWire) {
    temp.add(wire.getStack());
  }
  Object[] inputs=temp.toArray();
  BuildcraftRecipeRegistry.assemblyTable.addRecipe("String_Node_Str" + materialName,energyCost,ItemGate.makeGateItem(material,GateDefinition.GateLogic.AND),inputs);
  BuildcraftRecipeRegistry.assemblyTable.addRecipe("String_Node_Str" + materialName,energyCost,ItemGate.makeGateItem(material,GateDefinition.GateLogic.OR),inputs);
}

Fixed version (ground truth):
@Optional.Method(modid="String_Node_Str") private static void addGateRecipe(String materialName,int energyCost,GateDefinition.GateMaterial material,EnumRedstoneChipset chipset,PipeWire... pipeWire){
  List<ItemStack> temp=new ArrayList<ItemStack>();
  temp.add(chipset.getStack());
  for (  PipeWire wire : pipeWire) {
    temp.add(wire.getStack());
  }
  Object[] inputs=temp.toArray();
  BuildcraftRecipeRegistry.assemblyTable.addRecipe("String_Node_Str" + materialName,energyCost,ItemGate.makeGateItem(material,GateDefinition.GateLogic.AND),inputs);
  BuildcraftRecipeRegistry.assemblyTable.addRecipe("String_Node_Str" + materialName,energyCost,ItemGate.makeGateItem(material,GateDefinition.GateLogic.OR),inputs);
}
Program: 156542
Project: 156542
Buggy source:
@Override public boolean isValidExpansion(ItemStack input,ItemStack expansion){
  if (StackHelper.isMatchingItem(ItemRedstoneChipset.Chipset.RED.getStack(),expansion,true,true)) {
    return true;
  }
  for (  ItemStack s : recipes.values()) {
    if (StackHelper.isMatchingItem(s,expansion,true,true)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isValidExpansion(ItemStack input,ItemStack expansion){
  if (StackHelper.isMatchingItem(EnumRedstoneChipset.RED.getStack(),expansion,true,true)) {
    return true;
  }
  for (  ItemStack s : recipes.values()) {
    if (StackHelper.isMatchingItem(s,expansion,true,true)) {
      return true;
    }
  }
  return false;
}
Program: 156543
Project: 156543
Buggy source:
@Override public ItemStack craft(ItemStack input,List<ItemStack> expansions,boolean preview){
  ItemStack output=input.copy();
  output.stackSize=1;
  int expansionsAdded=0;
  for (  ItemStack chipset : expansions) {
    if (StackHelper.isMatchingItem(ItemRedstoneChipset.Chipset.RED.getStack(),chipset,true,true)) {
      ItemGate.setLogic(output,ItemGate.getLogic(output) == GateDefinition.GateLogic.AND ? GateDefinition.GateLogic.OR : GateDefinition.GateLogic.AND);
      expansionsAdded++;
      continue;
    }
    for (    ItemStack expansion : recipes.values()) {
      if (StackHelper.isMatchingItem(chipset,expansion,true,true) && !ItemGate.hasGateExpansion(output,recipes.inverse().get(expansion))) {
        if (!preview) {
          chipset.stackSize--;
        }
        ItemGate.addGateExpansion(output,recipes.inverse().get(expansion));
        expansionsAdded++;
        break;
      }
    }
  }
  if (expansionsAdded > 0) {
    return output;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public ItemStack craft(ItemStack input,List<ItemStack> expansions,boolean preview){
  ItemStack output=input.copy();
  output.stackSize=1;
  int expansionsAdded=0;
  for (  ItemStack chipset : expansions) {
    if (StackHelper.isMatchingItem(EnumRedstoneChipset.RED.getStack(),chipset,true,true)) {
      ItemGate.setLogic(output,ItemGate.getLogic(output) == GateDefinition.GateLogic.AND ? GateDefinition.GateLogic.OR : GateDefinition.GateLogic.AND);
      expansionsAdded++;
      continue;
    }
    for (    ItemStack expansion : recipes.values()) {
      if (StackHelper.isMatchingItem(chipset,expansion,true,true) && !ItemGate.hasGateExpansion(output,recipes.inverse().get(expansion))) {
        if (!preview) {
          chipset.stackSize--;
        }
        ItemGate.addGateExpansion(output,recipes.inverse().get(expansion));
        expansionsAdded++;
        break;
      }
    }
  }
  if (expansionsAdded > 0) {
    return output;
  }
 else {
    return null;
  }
}
Program: 156544
Project: 156544
Buggy source:
boolean contains(double x,double y,double z);

Fixed version (ground truth):
boolean contains(Vec3 point);
Program: 156545
Project: 156545
Buggy source:
@Override public boolean contains(double x,double y,double z){
  int xBlock=(int)Math.floor(x);
  int zBlock=(int)Math.floor(z);
  return get(xBlock,zBlock);
}

Fixed version (ground truth):
@Override public boolean contains(Vec3 point){
  int xBlock=(int)Math.floor(point.xCoord);
  int zBlock=(int)Math.floor(point.zCoord);
  return get(xBlock,zBlock);
}
Program: 156546
Project: 156546
Buggy source:
@Override public void readEntitiesFromWorld(IBuilderContext context,TileEntity anchorTile){
  BptContext bptContext=(BptContext)context;
  Vec3 transform=new Vec3(0,0,0).subtract(context.surroundingBox().pMin());
  for (  Object o : context.world().loadedEntityList) {
    Entity e=(Entity)o;
    if (context.surroundingBox().contains(e.posX,e.posY,e.posZ)) {
      SchematicEntity s=SchematicRegistry.INSTANCE.createSchematicEntity(e.getClass());
      if (s != null) {
        s.readFromWorld(context,e);
switch (s.getBuildingPermission()) {
case ALL:
          entities.add(s);
        break;
case CREATIVE_ONLY:
      if (bptContext.readConfiguration.allowCreative) {
        if (buildingPermission == BuildingPermission.ALL) {
          buildingPermission=BuildingPermission.CREATIVE_ONLY;
        }
        entities.add(s);
      }
    break;
case NONE:
  buildingPermission=BuildingPermission.NONE;
break;
}
}
}
}
}

Fixed version (ground truth):
@Override public void readEntitiesFromWorld(IBuilderContext context,TileEntity anchorTile){
  BptContext bptContext=(BptContext)context;
  Vec3 transform=new Vec3(0,0,0).subtract(context.surroundingBox().pMin());
  for (  Object o : context.world().loadedEntityList) {
    Entity e=(Entity)o;
    if (context.surroundingBox().contains(new Vec3(e.posX,e.posY,e.posZ))) {
      SchematicEntity s=SchematicRegistry.INSTANCE.createSchematicEntity(e.getClass());
      if (s != null) {
        s.readFromWorld(context,e);
switch (s.getBuildingPermission()) {
case ALL:
          entities.add(s);
        break;
case CREATIVE_ONLY:
      if (bptContext.readConfiguration.allowCreative) {
        if (buildingPermission == BuildingPermission.ALL) {
          buildingPermission=BuildingPermission.CREATIVE_ONLY;
        }
        entities.add(s);
      }
    break;
case NONE:
  buildingPermission=BuildingPermission.NONE;
break;
}
}
}
}
}
Program: 156547
Project: 156547
Buggy source:
public void set(TextureAtlasSprite icon){
  currentTexture=icon;
}

Fixed version (ground truth):
@Override public void set(TextureAtlasSprite icon){
  currentTexture=icon;
}
Program: 156548
Project: 156548
Buggy source:
@Override public BlockPos next(){
  BlockPos pos=zone.getRandomBlockPos(rand);
  return new BlockPos(pos.getX() - x,pos.getY() - y,pos.getZ() - z);
}

Fixed version (ground truth):
@Override public BlockPos next(){
  BlockPos pos=zone.getRandomBlockPos(rand);
  return pos.subtract(BlockScannerZoneRandom.this.pos);
}
Program: 156549
Project: 156549
Buggy source:
public BlockScannerZoneRandom(int iX,int iY,int iZ,Random iRand,IZone iZone){
  x=iX;
  y=iY;
  z=iZ;
  rand=iRand;
  zone=iZone;
}

Fixed version (ground truth):
public BlockScannerZoneRandom(BlockPos pos,Random iRand,IZone iZone){
  this.pos=pos;
  rand=iRand;
  zone=iZone;
}
Program: 156550
Project: 156550
Buggy source:
private boolean isTarget(BlockPos block){
  if (zone != null && !zone.contains(block.getX(),block.getY(),block.getZ())) {
    return false;
  }
  if (!pathFound.matches(world,block)) {
    return false;
  }
synchronized (reservations) {
    if (reservations.containsKey(world.provider.getDimensionId())) {
      HashSet<BlockPos> dimReservations=reservations.get(world.provider.getDimensionId());
      if (dimReservations.contains(block)) {
        return false;
      }
    }
  }
  if (!BuildCraftAPI.isSoftBlock(world,block.west()) && !BuildCraftAPI.isSoftBlock(world,block.east()) && !BuildCraftAPI.isSoftBlock(world,block.north())&& !BuildCraftAPI.isSoftBlock(world,block.south())&& !BuildCraftAPI.isSoftBlock(world,block.down())&& !BuildCraftAPI.isSoftBlock(world,block.up())) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean isTarget(BlockPos block){
  if (zone != null && !zone.contains(Utils.convert(block))) {
    return false;
  }
  if (!pathFound.matches(world,block)) {
    return false;
  }
synchronized (reservations) {
    if (reservations.containsKey(world.provider.getDimensionId())) {
      HashSet<BlockPos> dimReservations=reservations.get(world.provider.getDimensionId());
      if (dimReservations.contains(block)) {
        return false;
      }
    }
  }
  if (!BuildCraftAPI.isSoftBlock(world,block.west()) && !BuildCraftAPI.isSoftBlock(world,block.east()) && !BuildCraftAPI.isSoftBlock(world,block.north())&& !BuildCraftAPI.isSoftBlock(world,block.south())&& !BuildCraftAPI.isSoftBlock(world,block.down())&& !BuildCraftAPI.isSoftBlock(world,block.up())) {
    return false;
  }
  return true;
}
Program: 156551
Project: 156551
Buggy source:
@SubscribeEvent @SideOnly(Side.CLIENT) public void textureHook(TextureStitchEvent.Pre event){
  if (event.map.getTextureType() == 1) {
    RedstoneBoardRegistry.instance.registerIcons(event.map);
  }
}

Fixed version (ground truth):
@SubscribeEvent @SideOnly(Side.CLIENT) public void textureHook(TextureStitchEvent.Pre event){
  RedstoneBoardRegistry.instance.registerIcons(event.map);
}
Program: 156552
Project: 156552
Buggy source:
@Override protected void entityInit(){
  super.entityInit();
  setNullBoundingBox();
  preventEntitySpawning=false;
  noClip=true;
  isImmuneToFire=true;
  this.func_110163_bv();
  dataWatcher.addObject(12,Float.valueOf(0));
  dataWatcher.addObject(13,Float.valueOf(0));
  dataWatcher.addObject(14,Float.valueOf(0));
  dataWatcher.addObject(15,Byte.valueOf((byte)0));
  dataWatcher.addObject(16,"String_Node_Str");
  dataWatcher.addObject(17,Float.valueOf(0));
  dataWatcher.addObject(18,Float.valueOf(0));
  dataWatcher.addObject(19,Integer.valueOf(0));
  dataWatcher.addObject(20,Byte.valueOf((byte)0));
  dataWatcher.addObject(21,Integer.valueOf(0));
}

Fixed version (ground truth):
@Override protected void entityInit(){
  super.entityInit();
  setNullBoundingBox();
  preventEntitySpawning=false;
  noClip=true;
  isImmuneToFire=true;
  this.enablePersistence();
  dataWatcher.addObject(12,Float.valueOf(0));
  dataWatcher.addObject(13,Float.valueOf(0));
  dataWatcher.addObject(14,Float.valueOf(0));
  dataWatcher.addObject(15,Byte.valueOf((byte)0));
  dataWatcher.addObject(16,"String_Node_Str");
  dataWatcher.addObject(17,Float.valueOf(0));
  dataWatcher.addObject(18,Float.valueOf(0));
  dataWatcher.addObject(19,Integer.valueOf(0));
  dataWatcher.addObject(20,Byte.valueOf((byte)0));
  dataWatcher.addObject(21,Integer.valueOf(0));
}
Program: 156553
Project: 156553
Buggy source:
protected void updateDataClient(){
  laser.tail.x=dataWatcher.getWatchableObjectFloat(12);
  laser.tail.y=dataWatcher.getWatchableObjectFloat(13);
  laser.tail.z=dataWatcher.getWatchableObjectFloat(14);
  laser.isVisible=dataWatcher.getWatchableObjectByte(15) == 1;
  RedstoneBoardNBT<?> boardNBT=RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher.getWatchableObjectString(16));
  if (boardNBT != null) {
    texture=((RedstoneBoardRobotNBT)boardNBT).getRobotTexture();
  }
  itemAngle1=dataWatcher.getWatchableObjectFloat(17);
  itemAngle2=dataWatcher.getWatchableObjectFloat(18);
  energySpendPerCycle=dataWatcher.getWatchableObjectInt(19);
  isActiveClient=dataWatcher.getWatchableObjectByte(20) == 1;
  battery.setEnergy(dataWatcher.getWatchableObjectInt(21));
}

Fixed version (ground truth):
protected void updateDataClient(){
  float x=dataWatcher.getWatchableObjectFloat(12);
  float y=dataWatcher.getWatchableObjectFloat(13);
  float z=dataWatcher.getWatchableObjectFloat(14);
  laser.tail=new Vec3(x,y,z);
  laser.isVisible=dataWatcher.getWatchableObjectByte(15) == 1;
  RedstoneBoardNBT<?> boardNBT=RedstoneBoardRegistry.instance.getRedstoneBoard(dataWatcher.getWatchableObjectString(16));
  if (boardNBT != null) {
    texture=((RedstoneBoardRobotNBT)boardNBT).getRobotTexture();
  }
  itemAngle1=dataWatcher.getWatchableObjectFloat(17);
  itemAngle2=dataWatcher.getWatchableObjectFloat(18);
  energySpendPerCycle=dataWatcher.getWatchableObjectInt(19);
  isActiveClient=dataWatcher.getWatchableObjectByte(20) == 1;
  battery.setEnergy(dataWatcher.getWatchableObjectInt(21));
}
Program: 156554
Project: 156554
Buggy source:
protected void updateDataServer(){
  dataWatcher.updateObject(12,Float.valueOf((float)laser.tail.x));
  dataWatcher.updateObject(13,Float.valueOf((float)laser.tail.y));
  dataWatcher.updateObject(14,Float.valueOf((float)laser.tail.z));
  dataWatcher.updateObject(15,Byte.valueOf((byte)(laser.isVisible ? 1 : 0)));
  dataWatcher.updateObject(17,Float.valueOf(itemAngle1));
  dataWatcher.updateObject(18,Float.valueOf(itemAngle2));
}

Fixed version (ground truth):
protected void updateDataServer(){
  dataWatcher.updateObject(12,Float.valueOf((float)laser.tail.xCoord));
  dataWatcher.updateObject(13,Float.valueOf((float)laser.tail.yCoord));
  dataWatcher.updateObject(14,Float.valueOf((float)laser.tail.zCoord));
  dataWatcher.updateObject(15,Byte.valueOf((byte)(laser.isVisible ? 1 : 0)));
  dataWatcher.updateObject(17,Float.valueOf(itemAngle1));
  dataWatcher.updateObject(18,Float.valueOf(itemAngle2));
}
Program: 156555
Project: 156555
Buggy source:
@Override public List<BakedQuad> renderStaticPluggable(PipeRenderState render,PipePluggableState pluggableState,IPipe pipe,PipePluggable pluggable,EnumFacing face){
  return null;
}

Fixed version (ground truth):
@Override public List<BakedQuad> renderStaticPluggable(IPipeRenderState render,IPipePluggableState pluggableState,IPipe pipe,PipePluggable pluggable,EnumFacing face){
  return null;
}
Program: 156556
Project: 156556
Buggy source:
@Override public List<BakedQuad> renderStaticPluggable(PipeRenderState render,PipePluggableState pluggableState,IPipe pipe,PipePluggable pluggable,EnumFacing face){
  return null;
}

Fixed version (ground truth):
@Override public List<BakedQuad> renderStaticPluggable(IPipeRenderState render,IPipePluggableState pluggableState,IPipe pipe,PipePluggable pluggable,EnumFacing face){
  return null;
}