nus-yam/ex-repair huggingface dataset:
Program: 169577
Project: 169577
Buggy source:
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockLauncherParts);
  add(list,InventoryUtility.getBlock("String_Node_Str"));
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.blockAntenna);
  add(list,ICBM.blockCommandCentral);
  add(list,ICBM.blockCommandSiloConnector);
  add(list,ICBM.blockCommandSiloDisplay);
  add(list,ICBM.itemRemoteDetonator);
  add(list,ICBM.itemRadarGun);
  add(list,ICBM.itemLaserDet);
  add(list,InventoryUtility.getBlock("String_Node_Str"));
  add(list,ICBM.blockSiloController);
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.blockWarheadWorkstation);
  add(list,ICBM.blockSMAuto);
  add(list,ICBM.itemMissileCart);
  add(list,InventoryUtility.getBlock("String_Node_Str"));
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemTrigger);
  add(list,ICBM.blockLaunchPad);
}

Fixed version (ground truth):
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockLauncherParts);
  add(list,InventoryUtility.getBlock("String_Node_Str"));
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.blockAntenna);
  add(list,ICBM.blockCommandCentral);
  add(list,ICBM.blockCommandSiloConnector);
  add(list,ICBM.blockCommandSiloDisplay);
  add(list,ICBM.itemRemoteDetonator);
  add(list,ICBM.itemRadarGun);
  add(list,ICBM.itemLaserDet);
  add(list,InventoryUtility.getBlock("String_Node_Str"));
  add(list,InventoryUtility.getBlock("String_Node_Str"));
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.blockWarheadWorkstation);
  add(list,ICBM.blockSMAuto);
  add(list,ICBM.itemMissileCart);
  add(list,InventoryUtility.getBlock("String_Node_Str"));
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemTrigger);
  add(list,ICBM.blockLaunchPad);
}
Program: 169578
Project: 169578
Buggy source:
@Override public void onPostInit(){
  GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ICBM.blockFoFStation),"String_Node_Str","String_Node_Str",'C',ICBM.blockSiloController,'R',UniversalRecipe.CIRCUIT_T2.get(),'P',UniversalRecipe.PRIMARY_PLATE.get()));
}

Fixed version (ground truth):
@Override public void onPostInit(){
  GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ICBM.blockFoFStation),"String_Node_Str","String_Node_Str",'C',InventoryUtility.getBlock("String_Node_Str"),'R',UniversalRecipe.CIRCUIT_T2.get(),'P',UniversalRecipe.PRIMARY_PLATE.get()));
}
Program: 169580
Project: 169580
Buggy source:
@Override protected void drawGuiContainerForegroundLayer(int mouseX,int mouseY){
  super.drawGuiContainerForegroundLayer(mouseX,mouseY);
  if (ticks++ >= updateGuiTicks) {
    reloadData();
  }
  String name=LanguageUtility.getLocalName(controller.getInventoryName());
  if (editMode) {
    if (controller != null && controller.launcherData != null && controller.launcherData.size() > editMissile) {
      LauncherData data=controller.launcherData.get(editMissile);
      if (data.location != null) {
        Block block=data.location.getBlock(controller.world());
        if (block != null) {
          String localization=block.getLocalizedName();
          if (localization != null && !localization.contains("String_Node_Str")) {
            name=localization;
          }
        }
      }
    }
  }
  drawStringCentered(name,85,10);
  if (!editMode && (controller.launcherData == null || controller.launcherData.size() == 0)) {
    drawStringCentered(LanguageUtility.getLocal("String_Node_Str"),85,40);
    drawStringCentered(LanguageUtility.getLocal("String_Node_Str"),85,50);
  }
 else   if (editMode) {
    drawString(LanguageUtility.getLocalName("String_Node_Str"),10,30);
    drawString(LanguageUtility.getLocalName("String_Node_Str"),10,70);
  }
}

Fixed version (ground truth):
@Override protected void drawGuiContainerForegroundLayer(int mouseX,int mouseY){
  super.drawGuiContainerForegroundLayer(mouseX,mouseY);
  if (ticks++ >= updateGuiTicks) {
    reloadData();
  }
  String name=LanguageUtility.getLocalName(controller.getInventory().getInventoryName());
  if (editMode) {
    if (controller != null && controller.launcherData != null && controller.launcherData.size() > editMissile) {
      LauncherData data=controller.launcherData.get(editMissile);
      if (data.location != null) {
        Block block=data.location.getBlock(controller.world());
        if (block != null) {
          String localization=block.getLocalizedName();
          if (localization != null && !localization.contains("String_Node_Str")) {
            name=localization;
          }
        }
      }
    }
  }
  drawStringCentered(name,85,10);
  if (!editMode && (controller.launcherData == null || controller.launcherData.size() == 0)) {
    drawStringCentered(LanguageUtility.getLocal("String_Node_Str"),85,40);
    drawStringCentered(LanguageUtility.getLocal("String_Node_Str"),85,50);
  }
 else   if (editMode) {
    drawString(LanguageUtility.getLocalName("String_Node_Str"),10,30);
    drawString(LanguageUtility.getLocalName("String_Node_Str"),10,70);
  }
}
Program: 169583
Project: 169583
Buggy source:
@Override public ILauncher getSilo(){
  if (launcher instanceof TileEntity && ((TileEntity)launcher).isInvalid() || launcher instanceof Entity && !((Entity)launcher).isEntityAlive()) {
    launcher=null;
  }
  if (world() != null && launcher == null) {
    if (world().blockExists(x,y,z)) {
      TileEntity tile=world().getTileEntity(x,y,z);
      if (tile instanceof ILauncher) {
        launcher=(ILauncher)tile;
      }
    }
  }
  return launcher;
}

Fixed version (ground truth):
@Override public ILauncher getSilo(){
  if (launcher instanceof TileEntity && ((TileEntity)launcher).isInvalid() || launcher instanceof Entity && !((Entity)launcher).isEntityAlive() || launcher instanceof ITileNode && !((ITileNode)launcher).getHost().isHostValid()) {
    launcher=null;
  }
  if (world() != null && launcher == null) {
    if (world().blockExists(x,y,z)) {
      TileEntity tile=world().getTileEntity(x,y,z);
      if (tile instanceof ILauncher) {
        launcher=(ILauncher)tile;
      }
 else       if (tile instanceof ITileNodeHost && ((ITileNodeHost)tile).getTileNode() instanceof ILauncher) {
        launcher=(ILauncher)((ITileNodeHost)tile).getTileNode();
      }
    }
  }
  return launcher;
}
Program: 169584
Project: 169584
Buggy source:
@Override public String link(Location loc,short code){
  if (loc.world != world()) {
    return "String_Node_Str";
  }
  Pos pos=loc.toPos();
  if (!pos.isAboveBedrock()) {
    return "String_Node_Str";
  }
  if (distance(pos) > MAX_LINK_DISTANCE) {
    return "String_Node_Str";
  }
  TileEntity tile=pos.getTileEntity(loc.world());
  if (!(tile instanceof ILauncher)) {
    return "String_Node_Str";
  }
  if (tile instanceof IPassCode && ((IPassCode)tile).getCode() != code) {
    return "String_Node_Str";
  }
  if (!posToData.containsKey(pos)) {
    ISiloConnectionData data=new SiloConnectionData((ILauncher)tile);
    if (!siloData.contains(data)) {
      if (siloData.size() < MAX_CONNECTIONS) {
        siloData.add(data);
        posToData.put(pos,data);
        ((ILinkFeedback)tile).onLinked(toLocation());
        return "String_Node_Str";
      }
 else {
        return "String_Node_Str";
      }
    }
 else {
      data=posToData.get(pos);
      siloData.add(data);
      posToData.put(pos,data);
      ((ILinkFeedback)tile).onLinked(toLocation());
      return "String_Node_Str";
    }
  }
 else {
    ISiloConnectionData data=posToData.get(pos);
    siloData.remove(data);
    posToData.remove(pos);
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String link(Location loc,short code){
  if (loc.world != world()) {
    return "String_Node_Str";
  }
  if (!loc.isAboveBedrock()) {
    return "String_Node_Str";
  }
  if (distance(loc) > MAX_LINK_DISTANCE) {
    return "String_Node_Str";
  }
  ILauncher launcher=getLauncher(loc);
  if (launcher != null) {
    if (launcher instanceof IPassCode && ((IPassCode)launcher).getCode() != code) {
      return "String_Node_Str";
    }
    Pos pos=loc.toPos();
    if (!posToData.containsKey(pos)) {
      ISiloConnectionData data=new SiloConnectionData(launcher);
      if (!siloData.contains(data)) {
        if (siloData.size() < MAX_CONNECTIONS) {
          siloData.add(data);
          posToData.put(pos,data);
          if (launcher instanceof ILinkFeedback) {
            ((ILinkFeedback)launcher).onLinked(toLocation());
          }
          return "String_Node_Str";
        }
 else {
          return "String_Node_Str";
        }
      }
 else {
        data=posToData.get(pos);
        siloData.add(data);
        posToData.put(pos,data);
        if (launcher instanceof ILinkFeedback) {
          ((ILinkFeedback)launcher).onLinked(toLocation());
        }
        return "String_Node_Str";
      }
    }
 else {
      ISiloConnectionData data=posToData.get(pos);
      siloData.remove(data);
      posToData.remove(pos);
      return "String_Node_Str";
    }
  }
 else {
    return "String_Node_Str";
  }
}
Program: 169585
Project: 169585
Buggy source:
@Override public BlockEdit changeBlock(Location location){
  if (location.getBlock() == Blocks.air)   return null;
  return new BlockEdit(location).set(Blocks.air,0,false,false);
}

Fixed version (ground truth):
@Override public BlockEdit changeBlock(Location location){
  if (location.getBlock() == Blocks.air)   return null;
  return new BlockEdit(location).set(Blocks.air,0,false,true);
}
Program: 169588
Project: 169588
Buggy source:
@EventHandler public void init(FMLInitializationEvent event){
  EntityRegistry.registerGlobalEntityID(EntityMissile.class,"String_Node_Str",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(EntityMissile.class,"String_Node_Str",ENTITY_ID_PREFIX + 3,this,500,1,true);
  EntityRegistry.registerGlobalEntityID(EntityFragment.class,"String_Node_Str",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(EntityFragment.class,"String_Node_Str",ENTITY_ID_PREFIX + 4,this,500,1,true);
  EntityRegistry.registerGlobalEntityID(EntityCart.class,"String_Node_Str",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(EntityCart.class,"String_Node_Str",ENTITY_ID_PREFIX + 5,this,500,1,true);
  super.init(event);
}

Fixed version (ground truth):
@EventHandler public void init(FMLInitializationEvent event){
  EntityRegistry.registerGlobalEntityID(EntityMissile.class,"String_Node_Str",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(EntityMissile.class,"String_Node_Str",ENTITY_ID_PREFIX + 3,this,500,1,true);
  EntityRegistry.registerGlobalEntityID(EntityFragment.class,"String_Node_Str",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(EntityFragment.class,"String_Node_Str",ENTITY_ID_PREFIX + 4,this,500,1,true);
  EntityRegistry.registerGlobalEntityID(EntityCart.class,"String_Node_Str",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(EntityCart.class,"String_Node_Str",ENTITY_ID_PREFIX + 5,this,500,1,true);
  EntityRegistry.registerGlobalEntityID(EntitySlimeRain.class,"String_Node_Str",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(EntitySlimeRain.class,"String_Node_Str",ENTITY_ID_PREFIX + 6,this,500,1,true);
  super.init(event);
}
Program: 169590
Project: 169590
Buggy source:
@Override public void init(){
  super.init();
  SharedAssets.loadModels();
  ClientRegistry.bindTileEntitySpecialRenderer(TileAntennaPart.class,new TESRAntenna());
  MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ICBM.blockAntenna),new ItemRendererAntennaFrame());
  MinecraftForgeClient.registerItemRenderer(ICBM.itemRocketLauncher,new RenderRocketLauncher());
  MinecraftForgeClient.registerItemRenderer(ICBM.itemMissile,RenderMissile.INSTANCE);
  RenderingRegistry.registerEntityRenderingHandler(EntityMissile.class,RenderMissile.INSTANCE);
  RenderingRegistry.registerEntityRenderingHandler(EntityCart.class,new RenderCart());
  RenderingRegistry.registerEntityRenderingHandler(EntityFragment.class,new RenderFragment());
  MinecraftForge.EVENT_BUS.register(this);
  FMLCommonHandler.instance().bus().register(this);
}

Fixed version (ground truth):
@Override public void init(){
  super.init();
  SharedAssets.loadModels();
  ClientRegistry.bindTileEntitySpecialRenderer(TileAntennaPart.class,new TESRAntenna());
  MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ICBM.blockAntenna),new ItemRendererAntennaFrame());
  MinecraftForgeClient.registerItemRenderer(ICBM.itemRocketLauncher,new RenderRocketLauncher());
  MinecraftForgeClient.registerItemRenderer(ICBM.itemMissile,RenderMissile.INSTANCE);
  RenderingRegistry.registerEntityRenderingHandler(EntityMissile.class,RenderMissile.INSTANCE);
  RenderingRegistry.registerEntityRenderingHandler(EntityCart.class,new RenderCart());
  RenderingRegistry.registerEntityRenderingHandler(EntityFragment.class,new RenderFragment());
  RenderingRegistry.registerEntityRenderingHandler(EntitySlimeRain.class,new RenderSlimeRain());
  MinecraftForge.EVENT_BUS.register(this);
  FMLCommonHandler.instance().bus().register(this);
}
Program: 169592
Project: 169592
Buggy source:
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockSmallSilo);
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.blockAntenna);
  add(list,ICBM.blockCommandCentral);
  add(list,ICBM.blockCommandSiloConnector);
  add(list,ICBM.blockCommandSiloDisplay);
  add(list,ICBM.itemRemoteDetonator);
  add(list,ICBM.itemRadarGun);
  add(list,ICBM.itemLaserDet);
  if (Engine.runningAsDev) {
    add(list,ICBM.blockStandardSilo);
  }
  add(list,ICBM.blockSiloController);
  add(list,ICBM.blockSmallPortableLauncher);
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.blockWarheadWorkstation);
  add(list,ICBM.blockSMAuto);
  add(list,ICBM.itemMissileCart);
  add(list,ICBM.blockSmallMissileMag);
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.blockLauncherParts);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemTrigger);
  add(list,ICBM.blockLaunchPad);
}

Fixed version (ground truth):
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockLauncherParts);
  add(list,ICBM.blockSmallSilo);
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.blockAntenna);
  add(list,ICBM.blockCommandCentral);
  add(list,ICBM.blockCommandSiloConnector);
  add(list,ICBM.blockCommandSiloDisplay);
  add(list,ICBM.itemRemoteDetonator);
  add(list,ICBM.itemRadarGun);
  add(list,ICBM.itemLaserDet);
  if (Engine.runningAsDev) {
    add(list,ICBM.blockStandardSilo);
  }
  add(list,ICBM.blockSiloController);
  add(list,ICBM.blockSmallPortableLauncher);
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.blockWarheadWorkstation);
  add(list,ICBM.blockSMAuto);
  add(list,ICBM.itemMissileCart);
  add(list,ICBM.blockSmallMissileMag);
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemTrigger);
  add(list,ICBM.blockLaunchPad);
}
Program: 169593
Project: 169593
Buggy source:
@Override public boolean read(ByteBuf buf,int id,EntityPlayer player,PacketType type){
  if (!super.read(buf,id,player,type)) {
    if (isClient()) {
      if (id == 0) {
        NBTTagCompound tag=ByteBufUtils.readTag(buf);
        launcherData=new ArrayList();
        if (tag.hasKey("String_Node_Str")) {
          NBTTagList list=tag.getTagList("String_Node_Str",10);
          for (int i=0; i < list.tagCount(); i++) {
            launcherData.add(new LauncherData(list.getCompoundTagAt(i)));
          }
        }
        if (Minecraft.getMinecraft().currentScreen instanceof GuiLocalController) {
          ((GuiLocalController)Minecraft.getMinecraft().currentScreen).reloadData();
        }
        return true;
      }
    }
 else {
      if (id == 1) {
        removeLauncher(new Pos(buf));
        return true;
      }
 else       if (id == 2) {
        int index=buf.readInt();
        if (index == -1)         fireAllLaunchers(player);
 else         fireLauncher(index,player);
        return true;
      }
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean read(ByteBuf buf,int id,EntityPlayer player,PacketType type){
  if (!super.read(buf,id,player,type)) {
    if (isClient()) {
      if (id == 0) {
        NBTTagCompound tag=ByteBufUtils.readTag(buf);
        launcherData=new ArrayList();
        if (tag.hasKey("String_Node_Str")) {
          NBTTagList list=tag.getTagList("String_Node_Str",10);
          for (int i=0; i < list.tagCount(); i++) {
            launcherData.add(new LauncherData(list.getCompoundTagAt(i)));
          }
        }
        if (Minecraft.getMinecraft().currentScreen instanceof GuiLocalController) {
          ((GuiLocalController)Minecraft.getMinecraft().currentScreen).reloadData();
        }
        return true;
      }
    }
 else {
      if (id == 1) {
        removeLauncher(new Pos(buf));
        return true;
      }
 else       if (id == 2) {
        int index=buf.readInt();
        if (index == -1) {
          fireAllLaunchers(player);
        }
 else {
          fireLauncher(index,player);
        }
        return true;
      }
    }
    return false;
  }
  return true;
}
Program: 169594
Project: 169594
Buggy source:
@Override public void doUpdateGuiUsers(){
  if (launcherLocations.size() > 0) {
    PacketTile packet;
    NBTTagCompound nbt=new NBTTagCompound();
    NBTTagList list=new NBTTagList();
    for (    TileAbstractLauncher launcher : getLaunchers()) {
      if (launcher.world() == world()) {
        list.appendTag(new LauncherData(launcher).toNBT());
      }
    }
    nbt.setTag("String_Node_Str",list);
    packet=new PacketTile(this,0,nbt);
    sendPacketToGuiUsers(packet);
  }
}

Fixed version (ground truth):
@Override public void doUpdateGuiUsers(){
  if (isServer() && launcherLocations.size() > 0) {
    PacketTile packet;
    NBTTagCompound nbt=new NBTTagCompound();
    NBTTagList list=new NBTTagList();
    for (    TileAbstractLauncher launcher : getLaunchers()) {
      if (launcher != null && !launcher.isInvalid() && launcher.world() == world()) {
        list.appendTag(new LauncherData(launcher).toNBT());
      }
    }
    nbt.setTag("String_Node_Str",list);
    packet=new PacketTile(this,0,nbt);
    sendPacketToGuiUsers(packet);
  }
}
Program: 169595
Project: 169595
Buggy source:
@Override public String link(Location loc,short code){
  if (loc.world != world())   return "String_Node_Str";
  Pos pos=loc.toPos();
  if (!pos.isAboveBedrock())   return "String_Node_Str";
  if (distance(pos) > MAX_LINK_DISTANCE)   return "String_Node_Str";
  TileEntity tile=pos.getTileEntity(loc.world());
  if (!(tile instanceof TileAbstractLauncher))   return "String_Node_Str";
  if (((IPassCode)tile).getCode() != code)   return "String_Node_Str";
  if (!launcherLocations.contains(pos)) {
    if (launcherLocations.size() < MAX_LAUNCHER_LINK) {
      launcherLocations.add(pos);
      ((ILinkFeedback)tile).onLinked(toLocation());
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
 else {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String link(Location loc,short code){
  if (loc.world != world()) {
    return "String_Node_Str";
  }
  Pos pos=loc.toPos();
  if (!pos.isAboveBedrock()) {
    return "String_Node_Str";
  }
  if (distance(pos) > MAX_LINK_DISTANCE) {
    return "String_Node_Str";
  }
  TileEntity tile=pos.getTileEntity(loc.world());
  if (!(tile instanceof TileAbstractLauncher)) {
    return "String_Node_Str";
  }
  if (((IPassCode)tile).getCode() != code) {
    return "String_Node_Str";
  }
  if (!launcherLocations.contains(pos)) {
    if (launcherLocations.size() < MAX_LAUNCHER_LINK) {
      launcherLocations.add(pos);
      ((ILinkFeedback)tile).onLinked(toLocation());
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
 else {
    return "String_Node_Str";
  }
}
Program: 169596
Project: 169596
Buggy source:
/** 
 * Called to remove the launcher from the list
 * @param pos - location of the launcher
 */
protected void removeLauncher(Pos pos){
  if (isServer())   launcherLocations.remove(pos);
 else   sendPacketToServer(new PacketTile(this,1,pos));
}

Fixed version (ground truth):
/** 
 * Called to remove the launcher from the list
 * @param pos - location of the launcher
 */
protected void removeLauncher(Pos pos){
  if (isServer()) {
    launcherLocations.remove(pos);
  }
 else {
    sendPacketToServer(new PacketTile(this,1,pos));
  }
}
Program: 169597
Project: 169597
Buggy source:
/** 
 * Called to fire the launcher in the list of linked launchers
 * @param index - # in the launcher list
 * @param player
 */
protected void fireLauncher(int index,EntityPlayer player){
  if (isServer()) {
    if (index >= 0 && index < launcherLocations.size()) {
      Pos pos=launcherLocations.get(index);
      TileEntity tile=pos.getTileEntity(world());
      if (tile instanceof TileAbstractLauncher) {
        if (((TileAbstractLauncher)tile).fireMissile()) {
          ICBM.INSTANCE.logger().info("String_Node_Str" + player + "String_Node_Str"+ tile);
        }
 else {
          ICBM.INSTANCE.logger().info("String_Node_Str" + player + "String_Node_Str"+ tile);
        }
      }
    }
  }
 else {
    sendPacketToServer(new PacketTile(this,2,index));
  }
}

Fixed version (ground truth):
/** 
 * Called to fire the launcher in the list of linked launchers
 * @param index  - # in the launcher list
 * @param player
 */
protected void fireLauncher(int index,EntityPlayer player){
  if (isServer()) {
    if (index >= 0 && index < launcherLocations.size()) {
      Pos pos=launcherLocations.get(index);
      TileEntity tile=pos.getTileEntity(world());
      if (tile instanceof TileAbstractLauncher) {
        if (((TileAbstractLauncher)tile).fireMissile()) {
          ICBM.INSTANCE.logger().info("String_Node_Str" + player + "String_Node_Str"+ tile);
        }
 else {
          ICBM.INSTANCE.logger().info("String_Node_Str" + player + "String_Node_Str"+ tile);
        }
      }
    }
  }
 else {
    sendPacketToServer(new PacketTile(this,2,index));
  }
}
Program: 169598
Project: 169598
Buggy source:
@Override protected boolean onPlayerRightClick(EntityPlayer player,int side,Pos hit){
  if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IWorldPosItem)   return false;
  if (isServer())   openGui(player,ICBM.INSTANCE);
  return true;
}

Fixed version (ground truth):
@Override protected boolean onPlayerRightClick(EntityPlayer player,int side,Pos hit){
  if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IWorldPosItem) {
    return false;
  }
  if (isServer()) {
    openGui(player,ICBM.INSTANCE);
  }
  return true;
}
Program: 169599
Project: 169599
Buggy source:
private static boolean isRod(final ItemStack stack){
  return hasOreName(ROD_ORE_NAME,stack);
}

Fixed version (ground truth):
private static boolean isRod(final ItemStack stack){
  return hasOreName(OreNames.ROD_IRON,stack);
}
Program: 169600
Project: 169600
Buggy source:
private static boolean isPlate(final ItemStack stack){
  return hasOreName(PLATE_ORE_NAME,stack);
}

Fixed version (ground truth):
private static boolean isPlate(final ItemStack stack){
  return hasOreName(OreNames.PLATE_IRON,stack);
}
Program: 169603
Project: 169603
Buggy source:
@Override public boolean matches(InventoryCrafting grid,World world){
  Warhead warhead=null;
  boolean ex=false;
  int ex_count=0;
  for (int x=0; x < grid.getSizeInventory(); x++) {
    ItemStack slotStack=grid.getStackInSlot(x);
    if (slotStack != null) {
      if (slotStack.getItem() instanceof IModuleItem) {
        IModule module=((IModuleItem)slotStack.getItem()).getModule(slotStack);
        if (module instanceof Warhead) {
          if (warhead != null) {
            return false;
          }
 else           if (((Warhead)module).getExplosiveStack() == null || InventoryUtility.stacksMatch(((Warhead)module).getExplosiveStack(),inputTarget)) {
            warhead=((Warhead)module);
            if (warhead.getExplosiveStack() != null) {
              ex_count=warhead.getExplosiveStack().stackSize;
            }
          }
 else {
            return false;
          }
        }
      }
 else       if (InventoryUtility.stacksMatch(slotStack,inputTarget)) {
        ex_count++;
        ex=true;
      }
 else {
        return false;
      }
    }
  }
  return warhead != null && ex && warhead.getMaxExplosives() >= ex_count;
}

Fixed version (ground truth):
@Override public boolean matches(InventoryCrafting grid,World world){
  Warhead warhead=null;
  boolean ex=false;
  int ex_count=0;
  for (int x=0; x < grid.getSizeInventory(); x++) {
    ItemStack slotStack=grid.getStackInSlot(x);
    if (slotStack != null) {
      if (slotStack.getItem() instanceof IModuleItem) {
        IModule module=((IModuleItem)slotStack.getItem()).getModule(slotStack);
        if (module instanceof Warhead) {
          if (warhead != null) {
            return false;
          }
 else           if (((Warhead)module).getExplosive() == null || ((Warhead)module).getExplosiveStack() == null || InventoryUtility.stacksMatch(((Warhead)module).getExplosiveStack(),inputTarget)) {
            warhead=((Warhead)module);
            if (warhead.getExplosiveStack() != null) {
              ex_count+=warhead.getExplosiveStack().stackSize;
            }
          }
 else {
            return false;
          }
        }
      }
 else       if (InventoryUtility.stacksMatch(slotStack,inputTarget)) {
        ex_count++;
        ex=true;
      }
 else {
        return false;
      }
    }
  }
  return warhead != null && ex && warhead.getMaxExplosives() >= ex_count;
}
Program: 169604
Project: 169604
Buggy source:
public TileAMS(){
  super("String_Node_Str",Material.iron);
  this.hardness=15f;
  this.resistance=50f;
  this.itemBlock=ItemBlockICBM.class;
  this.renderNormalBlock=false;
  this.addInventoryModule(10);
}

Fixed version (ground truth):
public TileAMS(){
  super("String_Node_Str",Material.iron);
  this.itemBlock=ItemBlockAMSTurret.class;
  this.hardness=15f;
  this.resistance=50f;
  this.itemBlock=ItemBlockICBM.class;
  this.renderNormalBlock=false;
  this.addInventoryModule(10);
}
Program: 169605
Project: 169605
Buggy source:
@Override public void update(){
  super.update();
  if (isServer()) {
    deltaTime=(System.nanoTime() - lastRotationUpdate) / 10000000000.0;
    lastRotationUpdate=System.nanoTime();
    if (selector == null) {
      selector=new EntityTargetingSelector(this);
    }
    if (fireArea == null) {
      fireArea=new Cube(toPos().add(-100,-200,-100),toPos().add(100,200,100));
    }
    if (target != null && (target.isDead || !selector.isEntityApplicable(target) || toPos().distance(target) > 200)) {
      target=null;
    }
    if (target == null) {
      target=getClosestTarget();
    }
    if (ticks % 10 == 0 && !aim.isWithin(currentAim,ROTATION_SPEED)) {
    }
    currentAim.moveTowards(aim,ROTATION_SPEED,deltaTime).clampTo360();
    if (target != null) {
      if (ticks % 3 == 0) {
        Pos aimPoint=new Pos(this.target);
        Pos center=toPos().add(0.5);
        if (Engine.runningAsDev) {
          sendPacket(new PacketSpawnParticleStream(world().provider.dimensionId,center,aimPoint));
        }
        aim.set(center.toEulerAngle(aimPoint).clampTo360());
        sendAimPacket();
      }
      if (ticks % 5 == 0 && aim.isWithin(currentAim,3)) {
        fireAt(target);
      }
    }
 else     if (ticks % 3 == 0 && !aim.isZero()) {
      aim.set(defaultAim);
      sendAimPacket();
    }
  }
}

Fixed version (ground truth):
@Override public void update(){
  super.update();
  if (isServer()) {
    deltaTime=(System.nanoTime() - lastRotationUpdate) / 100000000.0;
    lastRotationUpdate=System.nanoTime();
    if (selector == null) {
      selector=new EntityTargetingSelector(this);
    }
    if (fireArea == null) {
      fireArea=new Cube(toPos().add(-100,-200,-100),toPos().add(100,200,100));
    }
    if (target != null && (target.isDead || !selector.isEntityApplicable(target) || toPos().distance(target) > 200)) {
      target=null;
    }
    if (target == null) {
      target=getClosestTarget();
    }
    if (ticks % 10 == 0 && !aim.isWithin(currentAim,ROTATION_SPEED)) {
    }
    currentAim.moveTowards(aim,ROTATION_SPEED,deltaTime).clampTo360();
    if (target != null) {
      if (ticks % 3 == 0) {
        Pos aimPoint=new Pos(this.target);
        Pos center=toPos().add(0.5);
        if (Engine.runningAsDev) {
          sendPacket(new PacketSpawnParticleStream(world().provider.dimensionId,center,aimPoint));
        }
        aim.set(center.toEulerAngle(aimPoint).clampTo360());
        sendAimPacket();
      }
      if (aim.isWithin(currentAim,1) && weaponTicks++ % 20 == 0) {
        fireAt(target);
        weaponTicks=0;
      }
    }
 else     if (ticks % 3 == 0 && !aim.isZero()) {
      aim.set(defaultAim);
      sendAimPacket();
    }
  }
}
Program: 169606
Project: 169606
Buggy source:
@Override public void renderInventoryItem(IItemRenderer.ItemRenderType type,ItemStack itemStack,Object... data){
  GL11.glTranslatef(0.5f,0,0.5f);
  GL11.glRotatef(90,0,1,0);
  FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.AMS_TEXTURE);
  Assets.AMS_BOTTOM_MODEL.renderAll();
  GL11.glTranslatef(0,0.5f,0);
  FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.AMS_TEXTURE);
  Assets.AMS_TOP_MODEL.renderAll();
}

Fixed version (ground truth):
@Override public void renderInventoryItem(IItemRenderer.ItemRenderType type,ItemStack itemStack,Object... data){
  GL11.glTranslatef(0.5f,0,0.5f);
  GL11.glRotatef(90,0,1,0);
  FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.AMS_TEXTURE);
  Assets.AMS_BOTTOM_MODEL.renderAll();
  GL11.glTranslatef(0,0.5f,0);
  Assets.AMS_TOP_MODEL.renderAll();
}
Program: 169607
Project: 169607
Buggy source:
@Override protected boolean onPlayerRightClick(EntityPlayer player,int side,Pos hit){
  if (isServer() && Engine.runningAsDev && player.getHeldItem() != null && player.getHeldItem().getItem() == Items.stick) {
    if (debugWindow == null) {
      debugWindow=new WindowAMSDebug(this);
      debugWindow.open();
    }
 else {
      debugWindow.close();
      debugWindow=null;
    }
    return true;
  }
  return super.onPlayerRightClick(player,side,hit);
}

Fixed version (ground truth):
@Override protected boolean onPlayerRightClick(EntityPlayer player,int side,Pos hit){
  if (Engine.runningAsDev && player.getHeldItem() != null && player.getHeldItem().getItem() == Items.stick) {
    if (debugWindow == null) {
      debugWindow=new WindowAMSDebug(this);
      debugWindow.open();
    }
 else {
      debugWindow.close();
      debugWindow=null;
    }
    return true;
  }
  return super.onPlayerRightClick(player,side,hit);
}
Program: 169608
Project: 169608
Buggy source:
@SideOnly(Side.CLIENT) public void renderDynamic(Pos pos,float deltaTime,int pass){
  if (!currentAim.isWithin(aim,1)) {
    currentAim.moveTowards(aim,ROTATION_SPEED,deltaTime).clampTo360();
  }
  lastRotationUpdate=System.nanoTime();
  GL11.glPushMatrix();
  GL11.glTranslatef(pos.xf() + 0.5f,pos.yf(),pos.zf() + 0.5f);
  GL11.glRotatef((float)((currentAim.yaw() + 90f) % 360),0,1,0);
  FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.AMS_TEXTURE);
  Assets.AMS_BOTTOM_MODEL.renderAll();
  GL11.glTranslatef(0,0.5f,0);
  GL11.glRotatef((float)currentAim.pitch(),0,0,1);
  FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.AMS_TEXTURE);
  Assets.AMS_TOP_MODEL.renderAll();
  GL11.glPopMatrix();
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public void renderDynamic(Pos pos,float deltaTime,int pass){
  if (!currentAim.isWithin(aim,1)) {
    currentAim.moveTowards(aim,ROTATION_SPEED,deltaTime).clampTo360();
  }
  lastRotationUpdate=System.nanoTime();
  GL11.glPushMatrix();
  GL11.glTranslatef(pos.xf() + 0.5f,pos.yf(),pos.zf() + 0.5f);
  GL11.glRotatef((float)((currentAim.yaw() + 90f) % 360),0,1,0);
  FMLClientHandler.instance().getClient().renderEngine.bindTexture(Assets.AMS_TEXTURE);
  Assets.AMS_BOTTOM_MODEL.renderAll();
  GL11.glTranslatef(0,0.5f,0);
  GL11.glRotatef((float)currentAim.pitch(),0,0,1);
  Assets.AMS_TOP_MODEL.renderAll();
  GL11.glPopMatrix();
}
Program: 169609
Project: 169609
Buggy source:
public WindowAMSDebug(TileAMS ams){
  this.tile=ams;
  setLayout(new FlowLayout());
  yaw_label=new Label("String_Node_Str");
  pitch_label=new Label("String_Node_Str");
  add(yaw_label);
  add(pitch_label);
  setTitle("String_Node_Str");
  setSize(250,100);
}

Fixed version (ground truth):
public WindowAMSDebug(TileAMS ams){
  this.tile=ams;
  setLayout(new FlowLayout());
  yaw_label=new Label("String_Node_Str");
  pitch_label=new Label("String_Node_Str");
  add(yaw_label);
  add(pitch_label);
  if (tile.world().isRemote) {
    setTitle("String_Node_Str");
  }
 else {
    setTitle("String_Node_Str");
  }
  setSize(250,100);
}
Program: 169610
Project: 169610
Buggy source:
@Override public boolean update(){
  yaw_label.setText(String.format("String_Node_Str",tile.currentAim.yaw(),tile.aim.yaw()));
  yaw_label.setText(String.format("String_Node_Str",tile.currentAim.pitch(),tile.aim.pitch()));
  return true;
}

Fixed version (ground truth):
@Override public boolean update(){
  yaw_label.setText(String.format("String_Node_Str",tile.currentAim.yaw(),tile.aim.yaw()));
  pitch_label.setText(String.format("String_Node_Str",tile.currentAim.pitch(),tile.aim.pitch()));
  return true;
}
Program: 169613
Project: 169613
Buggy source:
@Override public String link(Location loc,short code){
  if (loc.world != world()) {
    return "String_Node_Str";
  }
  Pos pos=loc.toPos();
  if (!pos.isAboveBedrock()) {
    return "String_Node_Str";
  }
  if (distance(pos) > MAX_LINK_DISTANCE) {
    return "String_Node_Str";
  }
  TileEntity tile=pos.getTileEntity(loc.world());
  if (!(tile instanceof ILauncher)) {
    return "String_Node_Str";
  }
  if (tile instanceof IPassCode && ((IPassCode)tile).getCode() != code) {
    return "String_Node_Str";
  }
  if (!posToData.containsKey(pos)) {
    ISiloConnectionData data=new SiloConnectionData((ILauncher)tile);
    if (!siloData.contains(data)) {
      if (siloData.size() > MAX_CONNECTIONS) {
        siloData.add(data);
        posToData.put(pos,data);
        ((ILinkFeedback)tile).onLinked(toLocation());
        return "String_Node_Str";
      }
 else {
        return "String_Node_Str";
      }
    }
 else {
      data=posToData.get(pos);
      siloData.add(data);
      posToData.put(pos,data);
      ((ILinkFeedback)tile).onLinked(toLocation());
      return "String_Node_Str";
    }
  }
 else {
    ISiloConnectionData data=posToData.get(pos);
    siloData.remove(data);
    posToData.remove(pos);
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String link(Location loc,short code){
  if (loc.world != world()) {
    return "String_Node_Str";
  }
  Pos pos=loc.toPos();
  if (!pos.isAboveBedrock()) {
    return "String_Node_Str";
  }
  if (distance(pos) > MAX_LINK_DISTANCE) {
    return "String_Node_Str";
  }
  TileEntity tile=pos.getTileEntity(loc.world());
  if (!(tile instanceof ILauncher)) {
    return "String_Node_Str";
  }
  if (tile instanceof IPassCode && ((IPassCode)tile).getCode() != code) {
    return "String_Node_Str";
  }
  if (!posToData.containsKey(pos)) {
    ISiloConnectionData data=new SiloConnectionData((ILauncher)tile);
    if (!siloData.contains(data)) {
      if (siloData.size() < MAX_CONNECTIONS) {
        siloData.add(data);
        posToData.put(pos,data);
        ((ILinkFeedback)tile).onLinked(toLocation());
        return "String_Node_Str";
      }
 else {
        return "String_Node_Str";
      }
    }
 else {
      data=posToData.get(pos);
      siloData.add(data);
      posToData.put(pos,data);
      ((ILinkFeedback)tile).onLinked(toLocation());
      return "String_Node_Str";
    }
  }
 else {
    ISiloConnectionData data=posToData.get(pos);
    siloData.remove(data);
    posToData.remove(pos);
    return "String_Node_Str";
  }
}
Program: 169615
Project: 169615
Buggy source:
/** 
 * Called to open the GUI for adjusting this silo's settings. <p> Close the existing GUI, but keep track of its data. This way the Gui can be reopened. <p> If client side ignore the call. This should always be called server side to ensure the container opens on the server.
 * @param player   - player to open the GUI for
 * @param location - location of the tile to reopen the GUI for
 */
void openGui(EntityPlayer player,IWorldPosition location);

Fixed version (ground truth):
/** 
 * Called to open the GUI for adjusting this silo's settings. <p> Close the existing GUI, but keep track of its data. This way the Gui can be reopened. <p> If client side ignore the call. This should always be called server side to ensure the container opens on the server.
 * @param player      - player to open the GUI for
 * @param openingTile - tile that opened the GUI
 * @param connector       - tile that provided the connection
 */
void openGui(EntityPlayer player,TileEntity openingTile,ISiloConnectionPoint connector);
Program: 169616
Project: 169616
Buggy source:
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockSmallSilo);
  add(list,ICBM.blockAntenna);
  add(list,ICBM.blockCommandCentral);
  add(list,ICBM.blockCommandSiloConnector);
  add(list,ICBM.blockCommandSiloDisplay);
  if (Engine.runningAsDev) {
    add(list,ICBM.blockStandardSilo);
  }
  add(list,ICBM.blockSiloController);
  add(list,ICBM.blockSmallPortableLauncher);
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.blockLauncherParts);
  add(list,ICBM.itemMissile);
  add(list,ICBM.blockWarhead);
  add(list,ICBM.itemExplosive);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemExplosivePart);
}

Fixed version (ground truth):
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockSmallSilo);
  add(list,ICBM.blockAntenna);
  add(list,ICBM.blockCommandCentral);
  add(list,ICBM.blockCommandSiloConnector);
  add(list,ICBM.blockCommandSiloDisplay);
  add(list,ICBM.itemRemoteDetonator);
  if (Engine.runningAsDev) {
    add(list,ICBM.blockStandardSilo);
  }
  add(list,ICBM.blockSiloController);
  add(list,ICBM.blockSmallPortableLauncher);
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.blockLauncherParts);
  add(list,ICBM.itemMissile);
  add(list,ICBM.blockWarhead);
  add(list,ICBM.itemExplosive);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemExplosivePart);
}
Program: 169618
Project: 169618
Buggy source:
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockSmallSilo);
  add(list,ICBM.blockAntenna);
  if (Engine.runningAsDev) {
    add(list,ICBM.blockStandardSilo);
  }
  add(list,ICBM.blockSiloController);
  add(list,ICBM.blockSmallPortableLauncher);
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.blockLauncherParts);
  add(list,ICBM.itemMissile);
  add(list,ICBM.blockWarhead);
  add(list,ICBM.itemExplosive);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemExplosivePart);
}

Fixed version (ground truth):
@Override public void displayAllReleventItems(List list){
  add(list,ICBM.blockAMS);
  add(list,ICBM.blockFoFStation);
  add(list,ICBM.blockLauncherFrame);
  add(list,ICBM.blockSmallSilo);
  add(list,ICBM.blockAntenna);
  add(list,ICBM.blockCommandCentral);
  if (Engine.runningAsDev) {
    add(list,ICBM.blockStandardSilo);
  }
  add(list,ICBM.blockSiloController);
  add(list,ICBM.blockSmallPortableLauncher);
  add(list,ICBM.blockMissileWorkstation);
  add(list,ICBM.itemLinkTool);
  add(list,ICBM.itemGPSTool);
  add(list,ICBM.itemRocketLauncher);
  add(list,ICBM.blockLauncherParts);
  add(list,ICBM.itemMissile);
  add(list,ICBM.blockWarhead);
  add(list,ICBM.itemExplosive);
  add(list,ICBM.itemEngineModules);
  add(list,ICBM.itemGuidanceModules);
  add(list,ICBM.itemMissileParts);
  add(list,ICBM.itemExplosivePart);
}
Program: 169619
Project: 169619
Buggy source:
public boolean equals(Object object){
  if (object == this) {
    return true;
  }
  if (object instanceof WirelessGrid) {
    return ((WirelessGrid)object).name.equals(name) && ((WirelessGrid)object).key == key;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object object){
  if (object == this) {
    return true;
  }
  if (object instanceof WirelessGrid) {
    return ((WirelessGrid)object).name.equals(name) && ((WirelessGrid)object).key == key;
  }
  return false;
}
Program: 169620
Project: 169620
Buggy source:
/** 
 * Connects a sender to the grid
 * @param tile
 * @return
 */
public boolean connect(IRadioWaveSender tile){
  boolean connected=false;
  Cube cube=tile.getRadioSenderRange();
  if (cube != null) {
    for (    WirelessNetworkSend network : senderNetworks) {
      if (network.overlaps(cube) && network.addSender(tile)) {
        connected=true;
        for (        TileEntity t : network.connectedTiles) {
          if (t != tile && t instanceof IWirelessGridConnector) {
            ((IWirelessGridConnector)t).onCoverageAreaChanged(network);
          }
        }
      }
    }
    if (!connected) {
      WirelessNetworkSend network=new WirelessNetworkSend();
      network.addSender(tile);
      return connect(network);
    }
  }
  return connected;
}

Fixed version (ground truth):
/** 
 * Connects a sender to the grid
 * @param tile
 * @return
 */
public boolean connect(IRadioWaveSender tile){
  boolean connected=false;
  Cube cube=tile.getRadioSenderRange();
  if (cube != null) {
    for (    WirelessNetworkSend network : senderNetworks) {
      if ((network.coverageArea.size() == 0 || network.overlaps(cube)) && network.addSender(tile)) {
        connected=true;
        for (        TileEntity t : network.connectedTiles) {
          if (t != tile && t instanceof IWirelessGridConnector) {
            ((IWirelessGridConnector)t).onCoverageAreaChanged(network);
          }
        }
      }
    }
    if (!connected) {
      WirelessNetworkSend network=new WirelessNetworkSend();
      network.addSender(tile);
      return connect(network);
    }
  }
  return connected;
}
Program: 169621
Project: 169621
Buggy source:
public boolean removeReceiver(IRadioWaveReceiver receiver){
  if (receivers.contains(receiver)) {
    return receivers.remove(receiver);
  }
  return false;
}

Fixed version (ground truth):
public boolean removeReceiver(IRadioWaveReceiver receiver){
  if (receivers.contains(receiver)) {
    if (this.receivers.size() == 0) {
      isInvalid=true;
    }
    return receivers.remove(receiver);
  }
  return false;
}
Program: 169622
Project: 169622
Buggy source:
public boolean addReceiver(IRadioWaveReceiver receiver){
  if (!receivers.contains(receiver)) {
    return receivers.add(receiver);
  }
  return false;
}

Fixed version (ground truth):
public boolean addReceiver(IRadioWaveReceiver receiver){
  if (!receivers.contains(receiver) && receiver.getRadioReceiverRange() != null) {
    isInvalid=false;
    coverageArea.add(receiver.getRadioReceiverRange());
    return receivers.add(receiver);
  }
  return false;
}
Program: 169623
Project: 169623
Buggy source:
public boolean addSender(IRadioWaveSender sender){
  if (!senders.contains(sender)) {
    return senders.add(sender);
  }
  return false;
}

Fixed version (ground truth):
public boolean addSender(IRadioWaveSender sender){
  if (!senders.contains(sender) && sender.getRadioSenderRange() != null) {
    isInvalid=false;
    coverageArea.add(sender.getRadioSenderRange());
    return senders.add(sender);
  }
  return false;
}
Program: 169624
Project: 169624
Buggy source:
public boolean removeSender(IRadioWaveSender sender){
  if (senders.contains(sender)) {
    return senders.remove(sender);
  }
  return false;
}

Fixed version (ground truth):
public boolean removeSender(IRadioWaveSender sender){
  if (senders.contains(sender)) {
    if (this.senders.size() == 0) {
      isInvalid=true;
    }
    return senders.remove(sender);
  }
  return false;
}
Program: 169626
Project: 169626
Buggy source:
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int side,float xx,float yy,float zz){
  if (player.getHeldItem() != null) {
    if (player.getHeldItem().getItem() == Item.getItemFromBlock(this)) {
      return false;
    }
 else     if (!world.isRemote && Engine.runningAsDev && player.getHeldItem().getItem() == Items.stick) {
      TileEntity tile=world.getTileEntity(x,y,z);
      if (tile instanceof TileAntennaPart) {
        if (((TileAntennaPart)tile).network != null) {
          player.addChatComponentMessage(new ChatComponentText("String_Node_Str" + ((TileAntennaPart)tile).network.size() + "String_Node_Str"+ ((TileAntennaPart)tile).network.base));
        }
 else {
          player.addChatComponentMessage(new ChatComponentText("String_Node_Str"));
        }
      }
      return true;
    }
  }
  int meta=world.getBlockMetadata(x,y,z);
  if (meta == 2) {
    player.openGui(ICBM.INSTANCE,0,world,x,y,z);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int side,float xx,float yy,float zz){
  int meta=world.getBlockMetadata(x,y,z);
  if (player.getHeldItem() != null) {
    if (player.getHeldItem().getItem() == Item.getItemFromBlock(this)) {
      return false;
    }
 else     if (!world.isRemote && Engine.runningAsDev) {
      if (player.getHeldItem().getItem() == Items.stick) {
        TileEntity tile=world.getTileEntity(x,y,z);
        if (tile instanceof TileAntennaPart) {
          if (((TileAntennaPart)tile).network != null) {
            player.addChatComponentMessage(new ChatComponentText("String_Node_Str" + ((TileAntennaPart)tile).network.size() + "String_Node_Str"+ ((TileAntennaPart)tile).network.base));
          }
 else {
            player.addChatComponentMessage(new ChatComponentText("String_Node_Str"));
          }
        }
        return true;
      }
 else       if (player.getHeldItem().getItem() == Items.blaze_rod) {
        TileEntity tile=world.getTileEntity(x,y,z);
        if (tile instanceof TileAntennaPart) {
          player.addChatComponentMessage(new ChatComponentText("String_Node_Str" + ((TileAntennaPart)tile).connections.size() + "String_Node_Str"));
        }
        return true;
      }
    }
  }
  if (meta == 2) {
    if (!world.isRemote) {
      player.openGui(ICBM.INSTANCE,0,world,x,y,z);
    }
    return true;
  }
  return false;
}