nus-yam/ex-repair huggingface dataset:
Program: 170015
Project: 170015
Buggy source:
@Override public void onUpdate(){
  if (this.blockID >= Block.blocksList.length) {
    this.setDead();
    return;
  }
  if (this.posY > 400 || Block.blocksList[this.blockID] == null || this.blockID == ZhuYaoZhaPin.bJia.blockID || this.blockID == Block.pistonExtension.blockID || this.blockID == Block.waterMoving.blockID || this.blockID == Block.lavaMoving.blockID) {
    this.setDead();
    return;
  }
  this.motionY-=gravity;
  if (this.isCollided) {
    this.pushOutOfBlocks(this.posX,(this.boundingBox.minY + this.boundingBox.maxY) / 2.0D,this.posZ);
  }
  this.moveEntity(this.motionX,this.motionY,this.motionZ);
  if (this.yawChange > 0) {
    this.rotationYaw+=this.yawChange;
    this.yawChange-=2;
  }
  if (this.pitchChange > 0) {
    this.rotationPitch+=this.pitchChange;
    this.pitchChange-=2;
  }
  if ((this.onGround && this.ticksExisted > 20) || this.ticksExisted > 20 * 120) {
    this.setBlock();
    return;
  }
  this.ticksExisted++;
}

Fixed version (ground truth):
@Override public void onUpdate(){
  if (this.blockID >= Block.blocksList.length) {
    this.setDead();
    return;
  }
  if (this.posY > 400 || Block.blocksList[this.blockID] == null || this.blockID == ZhuYaoBase.bJia.blockID || this.blockID == Block.pistonExtension.blockID || this.blockID == Block.waterMoving.blockID || this.blockID == Block.lavaMoving.blockID) {
    this.setDead();
    return;
  }
  this.motionY-=gravity;
  if (this.isCollided) {
    this.pushOutOfBlocks(this.posX,(this.boundingBox.minY + this.boundingBox.maxY) / 2.0D,this.posZ);
  }
  this.moveEntity(this.motionX,this.motionY,this.motionZ);
  if (this.yawChange > 0) {
    this.rotationYaw+=this.yawChange;
    this.yawChange-=2;
  }
  if (this.pitchChange > 0) {
    this.rotationPitch+=this.pitchChange;
    this.pitchChange-=2;
  }
  if ((this.onGround && this.ticksExisted > 20) || this.ticksExisted > 20 * 120) {
    this.setBlock();
    return;
  }
  this.ticksExisted++;
}
Program: 170017
Project: 170017
Buggy source:
@Override public void onCreate(Vector3 position){
  ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,1,0)),new Vector3(this));
}

Fixed version (ground truth):
@Override public void onCreate(Vector3 position){
  ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,1,0)),new Vector3(this));
}
Program: 170018
Project: 170018
Buggy source:
@Override public void onCreate(Vector3 position){
  if (this.orientation == 3 || this.orientation == 2) {
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(1,0,0)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(1,1,0)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(1,2,0)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(-1,0,0)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(-1,1,0)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(-1,2,0)),new Vector3(this));
  }
 else {
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,0,1)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,1,1)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,2,1)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,0,-1)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,1,-1)),new Vector3(this));
    ZhuYaoZhaPin.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,2,-1)),new Vector3(this));
  }
}

Fixed version (ground truth):
@Override public void onCreate(Vector3 position){
  if (this.orientation == 3 || this.orientation == 2) {
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(1,0,0)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(1,1,0)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(1,2,0)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(-1,0,0)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(-1,1,0)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(-1,2,0)),new Vector3(this));
  }
 else {
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,0,1)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,1,1)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,2,1)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,0,-1)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,1,-1)),new Vector3(this));
    ZhuYaoBase.bJia.makeFakeBlock(this.worldObj,Vector3.add(position,new Vector3(0,2,-1)),new Vector3(this));
  }
}
Program: 170019
Project: 170019
Buggy source:
@Override public void onCreate(Vector3 position){
  this.worldObj.setBlock(position.intX(),position.intY() + 1,position.intZ(),ZhuYaoZhaPin.bJia.blockID,0,2);
  ((TileEntityMulti)this.worldObj.getBlockTileEntity(position.intX(),position.intY() + 1,position.intZ())).setMainBlock(position);
  this.worldObj.setBlock(position.intX(),position.intY() + 2,position.intZ(),ZhuYaoZhaPin.bJia.blockID,0,2);
  ((TileEntityMulti)this.worldObj.getBlockTileEntity(position.intX(),position.intY() + 2,position.intZ())).setMainBlock(position);
}

Fixed version (ground truth):
@Override public void onCreate(Vector3 position){
  this.worldObj.setBlock(position.intX(),position.intY() + 1,position.intZ(),ZhuYaoBase.bJia.blockID,0,2);
  ((TileEntityMulti)this.worldObj.getBlockTileEntity(position.intX(),position.intY() + 1,position.intZ())).setMainBlock(position);
  this.worldObj.setBlock(position.intX(),position.intY() + 2,position.intZ(),ZhuYaoBase.bJia.blockID,0,2);
  ((TileEntityMulti)this.worldObj.getBlockTileEntity(position.intX(),position.intY() + 2,position.intZ())).setMainBlock(position);
}
Program: 170020
Project: 170020
Buggy source:
@Override public void onCreate(Vector3 position){
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(0,1,0),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(1,1,0),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(-1,1,0),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(0,1,1),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(0,1,-1),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(1,1,-1),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(-1,1,1),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(1,1,1),position),new Vector3(this));
  ZhuYaoZhaPin.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(-1,1,-1),position),new Vector3(this));
}

Fixed version (ground truth):
@Override public void onCreate(Vector3 position){
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(0,1,0),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(1,1,0),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(-1,1,0),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(0,1,1),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(0,1,-1),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(1,1,-1),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(-1,1,1),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(1,1,1),position),new Vector3(this));
  ZhuYaoBase.bJia.makeFakeBlock(worldObj,Vector3.add(new Vector3(-1,1,-1),position),new Vector3(this));
}
Program: 170022
Project: 170022
Buggy source:
@Override public void onCraftGuiClosed(EntityPlayer par1EntityPlayer){
  this.tileEntity.closeChest();
  super.onCraftGuiClosed(par1EntityPlayer);
}

Fixed version (ground truth):
@Override public void onCraftGuiClosed(EntityPlayer par1EntityPlayer){
  this.tileEntity.playersUsing.remove(par1EntityPlayer);
  super.onCraftGuiClosed(par1EntityPlayer);
}
Program: 170023
Project: 170023
Buggy source:
public ContainerTurretPlatform(InventoryPlayer player,TileEntityTurretPlatform tileEntity){
  this.tileEntity=tileEntity;
  int row;
  for (row=0; row < 3; row++) {
    for (int column=0; column < 4; column++) {
      this.addSlotToContainer(new SlotAmmunition(tileEntity,column + row * 4,8 + column * 18,40 + row * 18));
    }
  }
  for (int i=0; i < 4; i++) {
    this.addSlotToContainer(new Slot(tileEntity,i + TileEntityTurretPlatform.UPGRADE_START_INDEX,89 + i * 18,77));
  }
  for (row=0; row < 3; ++row) {
    for (int slot=0; slot < 9; ++slot) {
      this.addSlotToContainer(new Slot(player,slot + row * 9 + 9,8 + slot * 18,97 + row * 18));
    }
  }
  for (row=0; row < 9; ++row) {
    this.addSlotToContainer(new Slot(player,row,8 + row * 18,155));
  }
  this.tileEntity.openChest();
}

Fixed version (ground truth):
public ContainerTurretPlatform(InventoryPlayer inventoryPlayer,TileEntityTurretPlatform tileEntity){
  this.tileEntity=tileEntity;
  int row;
  for (row=0; row < 3; row++) {
    for (int column=0; column < 4; column++) {
      this.addSlotToContainer(new SlotAmmunition(tileEntity,column + row * 4,8 + column * 18,40 + row * 18));
    }
  }
  for (int i=0; i < 4; i++) {
    this.addSlotToContainer(new Slot(tileEntity,i + TileEntityTurretPlatform.UPGRADE_START_INDEX,89 + i * 18,77));
  }
  for (row=0; row < 3; ++row) {
    for (int slot=0; slot < 9; ++slot) {
      this.addSlotToContainer(new Slot(inventoryPlayer,slot + row * 9 + 9,8 + slot * 18,97 + row * 18));
    }
  }
  for (row=0; row < 9; ++row) {
    this.addSlotToContainer(new Slot(inventoryPlayer,row,8 + row * 18,155));
  }
  this.tileEntity.playersUsing.add(inventoryPlayer.player);
}
Program: 170024
Project: 170024
Buggy source:
@Override public void openChest(){
  this.playersUsing++;
}

Fixed version (ground truth):
@Override public void openChest(){
}
Program: 170025
Project: 170025
Buggy source:
@Override public void closeChest(){
  this.playersUsing--;
}

Fixed version (ground truth):
@Override public void closeChest(){
}
Program: 170026
Project: 170026
Buggy source:
@Override public void attackTargetLiving(int meta,TileEntityTurretBase turret,Entity target,boolean hit){
  if (turret == null || turret.getPlatform() == null) {
    return;
  }
  if (meta == types.BULLET.ordinal()) {
    if (target instanceof EntityLiving) {
      if (turret.worldObj.rand.nextFloat() > 0.1) {
        ((EntityLiving)target).attackEntityFrom(DamageSource.setExplosionSource(null),5);
      }
      Vector3 look=LookHelper.getDeltaPositionFromRotation(turret.wantedRotationYaw,turret.wantedRotationPitch);
      look.multiply(0.3);
      ((EntityLiving)target).knockBack(null,0,look.intX(),look.intZ());
    }
    if (!turret.worldObj.isRemote && turret.worldObj.rand.nextFloat() > 0.8) {
      Vector3 spawnPos=turret.getMuzzle();
      EntityItem entityShell=new EntityItem(turret.worldObj,spawnPos.x,spawnPos.y,spawnPos.z,ZhuYaoGangShao.bulletShell.copy());
      entityShell.delayBeforeCanPickup=20;
      turret.worldObj.spawnEntityInWorld(entityShell);
    }
  }
}

Fixed version (ground truth):
@Override public void attackTargetLiving(int meta,TileEntityTurretBase turret,Entity target,boolean hit){
  if (turret == null || turret.getPlatform() == null) {
    return;
  }
  if (meta == types.BULLET.ordinal()) {
    if (target instanceof EntityLiving) {
      if (turret.worldObj.rand.nextFloat() > 0.1) {
        ((EntityLiving)target).attackEntityFrom(DamageSource.setExplosionSource(null),4);
      }
      Vector3 look=LookHelper.getDeltaPositionFromRotation(turret.wantedRotationYaw,turret.wantedRotationPitch);
      look.multiply(0.3);
      ((EntityLiving)target).knockBack(null,0,look.intX(),look.intZ());
    }
    if (!turret.worldObj.isRemote && turret.worldObj.rand.nextFloat() > 0.8) {
      Vector3 spawnPos=turret.getMuzzle();
      EntityItem entityShell=new EntityItem(turret.worldObj,spawnPos.x,spawnPos.y,spawnPos.z,ZhuYaoGangShao.bulletShell.copy());
      entityShell.delayBeforeCanPickup=20;
      turret.worldObj.spawnEntityInWorld(entityShell);
    }
  }
}
Program: 170027
Project: 170027
Buggy source:
@Override public void onWeaponActivated(){
  if (this.getPlatform() != null) {
    if (this.target instanceof EntityLiving && this.getPlatform().useAmmunition(ZhuYaoGangShao.conventionalBullet)) {
      if (this.worldObj.rand.nextFloat() > 0.1) {
        ((EntityLiving)this.target).attackEntityFrom(DamageSource.setExplosionSource(null),3);
      }
      Vector3 look=LookHelper.getDeltaPositionFromRotation(this.targetRotationYaw,this.targetRotationPitch);
      look.multiply(-3);
      ((EntityLiving)this.target).knockBack(null,0,look.intX(),look.intZ());
      this.getPlatform().wattsReceived-=this.getRequest();
      if (!this.worldObj.isRemote && this.worldObj.rand.nextFloat() > 0.1) {
        Vector3 spawnPos=this.getMuzzle();
        EntityItem entityShell=new EntityItem(this.worldObj,spawnPos.x,spawnPos.y,spawnPos.z,ZhuYaoGangShao.bulletShell.copy());
        entityShell.delayBeforeCanPickup=20;
        this.worldObj.spawnEntityInWorld(entityShell);
      }
      this.worldObj.playSoundEffect(this.xCoord,this.yCoord,this.zCoord,"String_Node_Str",5F,1F);
    }
  }
}

Fixed version (ground truth):
@Override public void onWeaponActivated(){
  if (this.getPlatform() != null) {
    if (this.target instanceof EntityLiving && this.getPlatform().useAmmunition(ZhuYaoGangShao.conventionalBullet)) {
      if (this.worldObj.rand.nextFloat() > 0.1) {
        ((EntityLiving)this.target).attackEntityFrom(DamageSource.setExplosionSource(null),3);
      }
      Vector3 look=LookHelper.getDeltaPositionFromRotation(this.targetRotationYaw,this.targetRotationPitch);
      look.multiply(-3);
      ((EntityLiving)this.target).knockBack(null,0,look.intX(),look.intZ());
      this.getPlatform().wattsReceived-=this.getRequest();
      if (!this.worldObj.isRemote && this.worldObj.rand.nextFloat() > 0.8) {
        Vector3 spawnPos=this.getMuzzle();
        EntityItem entityShell=new EntityItem(this.worldObj,spawnPos.x,spawnPos.y,spawnPos.z,ZhuYaoGangShao.bulletShell.copy());
        entityShell.delayBeforeCanPickup=20;
        this.worldObj.spawnEntityInWorld(entityShell);
      }
      this.worldObj.playSoundEffect(this.xCoord,this.yCoord,this.zCoord,"String_Node_Str",5F,1F);
    }
  }
}
Program: 170028
Project: 170028
Buggy source:
@Override public void onNeighborBlockChange(World world,int x,int y,int z,int side){
  TileEntity tileEntity=world.getBlockTileEntity(x,y,z);
  if (this.canBlockStay(world,x,y,z)) {
    if (tileEntity instanceof IRedstoneReceptor) {
      if (world.isBlockIndirectlyGettingPowered(x,y,z)) {
        ((IRedstoneReceptor)tileEntity).onPowerOn();
      }
 else {
        ((IRedstoneReceptor)tileEntity).onPowerOff();
      }
    }
  }
 else {
    if (tileEntity instanceof IMultiBlock) {
      ((IMultiBlock)tileEntity).onDestroy(tileEntity);
    }
    this.dropBlockAsItem(world,x,y,z,world.getBlockMetadata(x,y,z),0);
    world.setBlock(x,y,z,0,0,3);
  }
}

Fixed version (ground truth):
@Override public void onNeighborBlockChange(World world,int x,int y,int z,int side){
  TileEntity tileEntity=world.getBlockTileEntity(x,y,z);
  if (tileEntity instanceof TileEntityTurretBase) {
    if (this.canBlockStay(world,x,y,z)) {
      if (tileEntity instanceof IRedstoneReceptor) {
        if (world.isBlockIndirectlyGettingPowered(x,y,z)) {
          ((IRedstoneReceptor)tileEntity).onPowerOn();
        }
 else {
          ((IRedstoneReceptor)tileEntity).onPowerOff();
        }
      }
    }
 else {
      if (tileEntity != null) {
        ((TileEntityTurretBase)tileEntity).destroy(false);
      }
    }
  }
}
Program: 170029
Project: 170029
Buggy source:
@Override public void onDestroy(TileEntity callingBlock){
  this.worldObj.setBlock(this.xCoord,this.yCoord,this.zCoord,0,0,2);
  this.worldObj.setBlock(this.xCoord,this.yCoord + 1,this.zCoord,0,0,2);
}

Fixed version (ground truth):
@Override public void onDestroy(TileEntity callingBlock){
  this.worldObj.setBlock(this.xCoord,this.yCoord,this.zCoord,0);
  this.worldObj.setBlock(this.xCoord,this.yCoord + 1,this.zCoord,0);
}
Program: 170030
Project: 170030
Buggy source:
@Override public void init(){
  super.init();
  ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBaseTurret.class,new RenderGunTurret());
  ClientRegistry.bindTileEntitySpecialRenderer(TCiGuiPao.class,new RenderRailgun());
  RenderingRegistry.registerEntityRenderingHandler(EntityFakeMountable.class,new RenderFakeMountable());
  RenderingRegistry.registerBlockHandler(new BlockRenderingHandler());
}

Fixed version (ground truth):
@Override public void init(){
  super.init();
  ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretBase.class,new RenderGunTurret());
  ClientRegistry.bindTileEntitySpecialRenderer(TCiGuiPao.class,new RenderRailgun());
  RenderingRegistry.registerEntityRenderingHandler(EntityFakeMountable.class,new RenderFakeMountable());
  RenderingRegistry.registerBlockHandler(new BlockRenderingHandler());
}
Program: 170031
Project: 170031
Buggy source:
public Action getNewCommand(TileEntityBaseTurret tileEntity,Class<? extends Action> commandClass,String[] parameters){
  try {
    Action newCommand=commandClass.newInstance();
    newCommand.world=tileEntity.worldObj;
    newCommand.tileEntity=tileEntity;
    newCommand.commandManager=this;
    newCommand.setParameters(parameters);
    return newCommand;
  }
 catch (  Exception e) {
    FMLLog.severe("String_Node_Str");
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public Action getNewCommand(TileEntityTurretBase tileEntity,Class<? extends Action> commandClass,String[] parameters){
  try {
    Action newCommand=commandClass.newInstance();
    newCommand.world=tileEntity.worldObj;
    newCommand.tileEntity=tileEntity;
    newCommand.commandManager=this;
    newCommand.setParameters(parameters);
    return newCommand;
  }
 catch (  Exception e) {
    FMLLog.severe("String_Node_Str");
    e.printStackTrace();
  }
  return null;
}
Program: 170032
Project: 170032
Buggy source:
public void addCommand(TileEntityBaseTurret tileEntity,Class<? extends Action> task){
  this.addCommand(tileEntity,task,new String[0]);
}

Fixed version (ground truth):
public void addCommand(TileEntityTurretBase tileEntity,Class<? extends Action> task){
  this.addCommand(tileEntity,task,new String[0]);
}
Program: 170033
Project: 170033
Buggy source:
@Override public void onTaskStart(){
  super.onTaskStart();
  if (this.getArg(0) != null) {
    this.targetRotationYaw=this.getFloatArg(0);
  }
 else {
    this.targetRotationYaw=0;
  }
  if (this.getArg(1) != null) {
    this.targetRotationPitch=this.getFloatArg(1);
  }
 else {
    this.targetRotationPitch=0;
  }
  while (this.targetRotationYaw < 0)   this.targetRotationYaw+=360;
  while (this.targetRotationYaw > 360)   this.targetRotationYaw-=360;
  while (this.targetRotationPitch < -TileEntityBaseTurret.MAX_PITCH)   this.targetRotationPitch+=TileEntityBaseTurret.MAX_PITCH;
  while (this.targetRotationPitch > TileEntityBaseTurret.MAX_PITCH)   this.targetRotationPitch-=TileEntityBaseTurret.MAX_PITCH;
}

Fixed version (ground truth):
@Override public void onTaskStart(){
  super.onTaskStart();
  if (this.getArg(0) != null) {
    this.targetRotationYaw=this.getFloatArg(0);
  }
 else {
    this.targetRotationYaw=0;
  }
  if (this.getArg(1) != null) {
    this.targetRotationPitch=this.getFloatArg(1);
  }
 else {
    this.targetRotationPitch=0;
  }
  while (this.targetRotationYaw < 0)   this.targetRotationYaw+=360;
  while (this.targetRotationYaw > 360)   this.targetRotationYaw-=360;
  while (this.targetRotationPitch < -TileEntityTurretBase.MAX_PITCH)   this.targetRotationPitch+=TileEntityTurretBase.MAX_PITCH;
  while (this.targetRotationPitch > TileEntityTurretBase.MAX_PITCH)   this.targetRotationPitch-=TileEntityTurretBase.MAX_PITCH;
}
Program: 170034
Project: 170034
Buggy source:
public LookHelper(TileEntityBaseTurret turret){
  this.sentry=turret;
}

Fixed version (ground truth):
public LookHelper(TileEntityTurretBase turret){
  this.sentry=turret;
}
Program: 170035
Project: 170035
Buggy source:
public BlockTurretPlatform(int id){
  super(id,"String_Node_Str",UniversalElectricity.machine);
  this.setHardness(50f);
  this.setResistance(100f);
  this.setCreativeTab(ICBMTab.INSTANCE);
}

Fixed version (ground truth):
public BlockTurretPlatform(int id){
  super(id,"String_Node_Str",UniversalElectricity.machine);
  this.setHardness(50f);
  this.setResistance(100f);
  this.setCreativeTab(ICBMTab.INSTANCE);
  this.requireSidedTextures=true;
}
Program: 170036
Project: 170036
Buggy source:
public TileEntityBaseTurret getTurret(){
  TileEntity tileEntity=this.worldObj.getBlockTileEntity(this.xCoord + this.deployDirection.offsetX,this.yCoord + this.deployDirection.offsetY,this.zCoord + this.deployDirection.offsetZ);
  if (tileEntity instanceof TileEntityBaseTurret) {
    this.turret=(TileEntityBaseTurret)tileEntity;
  }
 else {
    this.turret=null;
  }
  return this.turret;
}

Fixed version (ground truth):
public TileEntityTurretBase getTurret(){
  TileEntity tileEntity=this.worldObj.getBlockTileEntity(this.xCoord + this.deployDirection.offsetX,this.yCoord + this.deployDirection.offsetY,this.zCoord + this.deployDirection.offsetZ);
  if (tileEntity instanceof TileEntityTurretBase) {
    this.turret=(TileEntityTurretBase)tileEntity;
  }
 else {
    this.turret=null;
  }
  return this.turret;
}
Program: 170037
Project: 170037
Buggy source:
public boolean destroy(boolean doExplosion){
  if (doExplosion) {
    this.worldObj.createExplosion(null,this.xCoord,this.yCoord,this.zCoord,2f,true);
  }
  this.getBlockType().dropBlockAsItem(this.worldObj,this.xCoord,this.yCoord,this.zCoord,this.getBlockMetadata(),0);
  return this.worldObj.setBlock(this.xCoord,this.yCoord,this.zCoord,0,0,2);
}

Fixed version (ground truth):
public boolean destroy(boolean doExplosion){
  if (doExplosion) {
    this.worldObj.createExplosion(null,this.xCoord,this.yCoord,this.zCoord,2f,true);
  }
  if (!this.worldObj.isRemote) {
    this.getBlockType().dropBlockAsItem(this.worldObj,this.xCoord,this.yCoord,this.zCoord,this.getBlockMetadata(),0);
  }
  return this.worldObj.setBlock(this.xCoord,this.yCoord,this.zCoord,0);
}
Program: 170038
Project: 170038
Buggy source:
/** 
 * if a sentry is spawned above the stand it is removed
 * @return
 */
public boolean destroyTurret(){
  TileEntity ent=this.worldObj.getBlockTileEntity(this.xCoord + deployDirection.offsetX,this.yCoord + deployDirection.offsetY,this.zCoord + deployDirection.offsetZ);
  if (ent instanceof TileEntityBaseTurret) {
    this.turret=null;
    return ((TileEntityBaseTurret)ent).destroy(false);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * if a sentry is spawned above the stand it is removed
 * @return
 */
public boolean destroyTurret(){
  TileEntity ent=this.worldObj.getBlockTileEntity(this.xCoord + deployDirection.offsetX,this.yCoord + deployDirection.offsetY,this.zCoord + deployDirection.offsetZ);
  if (ent instanceof TileEntityTurretBase) {
    this.turret=null;
    return ((TileEntityTurretBase)ent).destroy(false);
  }
  return false;
}
Program: 170039
Project: 170039
Buggy source:
@Override public void renderTileEntityAt(TileEntity t,double x,double y,double z,float f){
  super.renderTileEntityAt(t,x,y,z,f);
  if (t instanceof TileEntityBaseTurret) {
    TileEntityBaseTurret tileEntity=(TileEntityBaseTurret)t;
    GL11.glPushMatrix();
    GL11.glTranslatef((float)x + 0.5f,(float)y + 1.5f,(float)z + 0.5f);
    this.setTextureBaseOnState(tileEntity);
    RenderGunTurret.render(tileEntity.rotationYaw,tileEntity.rotationPitch);
    GL11.glPopMatrix();
  }
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity t,double x,double y,double z,float f){
  super.renderTileEntityAt(t,x,y,z,f);
  if (t instanceof TileEntityTurretBase) {
    TileEntityTurretBase tileEntity=(TileEntityTurretBase)t;
    GL11.glPushMatrix();
    GL11.glTranslatef((float)x + 0.5f,(float)y + 1.5f,(float)z + 0.5f);
    this.setTextureBaseOnState(tileEntity);
    RenderGunTurret.render(tileEntity.rotationYaw,tileEntity.rotationPitch);
    GL11.glPopMatrix();
  }
}
Program: 170040
Project: 170040
Buggy source:
public void setTextureBaseOnState(TileEntityBaseTurret tileEntity){
  EntityPlayer player=this.getPlayer();
  if (tileEntity.getPlatform() != null) {
    AccessLevel level=tileEntity.getPlatform().getUserAccess(player.username);
    if (level == AccessLevel.ADMIN) {
      this.bindTextureByName(ZhuYao.MODEL_PATH + TEXTURE_FILE);
      return;
    }
 else     if (level.ordinal() >= AccessLevel.USER.ordinal()) {
      this.bindTextureByName(ZhuYao.MODEL_PATH + TEXTURE_FILE_FRIENDLY);
      return;
    }
  }
  this.bindTextureByName(ZhuYao.MODEL_PATH + TEXTURE_FILE_HOSTILE);
}

Fixed version (ground truth):
public void setTextureBaseOnState(TileEntityTurretBase tileEntity){
  EntityPlayer player=this.getPlayer();
  if (tileEntity.getPlatform() != null) {
    AccessLevel level=tileEntity.getPlatform().getUserAccess(player.username);
    if (level == AccessLevel.ADMIN) {
      this.bindTextureByName(ZhuYao.MODEL_PATH + TEXTURE_FILE);
      return;
    }
 else     if (level.ordinal() >= AccessLevel.USER.ordinal()) {
      this.bindTextureByName(ZhuYao.MODEL_PATH + TEXTURE_FILE_FRIENDLY);
      return;
    }
  }
  this.bindTextureByName(ZhuYao.MODEL_PATH + TEXTURE_FILE_HOSTILE);
}
Program: 170041
Project: 170041
Buggy source:
@Override public void renderTileEntityAt(TileEntity t,double x,double y,double z,float f){
  super.renderTileEntityAt(t,x,y,z,f);
  if (t instanceof TileEntityBaseTurret) {
    TileEntityBaseTurret tileEntity=(TileEntityBaseTurret)t;
    GL11.glPushMatrix();
    GL11.glTranslatef((float)x + 0.5f,(float)y + 1f,(float)z + 0.5f);
    GL11.glScalef(0.7f,0.7f,0.7f);
    this.setTextureBaseOnState(tileEntity);
    RenderGunTurretOld.render(tileEntity.rotationYaw,tileEntity.rotationPitch);
    GL11.glPopMatrix();
  }
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity t,double x,double y,double z,float f){
  super.renderTileEntityAt(t,x,y,z,f);
  if (t instanceof TileEntityTurretBase) {
    TileEntityTurretBase tileEntity=(TileEntityTurretBase)t;
    GL11.glPushMatrix();
    GL11.glTranslatef((float)x + 0.5f,(float)y + 1f,(float)z + 0.5f);
    GL11.glScalef(0.7f,0.7f,0.7f);
    this.setTextureBaseOnState(tileEntity);
    RenderGunTurretOld.render(tileEntity.rotationYaw,tileEntity.rotationPitch);
    GL11.glPopMatrix();
  }
}
Program: 170042
Project: 170042
Buggy source:
public void setTextureBaseOnState(TileEntityBaseTurret tileEntity){
  EntityPlayer player=this.getPlayer();
  if (tileEntity.getPlatform() != null) {
    AccessLevel level=tileEntity.getPlatform().getUserAccess(player.username);
    if (level == AccessLevel.ADMIN) {
      this.bindTextureByName(ZhuYao.TEXTURE_PATH + TEXTURE_FILE);
      return;
    }
 else     if (level.ordinal() >= AccessLevel.USER.ordinal()) {
      this.bindTextureByName(ZhuYao.TEXTURE_PATH + TEXTURE_FILE_FRIENDLY);
      return;
    }
  }
  this.bindTextureByName(ZhuYao.TEXTURE_PATH + TEXTURE_FILE_HOSTILE);
}

Fixed version (ground truth):
public void setTextureBaseOnState(TileEntityTurretBase tileEntity){
  EntityPlayer player=this.getPlayer();
  if (tileEntity.getPlatform() != null) {
    AccessLevel level=tileEntity.getPlatform().getUserAccess(player.username);
    if (level == AccessLevel.ADMIN) {
      this.bindTextureByName(ZhuYao.TEXTURE_PATH + TEXTURE_FILE);
      return;
    }
 else     if (level.ordinal() >= AccessLevel.USER.ordinal()) {
      this.bindTextureByName(ZhuYao.TEXTURE_PATH + TEXTURE_FILE_FRIENDLY);
      return;
    }
  }
  this.bindTextureByName(ZhuYao.TEXTURE_PATH + TEXTURE_FILE_HOSTILE);
}
Program: 170043
Project: 170043
Buggy source:
@Override public List<String> getCmdUses(EntityPlayer player,ISpecialAccess mm){
  List<String> cmds=new ArrayList<String>();
  cmds.add("String_Node_Str");
  return cmds;
}

Fixed version (ground truth):
@Override public List<String> getCmdUses(EntityPlayer player,ISpecialAccess mm){
  List<String> cmds=new ArrayList<String>();
  cmds.add("String_Node_Str");
  cmds.add("String_Node_Str");
  return cmds;
}
Program: 170044
Project: 170044
Buggy source:
public ItemBlockTurret(int par1){
  super(par1);
}

Fixed version (ground truth):
public ItemBlockTurret(int par1){
  super(par1);
  this.setMaxDamage(0);
  this.setHasSubtypes(true);
}
Program: 170045
Project: 170045
Buggy source:
/** 
 * Reads a tile entity from NBT.
 */
@Override public void readFromNBT(NBTTagCompound par1NBTTagCompound){
  super.readFromNBT(par1NBTTagCompound);
  this.mode=par1NBTTagCompound.getByte("String_Node_Str");
  this.frequency=par1NBTTagCompound.getShort("String_Node_Str");
  this.isInverted=par1NBTTagCompound.getBoolean("String_Node_Str");
  this.minCoord=Vector3.readFromNBT("String_Node_Str",par1NBTTagCompound);
  this.maxCoord=Vector3.readFromNBT("String_Node_Str",par1NBTTagCompound);
}

Fixed version (ground truth):
/** 
 * Reads a tile entity from NBT.
 */
@Override public void readFromNBT(NBTTagCompound nbt){
  super.readFromNBT(nbt);
  this.mode=nbt.getByte("String_Node_Str");
  this.frequency=nbt.getShort("String_Node_Str");
  this.isInverted=nbt.getBoolean("String_Node_Str");
  this.minCoord=Vector3.readFromNBT(nbt.getCompoundTag("String_Node_Str"));
  this.maxCoord=Vector3.readFromNBT(nbt.getCompoundTag("String_Node_Str"));
}
Program: 170046
Project: 170046
Buggy source:
/** 
 * Writes a tile entity to NBT.
 */
@Override public void writeToNBT(NBTTagCompound par1NBTTagCompound){
  super.writeToNBT(par1NBTTagCompound);
  par1NBTTagCompound.setShort("String_Node_Str",this.frequency);
  par1NBTTagCompound.setByte("String_Node_Str",this.mode);
  par1NBTTagCompound.setBoolean("String_Node_Str",this.isInverted);
  this.minCoord.writeToNBT("String_Node_Str",par1NBTTagCompound);
  this.maxCoord.writeToNBT("String_Node_Str",par1NBTTagCompound);
}

Fixed version (ground truth):
/** 
 * Writes a tile entity to NBT.
 */
@Override public void writeToNBT(NBTTagCompound nbt){
  super.writeToNBT(nbt);
  nbt.setShort("String_Node_Str",this.frequency);
  nbt.setByte("String_Node_Str",this.mode);
  nbt.setBoolean("String_Node_Str",this.isInverted);
  nbt.setCompoundTag("String_Node_Str",this.minCoord.writeToNBT(new NBTTagCompound()));
  nbt.setCompoundTag("String_Node_Str",this.maxCoord.writeToNBT(new NBTTagCompound()));
}
Program: 170047
Project: 170047
Buggy source:
/** 
 * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
 */
@Override public boolean isItemValid(ItemStack compareStack){
  for (  ItemStack itemStack : itemStacks) {
    if (compareStack.isItemEqual(itemStack)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Check if the stack is a valid item for this slot. Always true beside for the armor slots.
 */
@Override public boolean isItemValid(ItemStack compareStack){
  for (  ItemStack itemStack : itemStacks) {
    if (compareStack.isItemEqual(itemStack) || (!this.isMetadataSensitive && compareStack.itemID == itemStack.itemID)) {
      return true;
    }
  }
  return false;
}
Program: 170049
Project: 170049
Buggy source:
/** 
 * Determines if this TileEntity requires update calls.
 * @return True if you want updateEntity() to be called, false if not
 */
public boolean canUpdate(){
  return false;
}

Fixed version (ground truth):
/** 
 * Determines if this TileEntity requires update calls.
 * @return True if you want updateEntity() to be called, false if not
 */
@Override public boolean canUpdate(){
  return false;
}
Program: 170050
Project: 170050
Buggy source:
public CFaShiDi(InventoryPlayer par1InventoryPlayer,TFaSheDi tileEntity){
  this.missileLauncher=tileEntity;
  this.addSlotToContainer(new SlotSpecific(tileEntity,0,84,47,new ItemStack(ZhuYaoZhaPin.itDaoDan)));
  int var3;
  for (var3=0; var3 < 3; ++var3) {
    for (int var4=0; var4 < 9; ++var4) {
      this.addSlotToContainer(new Slot(par1InventoryPlayer,var4 + var3 * 9 + 9,8 + var4 * 18,84 + var3 * 18));
    }
  }
  for (var3=0; var3 < 9; ++var3) {
    this.addSlotToContainer(new Slot(par1InventoryPlayer,var3,8 + var3 * 18,142));
  }
}

Fixed version (ground truth):
public CFaShiDi(InventoryPlayer par1InventoryPlayer,TFaSheDi tileEntity){
  this.missileLauncher=tileEntity;
  this.addSlotToContainer(new SlotSpecific(tileEntity,0,84,47,new ItemStack(ZhuYaoZhaPin.itDaoDan),new ItemStack(ZhuYaoZhaPin.itTeBieDaoDan)));
  int var3;
  for (var3=0; var3 < 3; ++var3) {
    for (int var4=0; var4 < 9; ++var4) {
      this.addSlotToContainer(new Slot(par1InventoryPlayer,var4 + var3 * 9 + 9,8 + var4 * 18,84 + var3 * 18));
    }
  }
  for (var3=0; var3 < 9; ++var3) {
    this.addSlotToContainer(new Slot(par1InventoryPlayer,var3,8 + var3 * 18,142));
  }
}
Program: 170051
Project: 170051
Buggy source:
public static JiQi get(int id){
  if (id <= JiQi.values().length) {
    return JiQi.values()[id];
  }
  return null;
}

Fixed version (ground truth):
public static JiQi get(int id){
  if (id < JiQi.values().length && id > 0) {
    return JiQi.values()[id];
  }
  return null;
}
Program: 170052
Project: 170052
Buggy source:
@Override public List<ItemStack> getItemsDropped(){
  List<ItemStack> items=new ArrayList<ItemStack>();
  items.add(new ItemStack(ZhuYao.itChe,1,this.explosiveID));
  return items;
}

Fixed version (ground truth):
@Override public List<ItemStack> getItemsDropped(){
  List<ItemStack> items=new ArrayList<ItemStack>();
  if (!this.isPrimed) {
    items.add(new ItemStack(ZhuYao.itChe,1,this.explosiveID));
  }
  return items;
}
Program: 170053
Project: 170053
Buggy source:
@Override public void onUpdate(){
  super.onUpdate();
  if (this.isPrimed) {
    if (this.fuse < 1) {
      this.explode();
    }
 else {
      ZhaPin.list[explosiveID].onYinZha(this.worldObj,new Vector3(this.posX,this.posY,this.posZ),this.explosiveID);
      this.worldObj.spawnParticle("String_Node_Str",this.posX,this.posY + 0.8D,this.posZ,0.0D,0.0D,0.0D);
    }
    this.fuse--;
  }
 else {
    if (this.worldObj.getBlockId((int)this.posX,(int)this.posY,(int)this.posZ) == Block.rail.blockID && this.worldObj.isBlockIndirectlyGettingPowered((int)this.posX,(int)this.posY,(int)this.posZ)) {
      this.setPrimed(true);
    }
  }
}

Fixed version (ground truth):
@Override public void onUpdate(){
  super.onUpdate();
  if (this.worldObj.isRemote) {
    this.fuse=this.dataWatcher.getWatchableObjectInt(20);
    if (this.dataWatcher.getWatchableObjectByte(21) > 0) {
      this.isPrimed=true;
    }
 else {
      this.isPrimed=false;
    }
  }
 else {
    this.dataWatcher.updateObject(20,this.fuse);
    byte isPri=0;
    if (this.isPrimed)     isPri=1;
    this.dataWatcher.updateObject(21,isPri);
  }
  if (this.isPrimed) {
    if (this.fuse < 1) {
      this.explode();
    }
 else {
      ZhaPin.list[explosiveID].onYinZha(this.worldObj,new Vector3(this.posX,this.posY,this.posZ),this.explosiveID);
      this.worldObj.spawnParticle("String_Node_Str",this.posX,this.posY + 0.8D,this.posZ,0.0D,0.0D,0.0D);
    }
    this.fuse--;
  }
 else {
    if (this.worldObj.getBlockId((int)this.posX,(int)this.posY,(int)this.posZ) == Block.rail.blockID && this.worldObj.isBlockIndirectlyGettingPowered((int)this.posX,(int)this.posY,(int)this.posZ)) {
      this.setPrimed(true);
    }
  }
}
Program: 170054
Project: 170054
Buggy source:
public static List<EDaoDan> getMissileInArea(Region2 region){
  cleanUpMissiles();
  List<EDaoDan> returnArray=new ArrayList<EDaoDan>();
  for (  EDaoDan missile : missiles) {
    if (region.isIn(Vector3.get(missile).toVector2())) {
      returnArray.add(missile);
    }
  }
  return returnArray;
}

Fixed version (ground truth):
public static List<EDaoDan> getMissileInArea(Vector2 vector,int radius){
  cleanUpMissiles();
  List<EDaoDan> returnArray=new ArrayList<EDaoDan>();
  for (  EDaoDan missile : missiles) {
    if (Vector2.distance(vector,Vector3.get(missile).toVector2()) <= radius) {
      returnArray.add(missile);
    }
  }
  return returnArray;
}
Program: 170055
Project: 170055
Buggy source:
private boolean doScan(){
  this.missileAlert=false;
  this.detectedMissiles.clear();
  this.detectedRadarStations.clear();
  List<EDaoDan> missilesNearby=DaoDanGuanLi.getMissileInArea(new Region2(new Vector2(this.xCoord - MAX_BIAN_JING,this.zCoord - MAX_BIAN_JING),new Vector2(this.xCoord + MAX_BIAN_JING,this.zCoord + MAX_BIAN_JING)));
  for (  EDaoDan missile : missilesNearby) {
    if (missile.ticksInAir > -1) {
      if (!this.detectedMissiles.contains(missile)) {
        this.detectedMissiles.add(missile);
      }
      if (Vector2.distance(missile.muBiao.toVector2(),new Vector2(this.xCoord,this.zCoord)) < this.safetyBanJing) {
        this.missileAlert=true;
      }
    }
  }
  for (  TLeiDaTai radarStation : LeiDaGuanLi.getRadarStationsInArea(new Vector2(this.xCoord - this.MAX_BIAN_JING,this.zCoord - this.MAX_BIAN_JING),new Vector2(this.xCoord + this.MAX_BIAN_JING,this.zCoord + this.MAX_BIAN_JING))) {
    if (!radarStation.isDisabled() && radarStation.prevDian > 0) {
      this.detectedRadarStations.add(radarStation);
    }
  }
  return this.missileAlert;
}

Fixed version (ground truth):
private boolean doScan(){
  this.missileAlert=false;
  this.detectedMissiles.clear();
  this.detectedRadarStations.clear();
  List<EDaoDan> missilesNearby=DaoDanGuanLi.getMissileInArea(Vector3.get(this).toVector2(),this.alarmBanJing);
  for (  EDaoDan missile : missilesNearby) {
    if (missile.ticksInAir > -1) {
      if (!this.detectedMissiles.contains(missile)) {
        this.detectedMissiles.add(missile);
      }
      if (Vector2.distance(missile.muBiao.toVector2(),new Vector2(this.xCoord,this.zCoord)) < this.safetyBanJing) {
        this.missileAlert=true;
      }
    }
  }
  for (  TLeiDaTai radarStation : LeiDaGuanLi.getRadarStationsInArea(new Vector2(this.xCoord - this.MAX_BIAN_JING,this.zCoord - this.MAX_BIAN_JING),new Vector2(this.xCoord + this.MAX_BIAN_JING,this.zCoord + this.MAX_BIAN_JING))) {
    if (!radarStation.isDisabled() && radarStation.prevDian > 0) {
      this.detectedRadarStations.add(radarStation);
    }
  }
  return this.missileAlert;
}
Program: 170056
Project: 170056
Buggy source:
@Override public Object[] callMethod(IComputerAccess computer,int method,Object[] arguments) throws Exception {
  if (this.prevDian < this.YAO_DIAN) {
    throw new Exception("String_Node_Str");
  }
  List<Double> returnArray;
switch (method) {
case 0:
    List<EDaoDan> daoDans=DaoDanGuanLi.getMissileInArea(new Region2(new Vector2(this.xCoord - MAX_BIAN_JING,this.zCoord - MAX_BIAN_JING),new Vector2(this.xCoord + MAX_BIAN_JING,this.zCoord + MAX_BIAN_JING)));
  returnArray=new ArrayList<Double>();
for (EDaoDan daoDan : daoDans) {
  returnArray.add(daoDan.posX);
  returnArray.add(daoDan.posY);
  returnArray.add(daoDan.posZ);
}
return returnArray.toArray();
case 1:
returnArray=new ArrayList<Double>();
for (TLeiDaTai radarStation : LeiDaGuanLi.getRadarStationsInArea(new Vector2(this.xCoord - this.MAX_BIAN_JING,this.zCoord - this.MAX_BIAN_JING),new Vector2(this.xCoord + this.MAX_BIAN_JING,this.zCoord + this.MAX_BIAN_JING))) {
if (!radarStation.isDisabled() && radarStation.prevDian > 0) {
returnArray.add((double)radarStation.xCoord);
returnArray.add((double)radarStation.yCoord);
returnArray.add((double)radarStation.zCoord);
}
}
return returnArray.toArray();
}
throw new Exception("String_Node_Str");
}

Fixed version (ground truth):
@Override public Object[] callMethod(IComputerAccess computer,int method,Object[] arguments) throws Exception {
  if (this.prevDian < this.YAO_DIAN) {
    throw new Exception("String_Node_Str");
  }
  List<Double> returnArray;
switch (method) {
case 0:
    List<EDaoDan> daoDans=DaoDanGuanLi.getMissileInArea(Vector3.get(this).toVector2(),this.alarmBanJing);
  returnArray=new ArrayList<Double>();
for (EDaoDan daoDan : daoDans) {
  returnArray.add(daoDan.posX);
  returnArray.add(daoDan.posY);
  returnArray.add(daoDan.posZ);
}
return returnArray.toArray();
case 1:
returnArray=new ArrayList<Double>();
for (TLeiDaTai radarStation : LeiDaGuanLi.getRadarStationsInArea(new Vector2(this.xCoord - this.MAX_BIAN_JING,this.zCoord - this.MAX_BIAN_JING),new Vector2(this.xCoord + this.MAX_BIAN_JING,this.zCoord + this.MAX_BIAN_JING))) {
if (!radarStation.isDisabled() && radarStation.prevDian > 0) {
returnArray.add((double)radarStation.xCoord);
returnArray.add((double)radarStation.yCoord);
returnArray.add((double)radarStation.zCoord);
}
}
return returnArray.toArray();
}
throw new Exception("String_Node_Str");
}
Program: 170057
Project: 170057
Buggy source:
@Override public boolean isPoweringTo(ForgeDirection side){
  return this.dian >= this.YAO_DIAN && this.doScan() && this.detectedMissiles.size() > 0;
}

Fixed version (ground truth):
@Override public boolean isPoweringTo(ForgeDirection side){
  if (this.prevDian <= 0 && this.dian <= 0) {
    return false;
  }
  return this.doScan() && this.detectedMissiles.size() > 0;
}
Program: 170061
Project: 170061
Buggy source:
public void updateLoadChunk(int oldChunkX,int oldChunkZ,int newChunkX,int newChunkZ){
  if (this.chunkTicket == null) {
    this.chunkTicket=ForgeChunkManager.requestTicket(ICBM.instance,this.worldObj,Type.ENTITY);
    this.chunkTicket.bindEntity(this);
    this.chunkTicket.getModData();
  }
  System.out.println("String_Node_Str" + newChunkX + "String_Node_Str"+ newChunkZ);
  ForgeChunkManager.unforceChunk(this.chunkTicket,new ChunkCoordIntPair(oldChunkX,oldChunkZ));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(newChunkX,newChunkZ));
}

Fixed version (ground truth):
public void updateLoadChunk(){
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX + 1,this.chunkCoordZ + 1));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX + 1,this.chunkCoordZ));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX + 1,this.chunkCoordZ - 1));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX,this.chunkCoordZ + 1));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX,this.chunkCoordZ));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX,this.chunkCoordZ - 1));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX - 1,this.chunkCoordZ + 1));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX - 1,this.chunkCoordZ));
  ForgeChunkManager.forceChunk(this.chunkTicket,new ChunkCoordIntPair(this.chunkCoordX - 1,this.chunkCoordZ - 1));
}
Program: 170062
Project: 170062
Buggy source:
@Override public void readSpawnData(ByteArrayDataInput data){
  this.missileID=data.readInt();
  this.startingPosition=new Vector3(data.readDouble(),data.readDouble(),data.readDouble());
  this.missileLauncherPosition=new Vector3(data.readDouble(),data.readDouble(),data.readDouble());
  this.setPosition(this.startingPosition.x,this.startingPosition.y,this.startingPosition.z);
}

Fixed version (ground truth):
@Override public void readSpawnData(ByteArrayDataInput data){
  this.missileID=data.readInt();
  this.startingPosition=new Vector3(data.readDouble(),data.readDouble(),data.readDouble());
  this.missileLauncherPosition=new Vector3(data.readDouble(),data.readDouble(),data.readDouble());
}
Program: 170064
Project: 170064
Buggy source:
public EntityMissile(World par1World,Vector3 position,Vector3 launcherPosition,int metadata,boolean noClip){
  this(par1World,position,launcherPosition,metadata);
  this.noClip=noClip;
}

Fixed version (ground truth):
/** 
 * Spawns a traditional missile
 */
public EntityMissile(World par1World,Vector3 position,Vector3 launcherPosition,int metadata){
  this(par1World);
  this.missileID=metadata;
  this.startingPosition=position;
  this.missileLauncherPosition=launcherPosition;
  this.setPosition(this.startingPosition.x,this.startingPosition.y,this.startingPosition.z);
  this.setRotation(0,90);
}
Program: 170068
Project: 170068
Buggy source:
@Override public void validate(Object target,Errors errors){
  ResourceServerProperties resource=(ResourceServerProperties)target;
  if (StringUtils.hasText(client.getClientId())) {
    if (!StringUtils.hasText(client.getClientSecret())) {
      if (!StringUtils.hasText(resource.getUserInfoUri())) {
        errors.rejectValue("String_Node_Str","String_Node_Str","String_Node_Str");
      }
    }
 else {
      if (!StringUtils.hasText(resource.getTokenInfoUri())) {
        errors.rejectValue("String_Node_Str","String_Node_Str","String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
@Override public void validate(Object target,Errors errors){
  ResourceServerProperties resource=(ResourceServerProperties)target;
  if (StringUtils.hasText(client.getClientId())) {
    if (!StringUtils.hasText(client.getClientSecret())) {
      if (!StringUtils.hasText(resource.getUserInfoUri())) {
        errors.rejectValue("String_Node_Str","String_Node_Str","String_Node_Str");
      }
    }
 else {
      if (isPreferTokenInfo() && !StringUtils.hasText(resource.getTokenInfoUri())) {
        errors.rejectValue("String_Node_Str","String_Node_Str","String_Node_Str");
      }
    }
  }
}
Program: 170069
Project: 170069
Buggy source:
void configure(HttpSecurity http);

Fixed version (ground truth):
void configure(HttpSecurity http) throws Exception ;
Program: 170070
Project: 170070
Buggy source:
public void send(SendFileSpec sendFile,Consumer<InputStream> callback){
  try {
    LinkedList<String> args=new LinkedList<>();
    args.addAll(Arrays.asList("String_Node_Str","String_Node_Str"));
    for (    Snapshot s : sendFile.cloneSources) {
      args.add("String_Node_Str");
      args.add(s.getSnapshotDir().toAbsolutePath().toString());
    }
    args.add(sendFile.target.getSnapshotDir().toAbsolutePath().toString());
    Process process=processBuilder(args).redirectOutput(Redirect.PIPE).start();
    callback.consume(process.getInputStream());
    int exitValue=process.waitFor();
    if (exitValue != 0) {
      throw new IOException("String_Node_Str" + exitValue);
    }
  }
 catch (  IOException|InterruptedException e) {
    throw new RuntimeException("String_Node_Str" + sendFile,e);
  }
}

Fixed version (ground truth):
public void send(SendFileSpec sendFile,Consumer<InputStream> callback){
  try {
    LinkedList<String> args=new LinkedList<>();
    args.addAll(Arrays.asList("String_Node_Str","String_Node_Str"));
{
      boolean firstSource=true;
      for (      Snapshot s : sendFile.cloneSources) {
        if (firstSource) {
          args.add("String_Node_Str");
          firstSource=false;
        }
 else {
          args.add("String_Node_Str");
        }
        args.add(s.getSnapshotDir().toAbsolutePath().toString());
      }
    }
    args.add(sendFile.target.getSnapshotDir().toAbsolutePath().toString());
    Process process=processBuilder(args).redirectOutput(Redirect.PIPE).start();
    callback.consume(process.getInputStream());
    int exitValue=process.waitFor();
    if (exitValue != 0) {
      throw new IOException("String_Node_Str" + exitValue);
    }
  }
 catch (  IOException|InterruptedException e) {
    throw new RuntimeException("String_Node_Str" + sendFile,e);
  }
}