nus-yam/ex-repair huggingface dataset:
Program: 156429
Project: 156429
Buggy source:
@Override public void detectAndSendChanges(){
  super.detectAndSendChanges();
  for (  Object crafter : crafters) {
    ICrafting icrafting=(ICrafting)crafter;
    if (computingTime != architect.getComputingProgressScaled(24)) {
      icrafting.sendProgressBarUpdate(this,0,architect.getComputingProgressScaled(24));
    }
  }
  computingTime=architect.getComputingProgressScaled(24);
}

Fixed version (ground truth):
@Override public void detectAndSendChanges(){
  super.detectAndSendChanges();
  for (  IContainerListener listener : listeners) {
    if (computingTime != architect.getComputingProgressScaled(24)) {
      listener.sendProgressBarUpdate(this,0,architect.getComputingProgressScaled(24));
    }
  }
  computingTime=architect.getComputingProgressScaled(24);
}
Program: 156430
Project: 156430
Buggy source:
public void doRenderItem(ItemStack stack,double x,double y,double z){
  if (stack == null) {
    return;
  }
  float renderScale=1.5f;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x,(float)y,(float)z);
  GL11.glTranslatef(0,0.25F,0);
  GL11.glScalef(renderScale,renderScale,renderScale);
  Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
  IBakedModel model=Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack);
  Minecraft.getMinecraft().getRenderItem().renderItem(stack,model);
  GL11.glPopMatrix();
}

Fixed version (ground truth):
public void doRenderItem(ItemStack stack,double x,double y,double z){
  if (stack == null) {
    return;
  }
  float renderScale=1.5f;
  GL11.glPushMatrix();
  GL11.glTranslatef((float)x,(float)y,(float)z);
  GL11.glTranslatef(0,0.25F,0);
  GL11.glScalef(renderScale,renderScale,renderScale);
  Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
  IBakedModel model=Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack);
  Minecraft.getMinecraft().getRenderItem().renderItem(stack,model);
  GL11.glPopMatrix();
}
Program: 156431
Project: 156431
Buggy source:
@Override public void readFromWorld(IBuilderContext context,Entity entity){
  super.readFromWorld(context,entity);
  List<ItemStack> requirements=new ArrayList<>();
  EntityArmorStand stand=(EntityArmorStand)entity;
  requirements.add(new ItemStack(Items.armor_stand));
  for (int i=0; i <= 4; i++) {
    ItemStack stack=stand.getEquipmentInSlot(i);
    if (stack != null) {
      requirements.add(stack);
    }
  }
  storedRequirements=requirements.toArray(new ItemStack[requirements.size()]);
}

Fixed version (ground truth):
@Override public void readFromWorld(IBuilderContext context,Entity entity){
  super.readFromWorld(context,entity);
  List<ItemStack> requirements=new ArrayList<>();
  EntityArmorStand stand=(EntityArmorStand)entity;
  requirements.add(new ItemStack(Items.ARMOR_STAND));
  for (  EntityEquipmentSlot slot : EntityEquipmentSlot.values()) {
    ItemStack stack=stand.getItemStackFromSlot(slot);
    if (stack != null) {
      requirements.add(stack);
    }
  }
  storedRequirements=requirements.toArray(new ItemStack[requirements.size()]);
}
Program: 156432
Project: 156432
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  if (state.getValue(BlockBed.PART) == BlockBed.EnumPartType.HEAD) {
    requirements.add(new ItemStack(Items.bed));
  }
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  if (state.getValue(BlockBed.PART) == BlockBed.EnumPartType.HEAD) {
    requirements.add(new ItemStack(Items.BED));
  }
}
Program: 156433
Project: 156433
Buggy source:
@Override public void rotateLeft(IBuilderContext context){
  IBlockState oldState=state;
  EnumFacing oldFacing=(EnumFacing)oldState.getValue(BlockBed.FACING);
  state=oldState.withProperty(BlockBed.FACING,oldFacing.rotateY());
}

Fixed version (ground truth):
@Override public void rotateLeft(IBuilderContext context){
  IBlockState oldState=state;
  EnumFacing oldFacing=oldState.getValue(BlockBed.FACING);
  state=oldState.withProperty(BlockBed.FACING,oldFacing.rotateY());
}
Program: 156434
Project: 156434
Buggy source:
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,state.withProperty(BlockBed.PART,BlockBed.EnumPartType.HEAD));
  BlockPos feetPos=pos.offset(state.getValue(getFacingProp()),-1);
  context.world().setBlockState(feetPos,state.withProperty(BlockBed.PART,BlockBed.EnumPartType.FOOT));
}

Fixed version (ground truth):
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,state.withProperty(BlockBed.PART,BlockBed.EnumPartType.HEAD));
  BlockPos feetPos=pos.offset(state.getValue(BlockBed.FACING),-1);
  context.world().setBlockState(feetPos,state.withProperty(BlockBed.PART,BlockBed.EnumPartType.FOOT));
}
Program: 156435
Project: 156435
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.cactus));
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.CACTUS));
}
Program: 156436
Project: 156436
Buggy source:
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  return context.world().getBlockState(pos).getBlock() == Blocks.cactus;
}

Fixed version (ground truth):
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  return context.world().getBlockState(pos).getBlock() == Blocks.CACTUS;
}
Program: 156437
Project: 156437
Buggy source:
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,Blocks.cactus.getDefaultState(),3);
}

Fixed version (ground truth):
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,Blocks.CACTUS.getDefaultState(),3);
}
Program: 156438
Project: 156438
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.dirt));
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.DIRT));
}
Program: 156439
Project: 156439
Buggy source:
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.dirt || block == Blocks.grass || block == Blocks.farmland;
}

Fixed version (ground truth):
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.DIRT || block == Blocks.GRASS || block == Blocks.FARMLAND;
}
Program: 156440
Project: 156440
Buggy source:
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,Blocks.dirt.getDefaultState(),3);
}

Fixed version (ground truth):
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,Blocks.DIRT.getDefaultState(),3);
}
Program: 156441
Project: 156441
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.obsidian,8));
  requirements.add(new ItemStack(Items.ender_eye,1));
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.OBSIDIAN,8));
  requirements.add(new ItemStack(Items.ENDER_EYE,1));
}
Program: 156442
Project: 156442
Buggy source:
@Override protected SchematicBlock loadSchematicFromWorldNBT(NBTTagCompound nbt,MappingRegistry registry) throws MappingNotFoundException {
  int blockId=nbt.getInteger("String_Node_Str");
  Block b=registry.getBlockForId(blockId);
  if (b == Blocks.air) {
    SchematicBlock s=new SchematicBlock();
    s.state=Blocks.air.getDefaultState();
    return s;
  }
 else {
    SchematicBlock s=SchematicRegistry.INSTANCE.createSchematicBlock(b.getStateFromMeta(nbt.getInteger("String_Node_Str")));
    if (s != null) {
      s.readSchematicFromNBT(nbt,registry);
      return s;
    }
  }
  return null;
}

Fixed version (ground truth):
@Override protected SchematicBlock loadSchematicFromWorldNBT(NBTTagCompound nbt,MappingRegistry registry) throws MappingNotFoundException {
  int blockId=nbt.getInteger("String_Node_Str");
  Block b=registry.getBlockForId(blockId);
  if (b == Blocks.AIR) {
    SchematicBlock s=new SchematicBlock();
    s.state=Blocks.AIR.getDefaultState();
    return s;
  }
 else {
    SchematicBlock s=SchematicRegistry.INSTANCE.createSchematicBlock(b.getStateFromMeta(nbt.getInteger("String_Node_Str")));
    if (s != null) {
      s.readSchematicFromNBT(nbt,registry);
      return s;
    }
  }
  return null;
}
Program: 156443
Project: 156443
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.dirt));
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.DIRT));
}
Program: 156444
Project: 156444
Buggy source:
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.farmland;
}

Fixed version (ground truth):
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.FARMLAND;
}
Program: 156445
Project: 156445
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Items.flint_and_steel));
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Items.FLINT_AND_STEEL));
}
Program: 156446
Project: 156446
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.gravel));
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.GRAVEL));
}
Program: 156447
Project: 156447
Buggy source:
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.gravel;
}

Fixed version (ground truth):
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.GRAVEL;
}
Program: 156448
Project: 156448
Buggy source:
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,Blocks.gravel.getDefaultState());
}

Fixed version (ground truth):
@Override public void placeInWorld(IBuilderContext context,BlockPos pos,List<ItemStack> stacks){
  context.world().setBlockState(pos,Blocks.GRAVEL.getDefaultState());
}
Program: 156449
Project: 156449
Buggy source:
@Override public void translateToWorld(Vec3d transform){
  super.translateToWorld(transform);
  Vec3d pos=new Vec3d(entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"));
  pos=pos.add(transform);
  Vec3di floored=Utils.convertFloor(pos);
  entityNBT.setInteger("String_Node_Str",floored.getX());
  entityNBT.setInteger("String_Node_Str",floored.getY());
  entityNBT.setInteger("String_Node_Str",floored.getZ());
}

Fixed version (ground truth):
@Override public void translateToWorld(Vec3d transform){
  super.translateToWorld(transform);
  Vec3d pos=new Vec3d(entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"));
  pos=pos.add(transform);
  Vec3i floored=Utils.convertFloor(pos);
  entityNBT.setInteger("String_Node_Str",floored.getX());
  entityNBT.setInteger("String_Node_Str",floored.getY());
  entityNBT.setInteger("String_Node_Str",floored.getZ());
}
Program: 156450
Project: 156450
Buggy source:
@Override public void readFromWorld(IBuilderContext context,Entity entity){
  super.readFromWorld(context,entity);
  if (baseItem == Items.item_frame) {
    NBTTagCompound tag=entityNBT.getCompoundTag("String_Node_Str");
    ItemStack stack=ItemStack.loadItemStackFromNBT(tag);
    if (stack != null) {
      storedRequirements=new ItemStack[2];
      storedRequirements[0]=new ItemStack(baseItem);
      storedRequirements[1]=stack;
    }
 else {
      storedRequirements=new ItemStack[1];
      storedRequirements[0]=new ItemStack(baseItem);
    }
  }
 else {
    storedRequirements=new ItemStack[1];
    storedRequirements[0]=new ItemStack(baseItem);
  }
}

Fixed version (ground truth):
@Override public void readFromWorld(IBuilderContext context,Entity entity){
  super.readFromWorld(context,entity);
  if (baseItem == Items.ITEM_FRAME) {
    NBTTagCompound tag=entityNBT.getCompoundTag("String_Node_Str");
    ItemStack stack=ItemStack.loadItemStackFromNBT(tag);
    if (stack != null) {
      storedRequirements=new ItemStack[2];
      storedRequirements[0]=new ItemStack(baseItem);
      storedRequirements[1]=stack;
    }
 else {
      storedRequirements=new ItemStack[1];
      storedRequirements[0]=new ItemStack(baseItem);
    }
  }
 else {
    storedRequirements=new ItemStack[1];
    storedRequirements[0]=new ItemStack(baseItem);
  }
}
Program: 156451
Project: 156451
Buggy source:
@Override public void translateToBlueprint(Vec3d transform){
  super.translateToBlueprint(transform);
  Vec3d pos=new Vec3d(entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"));
  pos=pos.add(transform);
  Vec3di floored=Utils.convertFloor(pos);
  entityNBT.setInteger("String_Node_Str",floored.getX());
  entityNBT.setInteger("String_Node_Str",floored.getY());
  entityNBT.setInteger("String_Node_Str",floored.getZ());
}

Fixed version (ground truth):
@Override public void translateToBlueprint(Vec3d transform){
  super.translateToBlueprint(transform);
  Vec3d pos=new Vec3d(entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"),entityNBT.getInteger("String_Node_Str"));
  pos=pos.add(transform);
  Vec3i floored=Utils.convertFloor(pos);
  entityNBT.setInteger("String_Node_Str",floored.getX());
  entityNBT.setInteger("String_Node_Str",floored.getY());
  entityNBT.setInteger("String_Node_Str",floored.getZ());
}
Program: 156452
Project: 156452
Buggy source:
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.redstone_lamp,1,0));
}

Fixed version (ground truth):
@Override public void getRequirementsForPlacement(IBuilderContext context,List<ItemStack> requirements){
  requirements.add(new ItemStack(Blocks.REDSTONE_LAMP,1,0));
}
Program: 156453
Project: 156453
Buggy source:
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.redstone_lamp || block == Blocks.lit_redstone_lamp;
}

Fixed version (ground truth):
@Override public boolean isAlreadyBuilt(IBuilderContext context,BlockPos pos){
  Block block=context.world().getBlockState(pos).getBlock();
  return block == Blocks.REDSTONE_LAMP || block == Blocks.LIT_REDSTONE_LAMP;
}
Program: 156455
Project: 156455
Buggy source:
@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)) {
      IGateExpansion exp=recipes.inverse().get(expansion);
      if (exp.canAddToGate(ItemGate.getMaterial(input).numTriggerParameters,ItemGate.getMaterial(input).numActionParameters)) {
        return true;
      }
 else {
        return false;
      }
    }
  }
  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)) {
      IGateExpansion exp=recipes.inverse().get(expansion);
      GateDefinition.GateMaterial material=ItemGate.getMaterial(input);
      int numTP=material != null ? material.numTriggerParameters : 0;
      int numAP=material != null ? material.numActionParameters : 0;
      if (exp.canAddToGate(numTP,numAP)) {
        return true;
      }
 else {
        return false;
      }
    }
  }
  return false;
}
Program: 156456
Project: 156456
Buggy source:
private boolean isTriggeredEnergyHandler(IEnergyConnection connection,EnumPipePart part){
  int energyStored, energyMaxStored;
  EnumFacing side=part.face;
  if (connection instanceof IEnergyHandler) {
    energyStored=((IEnergyHandler)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyHandler)connection).getMaxEnergyStored(side);
  }
 else   if (connection instanceof IEnergyProvider) {
    energyStored=((IEnergyProvider)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyProvider)connection).getMaxEnergyStored(side);
  }
 else   if (connection instanceof IEnergyReceiver) {
    energyStored=((IEnergyReceiver)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyReceiver)connection).getMaxEnergyStored(side);
  }
 else {
    return false;
  }
  if (energyMaxStored > 0) {
    float level=(float)energyStored / (float)energyMaxStored;
    if (high) {
      return level > 0.95F;
    }
 else {
      return level < 0.05F;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isTriggeredEnergyHandler(IEnergyConnection connection,EnumPipePart part){
  int energyStored, energyMaxStored;
  EnumFacing side=part.face;
  if (connection instanceof IEnergyHandler) {
    energyStored=((IEnergyHandler)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyHandler)connection).getMaxEnergyStored(side);
  }
 else {
    return false;
  }
  if (energyMaxStored > 0) {
    float level=(float)energyStored / (float)energyMaxStored;
    if (high) {
      return level > 0.95F;
    }
 else {
      return level < 0.05F;
    }
  }
  return false;
}
Program: 156457
Project: 156457
Buggy source:
protected static boolean isTriggered(Object tile,EnumPipePart side){
  if (tile instanceof IEnergyConnection) {
    return ((IEnergyConnection)tile).canConnectEnergy(side.opposite().face);
  }
  return false;
}

Fixed version (ground truth):
protected static boolean isTriggered(Object tile,EnumPipePart side){
  if (tile instanceof IPipeTile) {
    return false;
  }
 else   if (tile instanceof IEnergyConnection) {
    return ((IEnergyConnection)tile).canConnectEnergy(side.opposite().face);
  }
 else {
    return false;
  }
}
Program: 156458
Project: 156458
Buggy source:
@Override public boolean isValidExpansion(ItemStack input,ItemStack expansion){
  if (StackHelper.isMatchingItem(EnumRedstoneChipset.RED.getStack(),expansion,true,true)) {
    return true;
  }
  for (  ItemStack s : recipes.values()) {
    System.out.println(s.toString());
    if (StackHelper.isMatchingItem(s,expansion,true,true)) {
      IGateExpansion exp=recipes.inverse().get(s);
      if (exp != null) {
        GateDefinition.GateMaterial material=ItemGate.getMaterial(input);
        int numTP=material != null ? material.numTriggerParameters : 0;
        int numAP=material != null ? material.numActionParameters : 0;
        if (exp.canAddToGate(numTP,numAP)) {
          return true;
        }
 else {
          return false;
        }
      }
    }
  }
  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)) {
      IGateExpansion exp=recipes.inverse().get(s);
      if (exp != null) {
        GateDefinition.GateMaterial material=ItemGate.getMaterial(input);
        int numTP=material != null ? material.numTriggerParameters : 0;
        int numAP=material != null ? material.numActionParameters : 0;
        if (exp.canAddToGate(numTP,numAP)) {
          return true;
        }
 else {
          return false;
        }
      }
    }
  }
  return false;
}
Program: 156459
Project: 156459
Buggy source:
private boolean isTriggeredEnergyHandler(IEnergyConnection connection,EnumPipePart part){
  int energyStored, energyMaxStored;
  EnumFacing side=part.face;
  if (connection instanceof IEnergyHandler) {
    energyStored=((IEnergyHandler)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyHandler)connection).getMaxEnergyStored(side);
  }
 else   if (connection instanceof IEnergyProvider) {
    energyStored=((IEnergyProvider)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyProvider)connection).getMaxEnergyStored(side);
  }
 else   if (connection instanceof IEnergyReceiver) {
    energyStored=((IEnergyReceiver)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyReceiver)connection).getMaxEnergyStored(side);
  }
 else {
    return false;
  }
  if (energyMaxStored > 0) {
    float level=(float)energyStored / (float)energyMaxStored;
    if (high) {
      return level > 0.95F;
    }
 else {
      return level < 0.05F;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isTriggeredEnergyHandler(IEnergyConnection connection,EnumPipePart part){
  int energyStored, energyMaxStored;
  EnumFacing side=part.face;
  if (connection instanceof IEnergyHandler) {
    energyStored=((IEnergyHandler)connection).getEnergyStored(side);
    energyMaxStored=((IEnergyHandler)connection).getMaxEnergyStored(side);
  }
 else {
    return false;
  }
  if (energyMaxStored > 0) {
    float level=(float)energyStored / (float)energyMaxStored;
    if (high) {
      return level > 0.95F;
    }
 else {
      return level < 0.05F;
    }
  }
  return false;
}
Program: 156460
Project: 156460
Buggy source:
protected static boolean isTriggered(Object tile,EnumPipePart side){
  if (tile instanceof IEnergyConnection) {
    return ((IEnergyConnection)tile).canConnectEnergy(side.opposite().face);
  }
  return false;
}

Fixed version (ground truth):
protected static boolean isTriggered(Object tile,EnumPipePart side){
  if (tile instanceof IPipeTile) {
    return false;
  }
 else   if (tile instanceof IEnergyConnection) {
    return ((IEnergyConnection)tile).canConnectEnergy(side.opposite().face);
  }
 else {
    return false;
  }
}
Program: 156461
Project: 156461
Buggy source:
@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)) {
      IGateExpansion exp=recipes.inverse().get(expansion);
      if (exp != null) {
        GateDefinition.GateMaterial material=ItemGate.getMaterial(input);
        int numTP=material != null ? material.numTriggerParameters : 0;
        int numAP=material != null ? material.numActionParameters : 0;
        if (exp.canAddToGate(numTP,numAP)) {
          return true;
        }
 else {
          return false;
        }
      }
    }
  }
  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()) {
    System.out.println(s.toString());
    if (StackHelper.isMatchingItem(s,expansion,true,true)) {
      IGateExpansion exp=recipes.inverse().get(s);
      if (exp != null) {
        GateDefinition.GateMaterial material=ItemGate.getMaterial(input);
        int numTP=material != null ? material.numTriggerParameters : 0;
        int numAP=material != null ? material.numActionParameters : 0;
        if (exp.canAddToGate(numTP,numAP)) {
          return true;
        }
 else {
          return false;
        }
      }
    }
  }
  return false;
}
Program: 156462
Project: 156462
Buggy source:
@Override public IPipePluggableDynamicRenderer getDynamicRenderer(){
  return GatePluggableModel.INSTANCE;
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public IPipePluggableDynamicRenderer getDynamicRenderer(){
  return GatePluggableModel.INSTANCE;
}
Program: 156463
Project: 156463
Buggy source:
@Override public ModelKeyGate getModelRenderKey(EnumWorldBlockLayer layer,EnumFacing side){
  if (layer == EnumWorldBlockLayer.CUTOUT) {
    return new ModelKeyGate(side,material,logic,isLit,expansions);
  }
  return null;
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public ModelKeyGate getModelRenderKey(EnumWorldBlockLayer layer,EnumFacing side){
  if (layer == EnumWorldBlockLayer.CUTOUT) {
    return new ModelKeyGate(side,material,logic,isLit,expansions);
  }
  return null;
}
Program: 156464
Project: 156464
Buggy source:
@Override public void registerBlockRenderers(){
  super.registerBlockRenderers();
  ClientRegistry.bindTileEntitySpecialRenderer(TileArchitect.class,new RenderArchitect());
  ClientRegistry.bindTileEntitySpecialRenderer(TileFiller.class,new RenderBuilder<TileFiller>());
  ClientRegistry.bindTileEntitySpecialRenderer(TileBuilder.class,new RenderBuilderTile());
  ClientRegistry.bindTileEntitySpecialRenderer(TileConstructionMarker.class,new RenderConstructionMarker());
  ClientRegistry.bindTileEntitySpecialRenderer(TileQuarry.class,new RenderQuarry());
  RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class,new RenderVoid<EntityMechanicalArm>());
}

Fixed version (ground truth):
@Override public void registerBlockRenderers(){
  super.registerBlockRenderers();
  ClientRegistry.bindTileEntitySpecialRenderer(TileArchitect.class,new RenderArchitect());
  ClientRegistry.bindTileEntitySpecialRenderer(TileFiller.class,new RenderFiller());
  ClientRegistry.bindTileEntitySpecialRenderer(TileBuilder.class,new RenderBuilderTile());
  ClientRegistry.bindTileEntitySpecialRenderer(TileConstructionMarker.class,new RenderConstructionMarker());
  ClientRegistry.bindTileEntitySpecialRenderer(TileQuarry.class,new RenderQuarry());
  RenderingRegistry.registerEntityRenderingHandler(EntityMechanicalArm.class,new RenderVoid<EntityMechanicalArm>());
}
Program: 156465
Project: 156465
Buggy source:
public static void doRender(World world,TextureManager t,ResourceLocation texture,Box box){
  GL11.glPushMatrix();
  GL11.glDisable(GL11.GL_LIGHTING);
  box.createLaserData();
  for (  LaserData l : box.lasersData) {
    l.update();
    GL11.glPushMatrix();
    GL11.glTranslated(0.5F,0.5F,0.5F);
    RenderLaser.doRenderLaser(world,t,l,texture);
    GL11.glPopMatrix();
  }
  GL11.glEnable(GL11.GL_LIGHTING);
  GL11.glPopMatrix();
}

Fixed version (ground truth):
public static void doRender(World world,TextureManager t,ResourceLocation texture,Box box){
  Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
  Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
  GL11.glPushMatrix();
  GL11.glDisable(GL11.GL_LIGHTING);
  box.createLaserData();
  Minecraft.getMinecraft().mcProfiler.endStartSection("String_Node_Str");
  for (  LaserData l : box.lasersData) {
    GL11.glPushMatrix();
    GL11.glTranslated(0.5F,0.5F,0.5F);
    RenderLaser.doRenderLaser(world,t,l,texture);
    GL11.glPopMatrix();
  }
  GL11.glEnable(GL11.GL_LIGHTING);
  GL11.glPopMatrix();
  Minecraft.getMinecraft().mcProfiler.endSection();
  Minecraft.getMinecraft().mcProfiler.endSection();
}
Program: 156466
Project: 156466
Buggy source:
@Override public void renderTileEntityAt(T tileentity,double x,double y,double z,float f,int anArgument){
  Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
  GL11.glPushMatrix();
  GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
  GlStateManager.enableCull();
  GlStateManager.disableLighting();
  GlStateManager.enableBlend();
  GlStateManager.blendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
  GL11.glPushMatrix();
  GL11.glTranslated(-tileentity.getPos().getX(),-tileentity.getPos().getY(),-tileentity.getPos().getZ());
  GL11.glTranslated(x,y,z);
  if (tileentity instanceof IBoxesProvider) {
    for (    Box b : ((IBoxesProvider)tileentity).getBoxes()) {
      if (b.isVisible) {
        RenderBox.doRender(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,getTexture(b.kind),b);
      }
    }
  }
 else   if (tileentity instanceof IBoxProvider) {
    Box b=((IBoxProvider)tileentity).getBox();
    if (b.isVisible && b.isInitialized()) {
      RenderBox.doRender(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,getTexture(b.kind),b);
    }
  }
  GL11.glPopMatrix();
  GL11.glPopAttrib();
  GL11.glPopMatrix();
  Minecraft.getMinecraft().mcProfiler.endSection();
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(T tileentity,double x,double y,double z,float f,int anArgument){
  GL11.glPushMatrix();
  GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
  GlStateManager.enableCull();
  GlStateManager.disableLighting();
  GlStateManager.enableBlend();
  GlStateManager.blendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
  GL11.glPushMatrix();
  GL11.glTranslated(-tileentity.getPos().getX(),-tileentity.getPos().getY(),-tileentity.getPos().getZ());
  GL11.glTranslated(x,y,z);
  if (tileentity instanceof IBoxesProvider) {
    for (    Box b : ((IBoxesProvider)tileentity).getBoxes()) {
      if (b.isVisible) {
        RenderBox.doRender(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,getTexture(b.kind),b);
      }
    }
  }
 else   if (tileentity instanceof IBoxProvider) {
    Box b=((IBoxProvider)tileentity).getBox();
    if (b.isVisible && b.isInitialized()) {
      RenderBox.doRender(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,getTexture(b.kind),b);
    }
  }
  GL11.glPopMatrix();
  GL11.glPopAttrib();
  GL11.glPopMatrix();
}
Program: 156467
Project: 156467
Buggy source:
public static void doRenderLaser(World world,TextureManager textureManager,LaserData laser,ResourceLocation texture){
  if (!laser.isVisible || texture == null) {
    return;
  }
  GL11.glPushMatrix();
  GL11.glTranslated(laser.head.xCoord,laser.head.yCoord,laser.head.zCoord);
  laser.update();
  GL11.glRotatef((float)laser.angleZ,0,1,0);
  GL11.glRotatef((float)laser.angleY,0,0,1);
  textureManager.bindTexture(texture);
  initScaledBoxes(world);
  doRenderLaserLine(laser.renderSize,laser.laserTexAnimation);
  GL11.glPopMatrix();
  GL11.glLineWidth(OPTION_LASER_FALLBACK_PIXELS.getAsInt());
  GL11.glBegin(GL11.GL_LINES);
  GL11.glTexCoord2d(0.9999d,0.9999d);
  GL11.glVertex3d(laser.head.xCoord,laser.head.yCoord,laser.head.zCoord);
  GL11.glVertex3d(laser.tail.xCoord,laser.tail.yCoord,laser.tail.zCoord);
  GL11.glEnd();
}

Fixed version (ground truth):
public static void doRenderLaser(World world,TextureManager textureManager,LaserData laser,ResourceLocation texture){
  if (!laser.isVisible || texture == null) {
    return;
  }
  Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
  Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
  GL11.glPushMatrix();
  GL11.glTranslated(laser.head.xCoord,laser.head.yCoord,laser.head.zCoord);
  laser.update();
  GL11.glRotatef((float)laser.angleZ,0,1,0);
  GL11.glRotatef((float)laser.angleY,0,0,1);
  textureManager.bindTexture(texture);
  initScaledBoxes(world);
  Minecraft.getMinecraft().mcProfiler.endStartSection("String_Node_Str");
  doRenderLaserLine(laser.renderSize,laser.laserTexAnimation);
  Minecraft.getMinecraft().mcProfiler.endStartSection("String_Node_Str");
  GL11.glPopMatrix();
  GL11.glLineWidth(OPTION_LASER_FALLBACK_PIXELS.getAsInt());
  GL11.glBegin(GL11.GL_LINES);
  GL11.glTexCoord2d(0.9999d,0.9999d);
  GL11.glVertex3d(laser.head.xCoord,laser.head.yCoord,laser.head.zCoord);
  GL11.glVertex3d(laser.tail.xCoord,laser.tail.yCoord,laser.tail.zCoord);
  GL11.glEnd();
  Minecraft.getMinecraft().mcProfiler.endSection();
  Minecraft.getMinecraft().mcProfiler.endSection();
}
Program: 156468
Project: 156468
Buggy source:
@Override public void renderTileEntityAt(TileMarker marker,double x,double y,double z,float partialTicks,int destroyStage){
  if (marker != null) {
    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glTranslated(x,y,z);
    GL11.glTranslated(-marker.getPos().getX(),-marker.getPos().getY(),-marker.getPos().getZ());
    if (marker.lasers != null)     for (    LaserData laser : marker.lasers) {
      if (laser != null) {
        GL11.glPushMatrix();
        RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,laser,EntityLaser.LASER_RED);
        GL11.glPopMatrix();
      }
    }
    if (marker.signals != null)     for (    LaserData laser : marker.signals) {
      if (laser != null) {
        GL11.glPushMatrix();
        RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,laser,EntityLaser.LASER_BLUE);
        GL11.glPopMatrix();
      }
    }
    GL11.glPopAttrib();
    GL11.glPopMatrix();
  }
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileMarker marker,double x,double y,double z,float partialTicks,int destroyStage){
  if (marker != null) {
    Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
    Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glTranslated(x,y,z);
    GL11.glTranslated(-marker.getPos().getX(),-marker.getPos().getY(),-marker.getPos().getZ());
    Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
    if (marker.lasers != null)     for (    LaserData laser : marker.lasers) {
      if (laser != null) {
        GL11.glPushMatrix();
        RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,laser,EntityLaser.LASER_RED);
        GL11.glPopMatrix();
      }
    }
    Minecraft.getMinecraft().mcProfiler.endStartSection("String_Node_Str");
    if (marker.signals != null)     for (    LaserData laser : marker.signals) {
      if (laser != null) {
        GL11.glPushMatrix();
        RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.worldObj,Minecraft.getMinecraft().renderEngine,laser,EntityLaser.LASER_BLUE);
        GL11.glPopMatrix();
      }
    }
    Minecraft.getMinecraft().mcProfiler.endSection();
    GL11.glPopAttrib();
    GL11.glPopMatrix();
    Minecraft.getMinecraft().mcProfiler.endSection();
    Minecraft.getMinecraft().mcProfiler.endSection();
  }
}
Program: 156469
Project: 156469
Buggy source:
@Override public void renderTileEntityAt(TileLaser laser,double x,double y,double z,float f,int i){
  if (laser != null) {
    GL11.glPushMatrix();
    GL11.glTranslated(x,y,z);
    GL11.glTranslated(-laser.getPos().getX(),-laser.getPos().getY(),-laser.getPos().getZ());
    GL11.glPushMatrix();
    RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.worldObj,TileEntityRendererDispatcher.instance.renderEngine,laser.laser,laser.getTexture());
    GL11.glPopMatrix();
    GL11.glPopMatrix();
  }
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileLaser laser,double x,double y,double z,float f,int i){
  Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
  Minecraft.getMinecraft().mcProfiler.startSection("String_Node_Str");
  if (laser != null) {
    GL11.glPushMatrix();
    GL11.glTranslated(x,y,z);
    GL11.glTranslated(-laser.getPos().getX(),-laser.getPos().getY(),-laser.getPos().getZ());
    GL11.glPushMatrix();
    RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.worldObj,TileEntityRendererDispatcher.instance.renderEngine,laser.laser,laser.getTexture());
    GL11.glPopMatrix();
    GL11.glPopMatrix();
  }
  Minecraft.getMinecraft().mcProfiler.endSection();
  Minecraft.getMinecraft().mcProfiler.endSection();
}
Program: 156470
Project: 156470
Buggy source:
@Override public void readData(ByteBuf data){
  int blockId=data.readUnsignedShort();
  Block block;
  if (blockId > 0) {
    block=Block.getBlockById(blockId);
  }
 else {
    block=null;
  }
  int flags=data.readUnsignedByte();
  int meta=flags & 0x0F;
  state=block.getStateFromMeta(meta);
  transparent=(flags & 0x80) > 0;
  renderAsHollow=(flags & 0x40) > 0;
}

Fixed version (ground truth):
@Override public void readData(ByteBuf data){
  int blockId=data.readUnsignedShort();
  Block block;
  if (blockId > 0) {
    block=Block.getBlockById(blockId);
  }
 else {
    block=Blocks.stone;
  }
  int flags=data.readUnsignedByte();
  int meta=flags & 0x0F;
  state=block.getStateFromMeta(meta);
  transparent=(flags & 0x80) > 0;
  renderAsHollow=(flags & 0x40) > 0;
}
Program: 156471
Project: 156471
Buggy source:
@Override public PluggableModelKeyCutout<?> getModelRenderKey(EnumFacing side){
  return null;
}

Fixed version (ground truth):
@Override public ModelKeyFacade getModelRenderKey(EnumWorldBlockLayer layer,EnumFacing side){
  if (layer == EnumWorldBlockLayer.CUTOUT) {
    return new ModelKeyFacade(side,state,isHollow());
  }
  return null;
}
Program: 156472
Project: 156472
Buggy source:
protected void notifyBlocksOfNeighborChange(EnumFacing side){
  container.getWorld().notifyBlockOfStateChange(container.getPos().offset(side),BuildCraftTransport.genericPipeBlock);
}

Fixed version (ground truth):
protected void notifyBlocksOfNeighborChange(EnumFacing side){
  container.getWorld().notifyNeighborsOfStateChange(container.getPos().offset(side),BuildCraftTransport.genericPipeBlock);
}
Program: 156475
Project: 156475
Buggy source:
protected ChuteRenderModel(ImmutableList<BakedQuad> quads,IBakedModel parent){
  super(quads,null,DefaultVertexFormats.BLOCK);
  this.parent=parent;
}

Fixed version (ground truth):
protected ChuteRenderModel(ImmutableList<BakedQuad> quads,IBakedModel parent){
  super(quads,null,MutableQuad.ITEM_BLOCK_PADDING);
  this.parent=parent;
}
Program: 156477
Project: 156477
Buggy source:
private List<BakedQuad> bakeTransclucent(LensPluggable lens,EnumFacing face,VertexFormat format){
  EnumDyeColor colour=lens.getColour();
  TextureAtlasSprite sprite=spriteTranslucent;
  int shade=-1;
  if (colour == null) {
    if (lens.isFilter)     return Collections.emptyList();
    sprite=spriteWaterFlow;
  }
 else {
    shade=ColorUtils.getLightHex(colour);
    if (format == DefaultVertexFormats.ITEM)     shade=ColorUtils.convertBGRAtoRGBA(shade);
  }
  List<BakedQuad> quads=Lists.newArrayList();
  List<BakedQuad> bakedQuads=renderLens(modelTranslucent(),sprite,format);
  Matrix4f matrix=MatrixUtils.rotateTowardsFace(face);
  for (  BakedQuad quad : bakedQuads) {
    MutableQuad mutable=MutableQuad.create(quad);
    mutable.setTint(shade);
    mutable.transform(matrix);
    BCModelHelper.appendBakeQuads(quads,format,mutable);
  }
  return quads;
}

Fixed version (ground truth):
private List<BakedQuad> bakeTransclucent(LensPluggable lens,EnumFacing face,VertexFormat format){
  EnumDyeColor colour=lens.getColour();
  TextureAtlasSprite sprite=spriteTranslucent;
  int shade=-1;
  if (colour == null) {
    if (lens.isFilter)     return Collections.emptyList();
    sprite=spriteWaterFlow;
  }
 else {
    shade=ColorUtils.getLightHex(colour);
  }
  List<BakedQuad> quads=Lists.newArrayList();
  List<BakedQuad> bakedQuads=renderLens(modelTranslucent(),sprite,format);
  Matrix4f matrix=MatrixUtils.rotateTowardsFace(face);
  for (  BakedQuad quad : bakedQuads) {
    MutableQuad mutable=MutableQuad.create(quad);
    mutable.setTint(shade);
    mutable.transform(matrix);
    BCModelHelper.appendBakeQuads(quads,format,mutable);
  }
  return quads;
}
Program: 156479
Project: 156479
Buggy source:
private ModelKeyGate getState(ItemStack stack){
  GateMaterial material=ItemGate.getMaterial(stack);
  GateLogic logic=ItemGate.getLogic(stack);
  Set<IGateExpansion> expansions=ItemGate.getInstalledExpansions(stack);
  Set<IGateStaticRenderState> states=Sets.newHashSet();
  for (  IGateExpansion exp : expansions)   states.add(exp.getRenderState());
  return new ModelKeyGate(EnumFacing.UP,material,logic,expansions.toArray(new IGateExpansion[0]));
}

Fixed version (ground truth):
private ModelKeyGate getState(ItemStack stack){
  GateMaterial material=ItemGate.getMaterial(stack);
  GateLogic logic=ItemGate.getLogic(stack);
  Set<IGateExpansion> expansions=ItemGate.getInstalledExpansions(stack);
  return new ModelKeyGate(EnumFacing.UP,material,logic,expansions.toArray(new IGateExpansion[0]));
}
Program: 156481
Project: 156481
Buggy source:
public ItemStack getRecipeOutput(){
  if (currentRecipe == null) {
    return null;
  }
  ItemStack result=currentRecipe.getCraftingResult(craftMatrix);
  if (result != null) {
    result=result.copy();
  }
  return result;
}

Fixed version (ground truth):
public ItemStack getRecipeOutput(){
  currentRecipe=findRecipe();
  if (currentRecipe == null) {
    return null;
  }
  ItemStack result=currentRecipe.getCraftingResult(this);
  if (result != null) {
    result=result.copy();
  }
  return result;
}
Program: 156483
Project: 156483
Buggy source:
@Override public boolean handle(World world,BlockPos pos,EnumFacing direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  if (!world.isAirBlock(pos)) {
    return false;
  }
  ItemBlock ib=(ItemBlock)stack.getItem();
  if (ib.placeBlockAt(stack,player,world,pos,direction,0.0f,0.0f,0.0f,ib.block.getStateFromMeta(stack.getMetadata()))) {
    if (stack.stackSize > 0) {
      activator.sendItem(stack,direction.getOpposite());
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean handle(World world,BlockPos pos,EnumFacing direction,ItemStack stack,EntityPlayer player,IStripesActivator activator){
  if (!world.isAirBlock(pos)) {
    return false;
  }
  ItemBlock ib=(ItemBlock)stack.getItem();
  if (ib.onItemUse(stack,player,world,pos,direction,0.5f,0.5f,0.5f)) {
    if (stack.stackSize > 0) {
      activator.sendItem(stack,direction.getOpposite());
    }
    return true;
  }
  return false;
}
Program: 156484
Project: 156484
Buggy source:
private IdentifiableAABB<Part> getPipeBoundingBox(EnumFacing side){
  float min=CoreConstants.PIPE_MIN_POS;
  float max=CoreConstants.PIPE_MAX_POS;
  if (side == null) {
    return new IdentifiableAABB<Part>(min,min,min,max,max,max,Part.Pipe);
  }
  float[][] bounds=new float[3][2];
  bounds[0][0]=min;
  bounds[0][1]=max;
  bounds[1][0]=0;
  bounds[1][1]=min;
  bounds[2][0]=min;
  bounds[2][1]=max;
  MatrixTranformations.transform(bounds,side);
  return new IdentifiableAABB<Part>(bounds[0][0],bounds[1][0],bounds[2][0],bounds[0][1],bounds[1][1],bounds[2][1],Part.Pipe);
}

Fixed version (ground truth):
private static IdentifiableAABB<Part> getPipeBoundingBox(EnumFacing side){
  float min=CoreConstants.PIPE_MIN_POS;
  float max=CoreConstants.PIPE_MAX_POS;
  if (side == null) {
    return new IdentifiableAABB<>(min,min,min,max,max,max,Part.Pipe);
  }
  float[][] bounds=new float[3][2];
  bounds[0][0]=min;
  bounds[0][1]=max;
  bounds[1][0]=0;
  bounds[1][1]=min;
  bounds[2][0]=min;
  bounds[2][1]=max;
  MatrixTranformations.transform(bounds,side);
  return new IdentifiableAABB<>(bounds[0][0],bounds[1][0],bounds[2][0],bounds[0][1],bounds[1][1],bounds[2][1],Part.Pipe);
}
Program: 156485
Project: 156485
Buggy source:
@Override public AxisAlignedBB[] getBoxes(IBlockAccess access,BlockPos pos,IBlockState state){
  List<IdentifiableAABB<Part>> bbs=Lists.newArrayList();
  float min=CoreConstants.PIPE_MIN_POS;
  float max=CoreConstants.PIPE_MAX_POS;
  IdentifiableAABB<Part> base=new IdentifiableAABB<Part>(getPipeBoundingBox(null),Part.Pipe);
  bbs.add(base);
  TileEntity tile=access.getTileEntity(pos);
  if (tile instanceof TileGenericPipe) {
    TileGenericPipe pipe=(TileGenericPipe)tile;
    for (    EnumFacing face : EnumFacing.values()) {
      if (pipe.isPipeConnected(face)) {
        bbs.add(new IdentifiableAABB<Part>(getPipeBoundingBox(face),Part.Pipe));
      }
    }
    for (    EnumFacing face : EnumFacing.VALUES) {
      if (pipe.hasPipePluggable(face)) {
        bbs.add(new IdentifiableAABB<Part>(pipe.getPipePluggable(face).getBoundingBox(face),Part.Pluggable));
      }
    }
  }
  return bbs.toArray(new IdentifiableAABB[bbs.size()]);
}

Fixed version (ground truth):
@Override public AxisAlignedBB[] getBoxes(IBlockAccess access,BlockPos pos,IBlockState state){
  List<IdentifiableAABB<Part>> bbs=Lists.newArrayList();
  IdentifiableAABB<Part> base=new IdentifiableAABB<>(getPipeBoundingBox(null),Part.Pipe);
  bbs.add(base);
  TileEntity tile=access.getTileEntity(pos);
  if (tile instanceof TileGenericPipe) {
    TileGenericPipe pipe=(TileGenericPipe)tile;
    for (    EnumFacing face : EnumFacing.values()) {
      if (pipe.isPipeConnected(face)) {
        bbs.add(new IdentifiableAABB<>(getPipeBoundingBox(face),Part.Pipe));
      }
    }
    for (    EnumFacing face : EnumFacing.VALUES) {
      if (pipe.hasPipePluggable(face)) {
        bbs.add(new IdentifiableAABB<>(pipe.getPipePluggable(face).getBoundingBox(face),Part.Pluggable));
      }
    }
  }
  return bbs.toArray(new IdentifiableAABB[bbs.size()]);
}
Program: 156486
Project: 156486
Buggy source:
public RaytraceResult doRayTrace(final World world,final BlockPos pos,final Vec3 origin,final Vec3 direction){
  Pipe<?> pipe=getPipe(world,pos);
  if (!isValid(pipe)) {
    return null;
  }
  TileGenericPipe tileG=pipe.container;
  if (tileG == null) {
    return null;
  }
  TraceTester tester=new TraceTester(world,pos,origin,direction);
  tester.test(getPipeBoundingBox(null),null);
  for (  EnumFacing face : EnumFacing.values()) {
    if (tileG.isPipeConnected(face)) {
      tester.test(getPipeBoundingBox(face),face);
    }
  }
  for (  EnumFacing face : EnumFacing.values()) {
    if (tileG.getPipePluggable(face) != null) {
      AxisAlignedBB aabb=tileG.getPipePluggable(face).getBoundingBox(face);
      IdentifiableAABB<Part> iaabb=new IdentifiableAABB<Part>(aabb,Part.Pluggable);
      tester.test(iaabb,face);
    }
  }
  setBlockBounds(0,0,0,1,1,1);
  if (tester.closestHit != null) {
    return new RaytraceResult(tester.closestHit,tester.closestBox,tester.closestSide,tester.closestSideHit);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public RaytraceResult doRayTrace(final World world,final BlockPos pos,final Vec3 origin,final Vec3 direction){
  Pipe<?> pipe=getPipe(world,pos);
  if (!isValid(pipe)) {
    return null;
  }
  TileGenericPipe tileG=pipe.container;
  if (tileG == null) {
    return null;
  }
  TraceTester tester=new TraceTester(world,pos,origin,direction);
  tester.test(getPipeBoundingBox(null),null);
  for (  EnumFacing face : EnumFacing.values()) {
    if (tileG.isPipeConnected(face)) {
      tester.test(getPipeBoundingBox(face),face);
    }
  }
  for (  EnumFacing face : EnumFacing.values()) {
    if (tileG.getPipePluggable(face) != null) {
      AxisAlignedBB aabb=tileG.getPipePluggable(face).getBoundingBox(face);
      IdentifiableAABB<Part> iaabb=new IdentifiableAABB<>(aabb,Part.Pluggable);
      tester.test(iaabb,face);
    }
  }
  setBlockBounds(0,0,0,1,1,1);
  if (tester.closestHit != null) {
    return new RaytraceResult(tester.closestHit,tester.closestBox,tester.closestSide,tester.closestSideHit);
  }
 else {
    return null;
  }
}