nus-yam/ex-repair huggingface dataset:
Program: 22806
Project: 22806
Buggy source:
public void HandleToolUsage(int Side,boolean Sneaking){
  if (Sneaking) {
    SideClosed[Side]=!SideClosed[Side];
  }
 else {
    Continuous=!Continuous;
  }
  Propagate();
}

Fixed version (ground truth):
public boolean HandleToolUsage(int Side,boolean Sneaking,EntityPlayer player){
  if (!requiresScrewdriverToOpen || (player.getHeldItem() != null && player.getHeldItem().getItem() == RiMItems.ToolItemSet)) {
    player.openGui(ModRiM.instance,0,worldObj,xCoord,yCoord,zCoord);
    return true;
  }
  return false;
}
Program: 22807
Project: 22807
Buggy source:
public void setAxis(int axis){
  axisOfRotationIndex=axis;
}

Fixed version (ground truth):
public void setAxis(int axis){
  pointedDir=Directions.validDirections()[axis];
}
Program: 22808
Project: 22808
Buggy source:
@Override public void EstablishSpectre(CarriagePackage Package){
  int CarriageX=Package.AnchorRecord.X;
  int CarriageY=Package.AnchorRecord.Y;
  int CarriageZ=Package.AnchorRecord.Z;
  WorldUtil.SetBlock(worldObj,CarriageX,CarriageY,CarriageZ,RIMBlocks.Spectre,BlockSpectre.Types.Rotative.ordinal());
  TileEntityRotativeSpectre theEntity=new TileEntityRotativeSpectre();
  theEntity.setAxis(axisOfRotationIndex);
  worldObj.setTileEntity(CarriageX,CarriageY,CarriageZ,theEntity);
  theEntity.Absorb(Package);
  worldObj.markBlockForUpdate(CarriageX,CarriageY,CarriageZ);
  worldObj.func_147451_t(CarriageX,CarriageY,CarriageZ);
}

Fixed version (ground truth):
@Override public void EstablishSpectre(CarriagePackage Package){
  int CarriageX=Package.AnchorRecord.X;
  int CarriageY=Package.AnchorRecord.Y;
  int CarriageZ=Package.AnchorRecord.Z;
  WorldUtil.SetBlock(worldObj,CarriageX,CarriageY,CarriageZ,RIMBlocks.Spectre,BlockSpectre.Types.Rotative.ordinal());
  TileEntityRotativeSpectre theEntity=new TileEntityRotativeSpectre();
  theEntity.setAxis(pointedDir.ordinal());
  worldObj.setTileEntity(CarriageX,CarriageY,CarriageZ,theEntity);
  theEntity.Absorb(Package);
  worldObj.markBlockForUpdate(CarriageX,CarriageY,CarriageZ);
  worldObj.func_147451_t(CarriageX,CarriageY,CarriageZ);
}
Program: 22809
Project: 22809
Buggy source:
@Override public IIcon getIcon(int side,int meta){
  try {
    if (drawSideClosed(side)) {
      return BlockCarriageDrive.InactiveIcon;
    }
 else {
      return icons[axisOfRotationIndex][side];
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    return Blocks.activator_rail.getIcon(0,0);
  }
}

Fixed version (ground truth):
@Override public IIcon getIcon(int side,int meta){
  try {
    if (drawSideClosed(side)) {
      return BlockCarriageDrive.InactiveIcon;
    }
 else {
      return icons[pointedDir.ordinal()][side];
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    return Blocks.activator_rail.getIcon(0,0);
  }
}
Program: 22810
Project: 22810
Buggy source:
@Override public CarriagePackage GeneratePackage(TileEntity carriage,Directions CarriageDirection,Directions MotionDirection) throws CarriageMotionException {
  if (!DirtyHacks.allowRotation) {
    throw new CarriageMotionException(Lang.translate(ModRiM.Handle + "String_Node_Str"));
  }
  CarriagePackage Package=new CarriagePackage(this,carriage,Directions.Null);
  Package.axis=axisOfRotationIndex;
  Package.blacklistByRotation=true;
  Package.AddBlock(Package.driveRecord);
  MultiTypeCarriageUtil.fillPackage(Package,carriage);
  Directions axis=Directions.values()[axisOfRotationIndex];
  BlockRecordSet dests=new BlockRecordSet();
  for (  BlockRecord record : Package.Body) {
    if ((record.X == xCoord || record.Y == yCoord || record.Z == zCoord)) {
      continue;
    }
    BlockRecord dest=RemIMRotator.simulateRotateOrthogonal(new BlockRecord(xCoord,yCoord,zCoord),axis,record);
    Package.AddPotentialObstruction(dest);
  }
  Package.Finalize();
  return (Package);
}

Fixed version (ground truth):
@Override public CarriagePackage GeneratePackage(TileEntity carriage,Directions CarriageDirection,Directions MotionDirection) throws CarriageMotionException {
  if (!DirtyHacks.allowRotation) {
    throw new CarriageMotionException(Lang.translate(ModRiM.Handle + "String_Node_Str"));
  }
  CarriagePackage Package=new CarriagePackage(this,carriage,Directions.Null);
  Package.axis=pointedDir.ordinal();
  Package.blacklistByRotation=true;
  MultiTypeCarriageUtil.fillPackage(Package,carriage);
  BlockRecordSet dests=new BlockRecordSet();
  for (  BlockRecord record : Package.Body) {
    if ((record.X == xCoord || record.Y == yCoord || record.Z == zCoord)) {
      continue;
    }
    BlockRecord dest=RemIMRotator.simulateRotateOrthogonal(new BlockRecord(xCoord,yCoord,zCoord),pointedDir,record);
    Package.AddPotentialObstruction(dest);
  }
  Package.Finalize();
  return (Package);
}
Program: 22811
Project: 22811
Buggy source:
@Override public void updateEntity(){
  if (!(CarriageDirection != null && (CarriageDirection.ordinal() == axisOfRotationIndex || CarriageDirection.oppositeOrdinal == axisOfRotationIndex))) {
    CarriageDirection=null;
  }
  super.updateEntity();
}

Fixed version (ground truth):
@Override public void updateEntity(){
  if (!(CarriageDirection != null && (CarriageDirection == pointedDir || CarriageDirection.oppositeOrdinal == pointedDir.ordinal()))) {
    CarriageDirection=null;
  }
  super.updateEntity();
}
Program: 22812
Project: 22812
Buggy source:
@Override public void rotateSpecial(ForgeDirection axis){
  super.rotateSpecial(axis);
  axisOfRotationIndex=Rotator.newSide(axisOfRotationIndex,axis);
}

Fixed version (ground truth):
@Override public void rotateSpecial(ForgeDirection axis){
  super.rotateSpecial(axis);
  pointedDir=Directions.values()[Rotator.newSide(pointedDir.ordinal(),axis)];
}
Program: 22813
Project: 22813
Buggy source:
public void setConfiguration(long flags,EntityPlayerMP changer){
  super.setConfiguration(flags,changer);
  flags=flags >> 3;
  Label=(int)(flags & 0xFFFFl);
  if ((flags & (1 << (Buttons.PRIVATE.ordinal() + 3))) != 0) {
    Player=changer.getDisplayName();
  }
 else {
    Player="String_Node_Str";
  }
}

Fixed version (ground truth):
public void setConfiguration(long flags,EntityPlayerMP changer){
  unregisterLabel();
  super.setConfiguration(flags,changer);
  flags=flags >> 3;
  Label=(int)(flags & 0xFFFFl);
  if ((flags & (1 << (Buttons.PRIVATE.ordinal() + 3))) != 0) {
    Player=changer.getDisplayName();
  }
 else {
    Player="String_Node_Str";
  }
  registerLabel();
}
Program: 22815
Project: 22815
Buggy source:
@Override public void updateEntity(){
  worldObj.theProfiler.startSection("String_Node_Str");
  ticksExisted++;
  for (  CapturedEntity Entity : CapturedEntities) {
    worldObj.theProfiler.startSection("String_Node_Str");
    Entity.Update();
    worldObj.theProfiler.endSection();
  }
  if (worldObj.isRemote) {
    return;
  }
  if (ticksExisted > 0 && ticksExisted < RiMConfiguration.CarriageMotion.MotionDuration && ticksExisted % 20 == 0) {
    if (bodyHasCarriageDrive()) {
      ModRiM.plHelper.playSound(worldObj,xCoord,yCoord,zCoord,CarriageMotion.SoundFile,CarriageMotion.volume,1f);
    }
  }
  if (ticksExisted < RiMConfiguration.CarriageMotion.MotionDuration) {
    return;
  }
  worldObj.theProfiler.startSection("String_Node_Str");
  Release();
  worldObj.theProfiler.endSection();
  worldObj.theProfiler.endSection();
}

Fixed version (ground truth):
@Override public void updateEntity(){
  worldObj.theProfiler.startSection("String_Node_Str");
  ticksExisted++;
  for (  CapturedEntity Entity : CapturedEntities) {
    worldObj.theProfiler.startSection("String_Node_Str");
    Entity.Update();
    worldObj.theProfiler.endSection();
  }
  if (worldObj.isRemote) {
    worldObj.theProfiler.endSection();
    return;
  }
  if (ticksExisted > 0 && ticksExisted < RiMConfiguration.CarriageMotion.MotionDuration && ticksExisted % 20 == 0) {
    if (bodyHasCarriageDrive()) {
      ModRiM.plHelper.playSound(worldObj,xCoord,yCoord,zCoord,CarriageMotion.SoundFile,CarriageMotion.volume,1f);
    }
  }
  if (ticksExisted < RiMConfiguration.CarriageMotion.MotionDuration) {
    worldObj.theProfiler.endSection();
    return;
  }
  worldObj.theProfiler.startSection("String_Node_Str");
  Release();
  worldObj.theProfiler.endSection();
  worldObj.theProfiler.endSection();
}
Program: 22817
Project: 22817
Buggy source:
@Override public void Setup(EntityPlayer Player,ItemStack Item){
  super.Setup(Player,Item);
  int l=BlockPistonBase.determineOrientation(Player.worldObj,xCoord,yCoord,zCoord,Player);
  pointedDir=Directions.values()[l];
}

Fixed version (ground truth):
@Override public void Setup(EntityPlayer Player,ItemStack Item){
  super.Setup(Player,Item);
  int l=BlockPistonBase.determineOrientation(Player.worldObj,xCoord,yCoord,zCoord,Player);
  pointedDir=Directions.values()[l].opposite();
}
Program: 22818
Project: 22818
Buggy source:
@SubscribeEvent public void onJoin(PlayerEvent.PlayerLoggedInEvent event){
  PacketSpecterVelocity.Dispatch((EntityPlayerMP)event.player);
}

Fixed version (ground truth):
@SubscribeEvent public void onJoin(PlayerEvent.PlayerLoggedInEvent event){
  if (!(event.player instanceof EntityPlayerMP))   return;
  if (((EntityPlayerMP)event.player).isClientWorld())   PacketSpecterVelocity.Dispatch((EntityPlayerMP)event.player);
}
Program: 22819
Project: 22819
Buggy source:
public void EstablishPlaceholders(CarriagePackage Package){
  BlockRecordSet temp=new BlockRecordSet();
  if (Package.MotionDirection != null) {
    for (    BlockRecord Record : Package.Body) {
      BlockRecord temp2=Record.NextInDirection(Package.MotionDirection);
      temp2.block=Record.block;
      temp.add(temp2);
    }
  }
 else {
    temp=Package.Body;
  }
  for (  BlockRecord Record : temp) {
    SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,RIMBlocks.Spectre,BlockSpectre.Types.Supportive.ordinal());
    if (Package.MotionDirection != null) {
      worldObj.setTileEntity(Record.X,Record.Y,Record.Z,new TileEntitySupportiveSpectre());
      if (Record.block instanceof BlockCamouflageable) {
        if (Record.entityRecord != null) {
          Block b2=Block.getBlockById(Record.entityRecord.getInteger("String_Node_Str"));
          if (b2 != null) {
            ((TileEntitySupportiveSpectre)worldObj.getTileEntity(Record.X,Record.Y,Record.Z)).setLight(b2);
          }
        }
      }
 else {
        ((TileEntitySupportiveSpectre)worldObj.getTileEntity(Record.X,Record.Y,Record.Z)).setLight(Record.block);
      }
    }
  }
  for (  BlockRecord Record : Package.Body) {
    if (temp.contains(Record))     continue;
    SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,RIMBlocks.air,0);
  }
}

Fixed version (ground truth):
public void EstablishPlaceholders(CarriagePackage Package){
  BlockRecordSet temp=new BlockRecordSet();
  if (Package.MotionDirection != null) {
    for (    BlockRecord Record : Package.Body) {
      BlockRecord temp2=Record.NextInDirection(Package.MotionDirection);
      temp2.block=Record.block;
      temp.add(temp2);
    }
  }
 else {
    temp=Package.Body;
  }
  for (  BlockRecord Record : temp) {
    SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,Blocks.air,0);
  }
  for (  BlockRecord Record : temp) {
    worldObj.setBlock(Record.X,Record.Y,Record.Z,RIMBlocks.Spectre,BlockSpectre.Types.Supportive.ordinal(),3);
    if (Package.MotionDirection != null && Package.MotionDirection.ordinal() != ForgeDirection.UNKNOWN.ordinal()) {
      worldObj.setTileEntity(Record.X,Record.Y,Record.Z,new TileEntitySupportiveSpectre());
      if (Record.block instanceof BlockCamouflageable) {
        if (Record.entityRecord != null) {
          Block b2=Block.getBlockById(Record.entityRecord.getInteger("String_Node_Str"));
          if (b2 != null) {
            ((TileEntitySupportiveSpectre)worldObj.getTileEntity(Record.X,Record.Y,Record.Z)).setLight(b2);
          }
        }
      }
 else {
        ((TileEntitySupportiveSpectre)worldObj.getTileEntity(Record.X,Record.Y,Record.Z)).setLight(Record.block);
      }
    }
  }
  for (  BlockRecord Record : Package.Body) {
    if (temp.contains(Record))     continue;
    SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,RIMBlocks.air,0);
  }
}
Program: 22820
Project: 22820
Buggy source:
public static void Dispatch(EntityPlayerMP Player){
  if (Player.worldObj.isRemote)   return;
  NBTTagCompound Packet=new NBTTagCompound();
  Packet.setInteger("String_Node_Str",RiMConfiguration.CarriageMotion.MotionDuration);
  PacketManager.SendPacketToPlayer(Player,PacketTypes.SpecterVelocity,Packet);
}

Fixed version (ground truth):
public static void Dispatch(EntityPlayerMP Player){
  NBTTagCompound Packet=new NBTTagCompound();
  Packet.setInteger("String_Node_Str",RiMConfiguration.CarriageMotion.MotionDuration);
  PacketManager.SendPacketToPlayer(Player,PacketTypes.SpecterVelocity,Packet);
}
Program: 22821
Project: 22821
Buggy source:
@Override public void fillPackage(CarriagePackage Package) throws CarriageMotionException {
  if (Pattern == null) {
    updatePattern();
  }
  Package.AddBlock(Package.AnchorRecord);
  if (Package.MotionDirection != null) {
    Package.AddPotentialObstruction(Package.AnchorRecord.NextInDirection(Package.MotionDirection));
  }
  for (  BlockRecord PatternBlock : Pattern) {
    BlockRecord Record=new BlockRecord(PatternBlock.X + xCoord,PatternBlock.Y + yCoord,PatternBlock.Z + zCoord);
    if (worldObj.isAirBlock(Record.X,Record.Y,Record.Z)) {
      continue;
    }
    Record.Identify(worldObj);
    Package.AddBlock(Record);
    if (Package.MotionDirection != null) {
      Package.AddPotentialObstruction(Record.NextInDirection(Package.MotionDirection));
    }
  }
}

Fixed version (ground truth):
@Override public void fillPackage(CarriagePackage cPackage) throws CarriageMotionException {
  if (Pattern == null) {
    updatePattern();
  }
  cPackage.AddBlock(cPackage.AnchorRecord);
  if (cPackage.MotionDirection != null) {
    cPackage.AddPotentialObstruction(cPackage.AnchorRecord.NextInDirection(cPackage.MotionDirection));
  }
  for (  BlockRecord PatternBlock : Pattern) {
    BlockRecord Record=new BlockRecord(PatternBlock.X + xCoord,PatternBlock.Y + yCoord,PatternBlock.Z + zCoord);
    if (worldObj.isAirBlock(Record.X,Record.Y,Record.Z)) {
      continue;
    }
    Record.Identify(worldObj);
    cPackage.AddBlock(Record);
    if (cPackage.MotionDirection != null) {
      cPackage.AddPotentialObstruction(Record.NextInDirection(cPackage.MotionDirection));
    }
  }
}
Program: 22823
Project: 22823
Buggy source:
public void AssertNotObstruction(BlockRecord Record) throws CarriageMotionException {
  if (Body.contains(Record)) {
    return;
  }
  if (World.isAirBlock(Record.X,Record.Y,Record.Z)) {
    return;
  }
  if (World.getBlock(Record.X,Record.Y,Record.Z).getMaterial().isLiquid()) {
    if (ObstructedByLiquids) {
      FailBecauseObstructed(Record,"String_Node_Str");
    }
    return;
  }
  if (World.getBlock(Record.X,Record.Y,Record.Z).canBeReplacedByLeaves(World,Record.X,Record.Y,Record.Z)) {
    if (ObstructedByFragileBlocks) {
      FailBecauseObstructed(Record,"String_Node_Str");
    }
    return;
  }
  FailBecauseObstructed(Record,"String_Node_Str");
}

Fixed version (ground truth):
public void AssertNotObstruction(BlockRecord record) throws CarriageMotionException {
  if (Body.contains(record)) {
    return;
  }
  if (World.isAirBlock(record.X,record.Y,record.Z))   return;
  Block block=World.getBlock(record.X,record.Y,record.Z);
  if (block != null) {
    if (!ObstructedByLiquids && (FluidRegistry.lookupFluidForBlock(block) != null)) {
      return;
    }
 else     if (ObstructedByLiquids && (FluidRegistry.lookupFluidForBlock(block) != null)) {
      FailBecauseObstructed(record,"String_Node_Str");
    }
    if (!ObstructedByFragileBlocks && block.getMaterial().isReplaceable()) {
      return;
    }
 else     if (ObstructedByFragileBlocks && block.getMaterial().isReplaceable()) {
      FailBecauseObstructed(record,"String_Node_Str");
    }
    FailBecauseObstructed(record,"String_Node_Str");
  }
}
Program: 22824
Project: 22824
Buggy source:
@Override public void Setup(EntityPlayer Player,ItemStack Item){
  Decoration=ItemCarriage.GetDecorationId(Item);
  DecorationMeta=ItemCarriage.GetDecorationMeta(Item);
}

Fixed version (ground truth):
@Override public void Setup(EntityPlayer Player,ItemStack Item){
  Decoration=ItemCarriage.GetDecorationBlock(Item);
  DecorationMeta=ItemCarriage.GetDecorationMeta(Item);
}
Program: 22825
Project: 22825
Buggy source:
@Override public IIcon getIcon(IBlockAccess World,int X,int Y,int Z,int Side){
  try {
    TileEntityCarriage Carriage=(TileEntityCarriage)World.getTileEntity(X,Y,Z);
    if ((Carriage.Decoration != null) && (Carriage.SideClosed[Side])) {
      return (Carriage.Decoration.getIcon(Side,Carriage.DecorationMeta));
    }
    Types Type=Types.values()[World.getBlockMetadata(X,Y,Z)];
    return (Carriage.SideClosed[Side] ? Type.ClosedIcon : Type.OpenIcon);
  }
 catch (  Throwable t) {
    t.printStackTrace();
    return (RIMBlocks.Spectre.getIcon(0,0));
  }
}

Fixed version (ground truth):
@Override public IIcon getIcon(IBlockAccess world,int X,int Y,int Z,int Side){
  try {
    TileEntityCarriage carriage=(TileEntityCarriage)world.getTileEntity(X,Y,Z);
    if ((carriage.Decoration != null) && (carriage.SideClosed[Side])) {
      return (carriage.Decoration.getIcon(Side,carriage.DecorationMeta));
    }
    Types type=Types.values()[world.getBlockMetadata(X,Y,Z)];
    return (carriage.SideClosed[Side] ? type.ClosedIcon : type.OpenIcon);
  }
 catch (  Throwable t) {
    t.printStackTrace();
    return (RIMBlocks.Spectre.getIcon(world,X,Y,Z,Side));
  }
}
Program: 22826
Project: 22826
Buggy source:
public static int GetDecorationMeta(ItemStack Item){
  if (Item.stackTagCompound != null) {
    return (Item.stackTagCompound.getInteger("String_Node_Str"));
  }
  return ((Item.getItemDamage() >>> 4) & 0xF);
}

Fixed version (ground truth):
public static int GetDecorationMeta(ItemStack Item){
  if (Item.stackTagCompound != null) {
    return (Item.stackTagCompound.getInteger("String_Node_Str"));
  }
  return Item.getItemDamage();
}
Program: 22827
Project: 22827
Buggy source:
@Override public void AddTooltip(ItemStack Item,List TooltipLines){
  if (RiMConfiguration.Cosmetic.ShowHelpInTooltips) {
    try {
      for (      String s : Lang.translate(ModRiM.Handle + "String_Node_Str" + GetBlockType(Item)).split("String_Node_Str")) {
        TooltipLines.add(s);
      }
    }
 catch (    Throwable Throwable) {
      Throwable.printStackTrace();
      return;
    }
  }
  Block DecorationId=GetDecorationId(Item);
  if (DecorationId == Blocks.air) {
    return;
  }
  if (Item.stackTagCompound == null) {
    TooltipLines.add(Arrays.asList(Lang.translate(ModRiM.Handle + "String_Node_Str").split("String_Node_Str")));
  }
  ItemStack Decoration=Stack.New(DecorationId,GetDecorationMeta(Item));
  try {
    TooltipLines.add(Lang.translate(ModRiM.Handle + "String_Node_Str") + Decoration.getItem().getItemStackDisplayName(Decoration));
  }
 catch (  Throwable Throwable) {
    Throwable.printStackTrace();
    TooltipLines.add(Lang.translate(ModRiM.Handle + "String_Node_Str") + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void AddTooltip(ItemStack Item,List TooltipLines){
  if (RiMConfiguration.Cosmetic.ShowHelpInTooltips) {
    try {
      for (      String s : Lang.translate(ModRiM.Handle + "String_Node_Str" + GetBlockType(Item)).split("String_Node_Str")) {
        TooltipLines.add(s);
      }
    }
 catch (    Throwable Throwable) {
      Throwable.printStackTrace();
      return;
    }
  }
  Block DecorationId=GetDecorationBlock(Item);
  if (DecorationId == Blocks.air) {
    return;
  }
  if (Item.stackTagCompound == null) {
    TooltipLines.add(Arrays.asList(Lang.translate(ModRiM.Handle + "String_Node_Str").split("String_Node_Str")));
  }
  ItemStack Decoration=Stack.New(DecorationId,GetDecorationMeta(Item));
  try {
    TooltipLines.add(Lang.translate(ModRiM.Handle + "String_Node_Str") + Decoration.getItem().getItemStackDisplayName(Decoration));
  }
 catch (  Throwable Throwable) {
    Throwable.printStackTrace();
    TooltipLines.add(Lang.translate(ModRiM.Handle + "String_Node_Str") + "String_Node_Str");
  }
}
Program: 22828
Project: 22828
Buggy source:
public int Integer(String Name,int Default){
  return (Configuration.get(Category,Name,Default).getInt(Default));
}

Fixed version (ground truth):
public int Integer(String Name,String comment,int Default){
  Property a=Configuration.get(Category,Name,Default);
  a.comment=comment;
  return a.getInt(Default);
}
Program: 22829
Project: 22829
Buggy source:
public int BoundedInteger(String Name,int Min,int Default,int Max){
  int Value=Integer(Name,Default);
  if (Value < Min) {
    new RuntimeException(Name + "String_Node_Str" + Min).printStackTrace();
    return (Default);
  }
  if (Value > Max) {
    new RuntimeException(Name + "String_Node_Str" + Max).printStackTrace();
    return (Default);
  }
  return (Value);
}

Fixed version (ground truth):
public int BoundedInteger(String Name,String comment,int Min,int Default,int Max){
  int Value=Integer(Name,comment,Default);
  if (Value < Min) {
    new RuntimeException(Name + "String_Node_Str" + Min).printStackTrace();
    return (Default);
  }
  if (Value > Max) {
    new RuntimeException(Name + "String_Node_Str" + Max).printStackTrace();
    return (Default);
  }
  return (Value);
}
Program: 22830
Project: 22830
Buggy source:
public String String(String Name,String Default){
  return (Configuration.get(Category,Name,Default).getString());
}

Fixed version (ground truth):
public String String(String Name,String comment,String Default){
  Property a=Configuration.get(Category,Name,Default);
  a.comment=comment;
  return a.getString();
}
Program: 22831
Project: 22831
Buggy source:
public boolean Boolean(String Name,boolean Default){
  return (Configuration.get(Category,Name,Default).getBoolean(Default));
}

Fixed version (ground truth):
public boolean Boolean(String Name,String comment,boolean Default){
  Property a=Configuration.get(Category,Name,Default);
  a.comment=comment;
  return a.getBoolean(Default);
}
Program: 22832
Project: 22832
Buggy source:
public BlockRiM(Block Template,Class<? extends ItemBlockRiM> BlockItemClass,String HarvestToolType,Class<? extends TileEntityRiM>... TileEntityClasses){
  this(Template,BlockItemClass,TileEntityClasses);
  setCreativeTab(CreativeTab.Instance);
}

Fixed version (ground truth):
public BlockRiM(Block Template,Class<? extends ItemBlockRiM> BlockItemClass,Class<? extends TileEntityRiM>... TileEntityList){
  super(Template.getMaterial());
  TileEntityClasses=TileEntityList;
  setBlockName(ModRiM.Handle + "String_Node_Str" + getClass().getSimpleName().substring(5,getClass().getSimpleName().length()));
  setHardness(Template.getBlockHardness(null,0,0,0));
  setStepSound(Template.stepSound);
  GameRegistry.registerBlock(this,BlockItemClass,getUnlocalizedName());
  this.setCreativeTab(CreativeTab.Instance);
}
Program: 22833
Project: 22833
Buggy source:
public BlockCarriage(){
  super(Blocks.planks,ItemCarriage.class,HarvestToolTypes.Hatchet,TileEntityFrameCarriage.class,TileEntitySupportCarriage.class,TileEntityStructureCarriage.class,TileEntityPlatformCarriage.class,TileEntityTemplateCarriage.class);
}

Fixed version (ground truth):
public BlockCarriage(){
  super(Blocks.planks,ItemCarriage.class,TileEntityFrameCarriage.class,TileEntitySupportCarriage.class,TileEntityStructureCarriage.class,TileEntityPlatformCarriage.class,TileEntityTemplateCarriage.class);
  this.setHarvestLevel(HarvestToolTypes.Hatchet,0);
}
Program: 22834
Project: 22834
Buggy source:
public static boolean isAWrench(ItemStack stk){
  for (  Class c : wrenchClasses) {
    if (stk != null && stk.getItem() != null && stk.getItem().getClass().isAssignableFrom(c)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isAWrench(ItemStack stk){
  for (  Class c : wrenchClasses) {
    if (stk != null && stk.getItem() != null && (stk.getItem().getClass().isAssignableFrom(c) || c.isInstance(stk.getItem()))) {
      return true;
    }
  }
  return false;
}
Program: 22835
Project: 22835
Buggy source:
public static void Initialize(){
  Carriage=new BlockCarriage();
  CarriageDrive=new BlockCarriageDrive();
  Spectre=new BlockSpectre();
}

Fixed version (ground truth):
public static void Initialize(){
  BlockRiM.initLegacyClassMap();
  Carriage=new BlockCarriage();
  CarriageDrive=new BlockCarriageDrive();
  Spectre=new BlockSpectre();
}
Program: 22836
Project: 22836
Buggy source:
public BlockCarriageDrive(){
  super(Blocks.iron_block,ItemCarriageDrive.class,HarvestToolTypes.Pickaxe,TileEntityCarriageEngine.class,TileEntityCarriageMotor.class,TileEntityCarriageController.class,TileEntityCarriageTranslocator.class,TileEntityCarriageTransduplicator.class,TileEntityCarriageAdapter.class,TileEntityCarriageRotator.class);
}

Fixed version (ground truth):
public BlockCarriageDrive(){
  super(Blocks.iron_block,ItemCarriageDrive.class,TileEntityCarriageEngine.class,TileEntityCarriageMotor.class,TileEntityCarriageController.class,TileEntityCarriageTranslocator.class,TileEntityCarriageTransduplicator.class,TileEntityCarriageAdapter.class,TileEntityCarriageRotator.class);
  this.setHarvestLevel(HarvestToolTypes.Pickaxe,0);
}
Program: 22837
Project: 22837
Buggy source:
@SideOnly(Side.CLIENT) public IIcon getIcon(int Side,int meta){
  try {
    if (SideClosed[Side]) {
      return (CarriageDrive.InactiveIcon);
    }
    Types Type=Types.values()[meta];
    if (Continuous) {
      return (Active ? Type.ContinuousActiveIcon : Type.ContinuousIcon);
    }
    return (Active ? Type.NormalActiveIcon : Type.NormalIcon);
  }
 catch (  Throwable Throwable) {
    return (Blocks.iron_block.getIcon(0,0));
  }
}

Fixed version (ground truth):
public IIcon getIcon(int Side,int meta){
  try {
    if (SideClosed[Side]) {
      return (CarriageDrive.InactiveIcon);
    }
    Types Type=Types.values()[meta];
    if (Continuous) {
      return (Active ? Type.ContinuousActiveIcon : Type.ContinuousIcon);
    }
    return (Active ? Type.NormalActiveIcon : Type.NormalIcon);
  }
 catch (  Throwable Throwable) {
    return (Blocks.iron_block.getIcon(0,0));
  }
}
Program: 22838
Project: 22838
Buggy source:
@Override public Packet getDescriptionPacket(){
  S35PacketUpdateTileEntity Packet=new S35PacketUpdateTileEntity(xCoord,yCoord,zCoord,0,new net.minecraft.nbt.NBTTagCompound());
  WriteCommonRecord(Packet.func_148857_g());
  WriteClientRecord(Packet.func_148857_g());
  return (Packet);
}

Fixed version (ground truth):
@Override public Packet getDescriptionPacket(){
  NBTTagCompound tag=new NBTTagCompound();
  this.writeToNBT(tag);
  return new S35PacketUpdateTileEntity(xCoord,yCoord,zCoord,1,tag);
}
Program: 22840
Project: 22840
Buggy source:
public void AssertNotObstruction(BlockRecord Record) throws CarriageMotionException {
  Debug.dbg("String_Node_Str");
  if (Body.contains(Record)) {
    return;
  }
  if (World.isAirBlock(Record.X,Record.Y,Record.Z)) {
    return;
  }
  if (World.getBlock(Record.X,Record.Y,Record.Z).getMaterial().isLiquid()) {
    if (ObstructedByLiquids) {
      FailBecauseObstructed(Record,"String_Node_Str");
    }
    return;
  }
  if (!World.getBlock(Record.X,Record.Y,Record.Z).canBeReplacedByLeaves(World,Record.X,Record.Y,Record.Z)) {
    if (ObstructedByFragileBlocks) {
      FailBecauseObstructed(Record,"String_Node_Str");
    }
    return;
  }
  FailBecauseObstructed(Record,"String_Node_Str");
}

Fixed version (ground truth):
public void AssertNotObstruction(BlockRecord Record) throws CarriageMotionException {
  Debug.dbg("String_Node_Str" + Record);
  if (Body.contains(Record)) {
    Debug.dbg("String_Node_Str");
    return;
  }
  if (World.isAirBlock(Record.X,Record.Y,Record.Z)) {
    Debug.dbg("String_Node_Str");
    return;
  }
  if (World.getBlock(Record.X,Record.Y,Record.Z).getMaterial().isLiquid()) {
    Debug.dbg("String_Node_Str");
    if (ObstructedByLiquids) {
      FailBecauseObstructed(Record,"String_Node_Str");
    }
    return;
  }
  if (!World.getBlock(Record.X,Record.Y,Record.Z).canBeReplacedByLeaves(World,Record.X,Record.Y,Record.Z)) {
    Debug.dbg("String_Node_Str");
    if (ObstructedByFragileBlocks) {
      FailBecauseObstructed(Record,"String_Node_Str");
    }
    return;
  }
  Debug.dbg("String_Node_Str");
  FailBecauseObstructed(Record,"String_Node_Str");
}
Program: 22842
Project: 22842
Buggy source:
public void Release(){
  Debug.dbg("String_Node_Str");
  for (  BlockRecord Record : Body)   ShiftBlockPosition(Record);
  doRelease();
}

Fixed version (ground truth):
public void Release(){
  for (  BlockRecord Record : Body)   ShiftBlockPosition(Record);
  doRelease();
}
Program: 22843
Project: 22843
Buggy source:
@Override public void Render(net.minecraft.tileentity.TileEntity TileEntity,float PartialTick){
  MotiveSpectreEntity Spectre=(MotiveSpectreEntity)TileEntity;
  if (Spectre.RenderCacheKey == null) {
    return;
  }
{
    double Offset;
    if (Configuration.CarriageMotion.RenderInFinalPositionDuringLag && (Spectre.TicksExisted >= Configuration.CarriageMotion.MotionDuration)) {
      Offset=1;
    }
 else {
      Offset=Spectre.Velocity * (Spectre.TicksExisted + PartialTick);
    }
    Render.Translate(Offset * Spectre.MotionDirection.DeltaX - Spectre.xCoord,Offset * Spectre.MotionDirection.DeltaY - Spectre.yCoord,Offset * Spectre.MotionDirection.DeltaZ - Spectre.zCoord);
  }
  Integer DisplayList=CarriageRenderCache.Lookup(Spectre.RenderCacheKey);
  if (DisplayList != null) {
    Debug.dbg("String_Node_Str");
    Render.ResetBoundTexture();
    Render.ExecuteDisplayList(DisplayList);
    Render.ResetBoundTexture();
  }
}

Fixed version (ground truth):
@Override public void Render(net.minecraft.tileentity.TileEntity TileEntity,float PartialTick){
  MotiveSpectreEntity Spectre=(MotiveSpectreEntity)TileEntity;
  if (Spectre.RenderCacheKey == null) {
    return;
  }
{
    double Offset;
    if (Configuration.CarriageMotion.RenderInFinalPositionDuringLag && (Spectre.TicksExisted >= Configuration.CarriageMotion.MotionDuration)) {
      Offset=1;
    }
 else {
      Offset=Spectre.Velocity * (Spectre.TicksExisted + PartialTick);
    }
    Render.Translate(Offset * Spectre.MotionDirection.DeltaX - Spectre.xCoord,Offset * Spectre.MotionDirection.DeltaY - Spectre.yCoord,Offset * Spectre.MotionDirection.DeltaZ - Spectre.zCoord);
  }
  Integer DisplayList=CarriageRenderCache.Lookup(Spectre.RenderCacheKey);
  if (DisplayList != null) {
    Render.ResetBoundTexture();
    Render.ExecuteDisplayList(DisplayList);
    Render.ResetBoundTexture();
  }
}
Program: 22844
Project: 22844
Buggy source:
@Override public CarriagePackage GeneratePackage(TileEntity carriage,Directions CarriageDirection,Directions MotionDirection) throws CarriageMotionException {
  if (MotionDirection == CarriageDirection) {
    throw (new CarriageMotionException("String_Node_Str"));
  }
  if (MotionDirection == CarriageDirection.Opposite()) {
    throw (new CarriageMotionException("String_Node_Str"));
  }
  CarriagePackage Package=new CarriagePackage(this,carriage,MotionDirection);
  MultiTypeCarriageUtil.fillPackage(Package,carriage);
  if (Package.Body.contains(Package.DriveRecord)) {
    throw (new CarriageMotionException("String_Node_Str"));
  }
  if (Package.Body.contains(Package.DriveRecord.NextInDirection(MotionDirection.Opposite()))) {
    throw (new CarriageObstructionException("String_Node_Str",xCoord,yCoord,zCoord));
  }
  Package.Finalize();
  return (Package);
}

Fixed version (ground truth):
@Override public CarriagePackage GeneratePackage(TileEntity carriage,Directions CarriageDirection,Directions MotionDirection) throws CarriageMotionException {
  if (MotionDirection == CarriageDirection) {
    throw (new CarriageMotionException("String_Node_Str"));
  }
  if (MotionDirection == CarriageDirection.Opposite()) {
    throw (new CarriageMotionException("String_Node_Str"));
  }
  CarriagePackage Package=new CarriagePackage(this,carriage,MotionDirection);
  MultiTypeCarriageUtil.fillPackage(Package,carriage);
  if (Package.Body.contains(Package.DriveRecord)) {
    throw (new CarriageMotionException("String_Node_Str"));
  }
  if (Package.Body.contains(Package.DriveRecord.NextInDirection(MotionDirection.Opposite()))) {
    throw (new CarriageObstructionException("String_Node_Str",xCoord,yCoord,zCoord));
  }
  Debug.dbg("String_Node_Str");
  Package.Finalize();
  return (Package);
}
Program: 22845
Project: 22845
Buggy source:
public static void dbg(Object o){
  if (Configuration.Debug.verbose)   log.debug(m,o);
}

Fixed version (ground truth):
public static void dbg(Object o){
  StackTraceElement[] trace=Thread.currentThread().getStackTrace();
  System.out.println(trace[2] + "String_Node_Str" + o);
}
Program: 22846
Project: 22846
Buggy source:
public ReflectionObfuscated(){
  Debug.dbg("String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public ReflectionObfuscated(){
  Debug.dbg("String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
  map("String_Node_Str","String_Node_Str");
}
Program: 22847
Project: 22847
Buggy source:
public Carriage(){
  super(Configuration.BlockIds.Carriage,wood,CarriageItem.class,HarvestToolTypes.Hatchet,FrameCarriageEntity.class,PlatformCarriageEntity.class,StructureCarriageEntity.class,SupportCarriageEntity.class,TemplateCarriageEntity.class);
}

Fixed version (ground truth):
public Carriage(){
  super((net.minecraft.block.Block)Block.blockRegistry.getObject("String_Node_Str"),CarriageItem.class,HarvestToolTypes.Hatchet,FrameCarriageEntity.class,PlatformCarriageEntity.class,StructureCarriageEntity.class,SupportCarriageEntity.class,TemplateCarriageEntity.class);
}
Program: 22848
Project: 22848
Buggy source:
@Override public IIcon getIcon(int Side,int Meta){
  try {
    return (Types.values()[Meta].OpenIcon);
  }
 catch (  Throwable Throwable) {
    Throwable.printStackTrace();
    return (Blocks.Spectre.getIcon(0,0));
  }
}

Fixed version (ground truth):
@Override public IIcon getIcon(net.minecraft.world.IBlockAccess World,int X,int Y,int Z,int Side){
  try {
    CarriageEntity Carriage=(CarriageEntity)World.getTileEntity(X,Y,Z);
    if ((Carriage.decorationId != null) && (Carriage.SideClosed[Side])) {
      return (Carriage.decorationId.getIcon(Side,Carriage.DecorationMeta));
    }
    Types Type=Types.values()[World.getBlockMetadata(X,Y,Z)];
    return (Carriage.SideClosed[Side] ? Type.ClosedIcon : Type.OpenIcon);
  }
 catch (  Throwable Throwable) {
    Throwable.printStackTrace();
    return (Blocks.Spectre.getIcon(0,0));
  }
}
Program: 22849
Project: 22849
Buggy source:
@Override public IIcon getIcon(int Side,int Meta){
  try {
    return (Types.values()[Meta].NormalIcon);
  }
 catch (  Throwable Throwable) {
    return (Blocks.Spectre.getIcon(0,0));
  }
}

Fixed version (ground truth):
@Override public IIcon getIcon(net.minecraft.world.IBlockAccess World,int X,int Y,int Z,int Side){
  try {
    CarriageDriveEntity Drive=(CarriageDriveEntity)World.getTileEntity(X,Y,Z);
    if (Drive.SideClosed[Side]) {
      return (InactiveIcon);
    }
    Types Type=Types.values()[World.getBlockMetadata(X,Y,Z)];
    if (Drive.Continuous) {
      return (Drive.Active ? Type.ContinuousActiveIcon : Type.ContinuousIcon);
    }
    return (Drive.Active ? Type.NormalActiveIcon : Type.NormalIcon);
  }
 catch (  Throwable Throwable) {
    Throwable.printStackTrace();
    return (Blocks.Spectre.getIcon(0,0));
  }
}
Program: 22850
Project: 22850
Buggy source:
public void HandleNeighbourBlockChange(){
  Stale=false;
  CarriageDirection=null;
  boolean CarriageDirectionValid=true;
  SignalDirection=null;
  boolean SignalDirectionValid=true;
  for (  Directions Direction : Directions.values()) {
    int X=xCoord + Direction.DeltaX;
    int Y=yCoord + Direction.DeltaY;
    int Z=zCoord + Direction.DeltaZ;
    if (worldObj.isAirBlock(X,Y,Z)) {
      continue;
    }
    int Id=worldObj.getBlockId(X,Y,Z);
    if (Id == Blocks.Carriage.blockID) {
      if (SideClosed[Direction.ordinal()]) {
        continue;
      }
      if (CarriageDirection != null) {
        CarriageDirectionValid=false;
      }
 else {
        CarriageDirection=Direction;
      }
    }
 else     if (net.minecraft.block.Block.blocksList[Id].isProvidingWeakPower(worldObj,X,Y,Z,Direction.ordinal()) > 0) {
      if (SignalDirection != null) {
        SignalDirectionValid=false;
      }
 else {
        SignalDirection=Direction;
      }
    }
  }
  if (!CarriageDirectionValid) {
    CarriageDirection=null;
  }
  if (!SignalDirectionValid) {
    SignalDirection=null;
  }
}

Fixed version (ground truth):
public void HandleNeighbourBlockChange(){
  Stale=false;
  CarriageDirection=null;
  boolean CarriageDirectionValid=true;
  SignalDirection=null;
  boolean SignalDirectionValid=true;
  for (  Directions Direction : Directions.values()) {
    int X=xCoord + Direction.DeltaX;
    int Y=yCoord + Direction.DeltaY;
    int Z=zCoord + Direction.DeltaZ;
    if (worldObj.isAirBlock(X,Y,Z)) {
      continue;
    }
    Block Id=(net.minecraft.block.Block)worldObj.getBlock(X,Y,Z);
    if (Id == Blocks.Carriage) {
      if (SideClosed[Direction.ordinal()]) {
        continue;
      }
      if (CarriageDirection != null) {
        CarriageDirectionValid=false;
      }
 else {
        CarriageDirection=Direction;
      }
    }
 else     if (Id.isProvidingWeakPower(worldObj,X,Y,Z,Direction.ordinal()) > 0) {
      if (SignalDirection != null) {
        SignalDirectionValid=false;
      }
 else {
        SignalDirection=Direction;
      }
    }
  }
  if (!CarriageDirectionValid) {
    CarriageDirection=null;
  }
  if (!SignalDirectionValid) {
    SignalDirection=null;
  }
}
Program: 22851
Project: 22851
Buggy source:
@Override public void updateEntity(){
  if (worldObj.isRemote) {
    return;
  }
  if (Stale) {
    HandleNeighbourBlockChange();
  }
  if (CooldownRemaining > 0) {
    CooldownRemaining--;
    MarkServerRecordDirty();
    return;
  }
  if (Active) {
    return;
  }
  if (SignalDirection == null) {
    if (Signalled) {
      Signalled=false;
      MarkServerRecordDirty();
    }
    return;
  }
  if (CarriageDirection == null) {
    return;
  }
  if (Signalled) {
    if (!Continuous) {
      return;
    }
  }
 else {
    Signalled=true;
    MarkServerRecordDirty();
  }
  try {
    InitiateMotion(PreparePackage(SignalDirection.Opposite()));
  }
 catch (  CarriageMotionException Exception) {
    String Message="String_Node_Str" + xCoord + "String_Node_Str"+ yCoord+ "String_Node_Str"+ zCoord+ "String_Node_Str"+ worldObj.provider.dimensionId+ "String_Node_Str"+ Exception.getMessage();
    if (Exception instanceof CarriageObstructionException) {
      CarriageObstructionException ObstructionException=(CarriageObstructionException)Exception;
      Message+="String_Node_Str" + ObstructionException.X + "String_Node_Str"+ ObstructionException.Y+ "String_Node_Str"+ ObstructionException.Z+ "String_Node_Str";
    }
    if (Configuration.Debug.LogMotionExceptions) {
      Debug.Emit(Message);
    }
    if (this.lastUsingPlayer != null) {
      ChatMessageComponent chatMessage=new ChatMessageComponent();
      chatMessage.addText(Message);
      this.lastUsingPlayer.sendChatToPlayer(chatMessage);
    }
  }
}

Fixed version (ground truth):
@Override public void updateEntity(){
  if (worldObj.isRemote) {
    return;
  }
  if (Stale) {
    HandleNeighbourBlockChange();
  }
  if (CooldownRemaining > 0) {
    CooldownRemaining--;
    MarkServerRecordDirty();
    return;
  }
  if (Active) {
    return;
  }
  if (SignalDirection == null) {
    if (Signalled) {
      Signalled=false;
      MarkServerRecordDirty();
    }
    return;
  }
  if (CarriageDirection == null) {
    return;
  }
  if (Signalled) {
    if (!Continuous) {
      return;
    }
  }
 else {
    Signalled=true;
    MarkServerRecordDirty();
  }
  try {
    InitiateMotion(PreparePackage(SignalDirection.Opposite()));
  }
 catch (  CarriageMotionException Exception) {
    String Message="String_Node_Str" + xCoord + "String_Node_Str"+ yCoord+ "String_Node_Str"+ zCoord+ "String_Node_Str"+ worldObj.provider.dimensionId+ "String_Node_Str"+ Exception.getMessage();
    if (Exception instanceof CarriageObstructionException) {
      CarriageObstructionException ObstructionException=(CarriageObstructionException)Exception;
      Message+="String_Node_Str" + ObstructionException.X + "String_Node_Str"+ ObstructionException.Y+ "String_Node_Str"+ ObstructionException.Z+ "String_Node_Str";
    }
    if (Configuration.Debug.LogMotionExceptions) {
      Debug.Emit(Message);
    }
    if (this.lastUsingPlayer != null) {
      IChatComponent chatMessage=new ChatComponentText(Message);
      this.lastUsingPlayer.addChatComponentMessage(chatMessage);
    }
  }
}
Program: 22852
Project: 22852
Buggy source:
public CarriagePackage PreparePackage(Directions MotionDirection) throws CarriageMotionException {
  CarriageEntity Carriage=(CarriageEntity)worldObj.getBlockTileEntity(xCoord + CarriageDirection.DeltaX,yCoord + CarriageDirection.DeltaY,zCoord + CarriageDirection.DeltaZ);
  CarriagePackage Package=GeneratePackage(Carriage,CarriageDirection,MotionDirection);
  if (Configuration.HardmodeActive) {
    int Type=worldObj.getBlockMetadata(xCoord,yCoord,zCoord);
{
      double MaxBurden=CarriageDrive.Types.values()[Type].MaxBurden * CarriageDrive.Tiers.values()[Tier].MaxBurdenFactor;
      if (Package.Mass > MaxBurden) {
        throw (new CarriageMotionException("String_Node_Str" + ((int)(Package.Mass - MaxBurden)) + "String_Node_Str"));
      }
    }
    double EnergyRequired=Package.Mass * CarriageDrive.Types.values()[Type].EnergyConsumption * CarriageDrive.Tiers.values()[Tier].EnergyConsumptionFactor;
    int powerConsumed=(int)Math.ceil(EnergyRequired * Configuration.PowerConsumptionFactor);
    if (powerConsumed > this.energyStored) {
      throw (new CarriageMotionException("String_Node_Str" + energyStored + "String_Node_Str"+ powerConsumed));
    }
 else {
      this.energyStored-=powerConsumed;
    }
  }
  return (Package);
}

Fixed version (ground truth):
public CarriagePackage PreparePackage(Directions MotionDirection) throws CarriageMotionException {
  CarriageEntity Carriage=(CarriageEntity)worldObj.getTileEntity(xCoord + CarriageDirection.DeltaX,yCoord + CarriageDirection.DeltaY,zCoord + CarriageDirection.DeltaZ);
  CarriagePackage Package=GeneratePackage(Carriage,CarriageDirection,MotionDirection);
  if (Configuration.HardmodeActive) {
    int Type=worldObj.getBlockMetadata(xCoord,yCoord,zCoord);
{
      double MaxBurden=CarriageDrive.Types.values()[Type].MaxBurden * CarriageDrive.Tiers.values()[Tier].MaxBurdenFactor;
      if (Package.Mass > MaxBurden) {
        throw (new CarriageMotionException("String_Node_Str" + ((int)(Package.Mass - MaxBurden)) + "String_Node_Str"));
      }
    }
    double EnergyRequired=Package.Mass * CarriageDrive.Types.values()[Type].EnergyConsumption * CarriageDrive.Tiers.values()[Tier].EnergyConsumptionFactor;
    int powerConsumed=(int)Math.ceil(EnergyRequired * Configuration.PowerConsumptionFactor);
    if (powerConsumed > this.energyStored) {
      throw (new CarriageMotionException("String_Node_Str" + energyStored + "String_Node_Str"+ powerConsumed));
    }
 else {
      this.energyStored-=powerConsumed;
    }
  }
  return (Package);
}
Program: 22853
Project: 22853
Buggy source:
public void EstablishPlaceholders(CarriagePackage Package){
  for (  BlockRecord Record : Package.Body) {
    if (Package.NewPositions.contains(Record)) {
      SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,Blocks.Spectre.blockID,Spectre.Types.Supportive.ordinal());
    }
 else {
      SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,0,0);
    }
  }
}

Fixed version (ground truth):
public void EstablishPlaceholders(CarriagePackage Package){
  for (  BlockRecord Record : Package.Body) {
    if (Package.NewPositions.contains(Record)) {
      SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,Blocks.Spectre,Spectre.Types.Supportive.ordinal());
    }
 else {
      SneakyWorldUtil.SetBlock(worldObj,Record.X,Record.Y,Record.Z,null,0);
    }
  }
}
Program: 22854
Project: 22854
Buggy source:
public void WriteCommonRecord(net.minecraft.nbt.NBTTagCompound TagCompound){
  for (int Index=0; Index < SideClosed.length; Index++) {
    TagCompound.setBoolean("String_Node_Str" + Index,SideClosed[Index]);
  }
  TagCompound.setInteger("String_Node_Str",DecorationId);
  TagCompound.setInteger("String_Node_Str",DecorationMeta);
  TagCompound.setInteger("String_Node_Str",Tier);
}

Fixed version (ground truth):
public void WriteCommonRecord(net.minecraft.nbt.NBTTagCompound TagCompound){
  for (int Index=0; Index < SideClosed.length; Index++) {
    TagCompound.setBoolean("String_Node_Str" + Index,SideClosed[Index]);
  }
  TagCompound.setInteger("String_Node_Str",Block.blockRegistry.getIDForObject(decorationId));
  TagCompound.setInteger("String_Node_Str",DecorationMeta);
  TagCompound.setInteger("String_Node_Str",Tier);
}
Program: 22855
Project: 22855
Buggy source:
@Override public void EmitDrops(Block Block,int Meta){
  EmitDrop(Block,CarriageItem.Stack(Meta,Tier,DecorationId,DecorationMeta));
}

Fixed version (ground truth):
@Override public void EmitDrops(Block Block,int Meta){
  EmitDrop(Block,CarriageItem.Stack(Meta,Tier,decorationId,DecorationMeta));
}
Program: 22856
Project: 22856
Buggy source:
@Override public void Setup(net.minecraft.entity.player.EntityPlayer Player,net.minecraft.item.ItemStack Item){
  DecorationId=CarriageItem.GetDecorationId(Item);
  DecorationMeta=CarriageItem.GetDecorationMeta(Item);
  Tier=CarriageItem.GetTier(Item);
}

Fixed version (ground truth):
@Override public void Setup(net.minecraft.entity.player.EntityPlayer Player,net.minecraft.item.ItemStack Item){
  decorationId=CarriageItem.GetDecorationId(Item);
  DecorationMeta=CarriageItem.GetDecorationMeta(Item);
  Tier=CarriageItem.GetTier(Item);
}
Program: 22857
Project: 22857
Buggy source:
@Override public void ReadCommonRecord(net.minecraft.nbt.NBTTagCompound TagCompound){
  for (int Index=0; Index < SideClosed.length; Index++) {
    SideClosed[Index]=TagCompound.getBoolean("String_Node_Str" + Index);
  }
  DecorationId=TagCompound.getInteger("String_Node_Str");
  DecorationMeta=TagCompound.getInteger("String_Node_Str");
  Tier=TagCompound.getInteger("String_Node_Str");
}

Fixed version (ground truth):
@Override public void ReadCommonRecord(net.minecraft.nbt.NBTTagCompound TagCompound){
  for (int Index=0; Index < SideClosed.length; Index++) {
    SideClosed[Index]=TagCompound.getBoolean("String_Node_Str" + Index);
  }
  decorationId=(net.minecraft.block.Block)Block.blockRegistry.getObjectById(TagCompound.getInteger("String_Node_Str"));
  DecorationMeta=TagCompound.getInteger("String_Node_Str");
  Tier=TagCompound.getInteger("String_Node_Str");
}
Program: 22858
Project: 22858
Buggy source:
public static net.minecraft.item.ItemStack Stack(int Type,int Tier,int DecorationId,int DecorationMeta){
  net.minecraft.item.ItemStack Item=Stack.Tag(Stack.New(Blocks.Carriage,Type));
  Item.stackTagCompound.setInteger("String_Node_Str",DecorationId);
  Item.stackTagCompound.setInteger("String_Node_Str",DecorationMeta);
  Item.stackTagCompound.setInteger("String_Node_Str",Tier);
  return (Item);
}

Fixed version (ground truth):
public static net.minecraft.item.ItemStack Stack(int Type,int Tier,Block decorationId,int DecorationMeta){
  net.minecraft.item.ItemStack Item=Stack.Tag(Stack.New(Blocks.Carriage,Type));
  if (decorationId != null) {
    Item.stackTagCompound.setInteger("String_Node_Str",Block.blockRegistry.getIDForObject(decorationId));
  }
 else {
    Item.stackTagCompound.setInteger("String_Node_Str",0);
  }
  Item.stackTagCompound.setInteger("String_Node_Str",DecorationMeta);
  Item.stackTagCompound.setInteger("String_Node_Str",Tier);
  return (Item);
}