nus-yam/ex-repair huggingface dataset:
Program: 63695
Project: 63695
Buggy source:
@Override public boolean canWork(){
  if (canWorkCooldown > 0) {
    canWorkCooldown--;
  }
 else {
    canWorkCached=checkCanWork();
    canWorkCooldown=ticksPerCheckCanWork;
  }
  return canWorkCached;
}

Fixed version (ground truth):
@Override public boolean canWork(){
  if (housingSupportsMultipleErrorStates) {
    Set<IErrorState> errorStates=housing.getErrorStates();
    for (    IErrorState errorState : errorStates) {
      housing.setErrorCondition(false,errorState);
    }
  }
  boolean hasSpace=addPendingProducts();
  if (hasBreedablePrincess()) {
    return hasSpace;
  }
  if (hasHealthyQueen()) {
    boolean canWork=queenCanWork();
    boolean hasFlowers=hasFlowers();
    return hasSpace && canWork && hasFlowers;
  }
  return false;
}
Program: 63696
Project: 63696
Buggy source:
private boolean queenCanWork(){
  if (queen == null) {
    return false;
  }
  if (housingSupportsMultipleErrorStates) {
    try {
      Set<IErrorState> errorStates=queen.getCanWork(housing);
      for (      IErrorState errorState : errorStates) {
        housing.setErrorCondition(true,errorState);
      }
      return (errorStates.size() == 0);
    }
 catch (    Throwable ignored) {
    }
  }
  IErrorState state=queen.canWork(housing);
  if (state != EnumErrorCode.OK) {
    housing.setErrorState(state);
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean queenCanWork(){
  if (queenCanWorkCooldown > 0) {
    queenCanWorkCooldown--;
  }
 else {
    if (queen == null) {
      return false;
    }
    queenCanWorkCached=checkQueenCanWork();
    queenCanWorkCooldown=ticksPerCheckQueenCanWork;
  }
  Set<IErrorState> errorStates=queenCanWorkCached;
  if (errorStates.size() > 0) {
    if (housingSupportsMultipleErrorStates) {
      for (      IErrorState errorState : errorStates) {
        housing.setErrorCondition(true,errorState);
      }
    }
 else {
      IErrorState state=errorStates.iterator().next();
      housing.setErrorState(state);
    }
    return false;
  }
 else {
    return true;
  }
}
Program: 63697
Project: 63697
Buggy source:
private boolean hasHealthyQueen(){
  boolean hasQueen=true;
  EnumErrorCode housingErrorState=null;
  ItemStack queenStack=housing.getQueen();
  if (queenStack == null || !ForestryItem.beeQueenGE.isItemEqual(housing.getQueen())) {
    housingErrorState=EnumErrorCode.NOQUEEN;
    hasQueen=false;
    queen=null;
  }
 else   if (!isQueenAlive(queenStack)) {
    if (queen == null) {
      queen=BeeManager.beeRoot.getMember(queenStack);
    }
    killQueen();
    housingErrorState=EnumErrorCode.OK;
    hasQueen=false;
    queen=null;
  }
  if (housingSupportsMultipleErrorStates) {
    housing.setErrorCondition(!hasQueen,EnumErrorCode.NOQUEEN);
  }
 else {
    if (housingErrorState != null) {
      housing.setErrorState(housingErrorState);
    }
  }
  if (hasQueen && queen == null) {
    queen=BeeManager.beeRoot.getMember(queenStack);
  }
  return hasQueen;
}

Fixed version (ground truth):
private boolean hasHealthyQueen(){
  boolean hasQueen=true;
  EnumErrorCode housingErrorState=null;
  ItemStack queenStack=housing.getQueen();
  if (queenStack == null || !ForestryItem.beeQueenGE.isItemEqual(queenStack)) {
    housingErrorState=EnumErrorCode.NOQUEEN;
    hasQueen=false;
    queen=null;
  }
 else   if (!isQueenAlive(queenStack)) {
    if (queen == null) {
      queen=BeeManager.beeRoot.getMember(queenStack);
    }
    killQueen();
    housingErrorState=EnumErrorCode.OK;
    hasQueen=false;
    queen=null;
  }
  if (housingSupportsMultipleErrorStates) {
    housing.setErrorCondition(!hasQueen,EnumErrorCode.NOQUEEN);
  }
 else {
    if (housingErrorState != null) {
      housing.setErrorState(housingErrorState);
    }
  }
  if (hasQueen && queen == null) {
    queen=BeeManager.beeRoot.getMember(queenStack);
  }
  return hasQueen;
}
Program: 63698
Project: 63698
Buggy source:
private static void onPOBoxInfoRequest(EntityPlayer player){
  MailAddress address=new MailAddress(player.getGameProfile());
  POBox pobox=PostRegistry.getPOBox(player.worldObj,address);
  if (pobox == null) {
    return;
  }
  Proxies.net.sendToPlayer(new PacketPOBoxInfo(PacketId.POBOX_INFO,pobox.getPOBoxInfo()),player);
}

Fixed version (ground truth):
private static void onPOBoxInfoRequest(EntityPlayer player){
  MailAddress address=new MailAddress(player.getGameProfile());
  POBox pobox=PostRegistry.getOrCreatePOBox(player.worldObj,address);
  if (pobox == null) {
    return;
  }
  Proxies.net.sendToPlayer(new PacketPOBoxInfo(PacketId.POBOX_INFO,pobox.getPOBoxInfo()),player);
}
Program: 63699
Project: 63699
Buggy source:
public void readFromNBT(NBTTagCompound nbt){
  if (nbt == null) {
    return;
  }
  if (nbt.hasKey(KEY_SLOTS)) {
    NBTTagCompound nbtSlots=nbt.getCompoundTag(KEY_SLOTS);
    for (int i=0; i < inventoryStacks.length; i++) {
      String slotKey=getSlotNBTKey(i);
      if (nbtSlots.hasKey(slotKey)) {
        NBTTagCompound itemNbt=nbtSlots.getCompoundTag(slotKey);
        ItemStack itemStack=ItemStack.loadItemStackFromNBT(itemNbt);
        inventoryStacks[i]=itemStack;
      }
 else {
        inventoryStacks[i]=null;
      }
    }
  }
 else {
    if (nbt.hasKey(KEY_ITEMS)) {
      for (int i=0; i < inventoryStacks.length; i++) {
        inventoryStacks[i]=null;
      }
      NBTTagList nbttaglist=nbt.getTagList(KEY_ITEMS,10);
      for (int i=0; i < nbttaglist.tagCount(); i++) {
        NBTTagCompound nbttagcompound1=nbttaglist.getCompoundTagAt(i);
        byte byte0=nbttagcompound1.getByte("String_Node_Str");
        if (byte0 >= 0 && byte0 < inventoryStacks.length) {
          ItemStack itemStack=ItemStack.loadItemStackFromNBT(nbttagcompound1);
          inventoryStacks[byte0]=itemStack;
        }
      }
      migrateToNewNBT();
    }
  }
}

Fixed version (ground truth):
public void readFromNBT(NBTTagCompound nbt){
  if (nbt == null) {
    return;
  }
  if (nbt.hasKey(KEY_SLOTS)) {
    NBTTagCompound nbtSlots=nbt.getCompoundTag(KEY_SLOTS);
    for (int i=0; i < inventoryStacks.length; i++) {
      String slotKey=getSlotNBTKey(i);
      if (nbtSlots.hasKey(slotKey)) {
        NBTTagCompound itemNbt=nbtSlots.getCompoundTag(slotKey);
        ItemStack itemStack=ItemStack.loadItemStackFromNBT(itemNbt);
        inventoryStacks[i]=itemStack;
      }
 else {
        inventoryStacks[i]=null;
      }
    }
  }
 else {
    if (nbt.hasKey(KEY_ITEMS)) {
      for (int i=0; i < inventoryStacks.length; i++) {
        inventoryStacks[i]=null;
      }
      NBTTagList nbttaglist=nbt.getTagList(KEY_ITEMS,10);
      for (int i=0; i < nbttaglist.tagCount(); i++) {
        NBTTagCompound nbttagcompound1=nbttaglist.getCompoundTagAt(i);
        byte byte0=nbttagcompound1.getByte("String_Node_Str");
        if (byte0 >= 0 && byte0 < inventoryStacks.length) {
          ItemStack itemStack=ItemStack.loadItemStackFromNBT(nbttagcompound1);
          inventoryStacks[byte0]=itemStack;
        }
      }
      writeToParentNBT();
    }
  }
}
Program: 63700
Project: 63700
Buggy source:
@Override public final void markDirty(){
}

Fixed version (ground truth):
@Override public final void markDirty(){
  writeToParentNBT();
}
Program: 63701
Project: 63701
Buggy source:
private void registerFlower(Block block,int meta,double weight,String... flowerTypes){
  if (block == null) {
    return;
  }
  if (weight <= 0.0) {
    weight=0.0;
  }
  if (weight >= 1.0) {
    weight=1.0;
  }
  Flower newFlower=new Flower(block,meta,weight);
  Integer index;
  for (  String flowerType : flowerTypes) {
    List<IFlower> flowers=this.registeredFlowers.get(flowerType);
    index=flowers.indexOf(newFlower);
    if (index == -1) {
      flowers.add(newFlower);
    }
 else     if (flowers.get(index).getWeight() > newFlower.getWeight()) {
      flowers.get(index).setWeight(newFlower.getWeight());
    }
    if (this.chances.containsKey(flowerType)) {
      this.chances.remove(flowerType);
    }
    Collections.sort(this.registeredFlowers.get(flowerType));
  }
}

Fixed version (ground truth):
private void registerFlower(Block block,int meta,double weight,String... flowerTypes){
  if (block == null) {
    return;
  }
  if (weight <= 0.0) {
    weight=0.0;
  }
  if (weight >= 1.0) {
    weight=1.0;
  }
  Flower newFlower=new Flower(block,meta,weight);
  Integer index;
  for (  String flowerType : flowerTypes) {
    List<IFlower> flowers=this.registeredFlowers.get(flowerType);
    index=flowers.indexOf(newFlower);
    if (index == -1) {
      flowers.add(newFlower);
    }
 else     if (flowers.get(index).getMeta() != newFlower.getMeta()) {
      flowers.add(newFlower);
    }
 else     if (flowers.get(index).getWeight() < newFlower.getWeight()) {
      flowers.get(index).setWeight(newFlower.getWeight());
    }
    if (this.chances.containsKey(flowerType)) {
      this.chances.remove(flowerType);
    }
    Collections.sort(this.registeredFlowers.get(flowerType));
  }
}
Program: 63702
Project: 63702
Buggy source:
@Override public void fromPacketPayload(PacketPayload payload){
  EnumFarmBlock farmType=EnumFarmBlock.values()[payload.shortPayload[0]];
  if (payload.shortPayload[1] > 0) {
    makeMaster();
  }
  this.masterY=payload.shortPayload[2];
  if (this.farmBlock != farmType) {
    this.farmBlock=farmType;
    worldObj.func_147479_m(xCoord,yCoord,zCoord);
  }
}

Fixed version (ground truth):
@Override public void fromPacketPayload(PacketPayload payload){
  EnumFarmBlock farmType=EnumFarmBlock.values()[payload.shortPayload[0]];
  if (payload.shortPayload[1] > 0 && !isMaster()) {
    makeMaster();
  }
  this.masterY=payload.shortPayload[2];
  if (this.farmBlock != farmType) {
    this.farmBlock=farmType;
    worldObj.func_147479_m(xCoord,yCoord,zCoord);
  }
}
Program: 63704
Project: 63704
Buggy source:
private boolean cultivateTargets(List<FarmTarget> farmTargets,IFarmLogic logic){
  boolean didWork=false;
  boolean hasFarmland=false;
  boolean hasFertilizer=false;
  boolean hasLiquid=false;
  for (  FarmTarget target : farmTargets) {
    if (target.getExtent() <= 0) {
      break;
    }
 else {
      hasFarmland=true;
    }
    if (!hasFertilizer(logic.getFertilizerConsumption())) {
      continue;
    }
 else {
      hasFertilizer=true;
    }
    int liquidAmount=logic.getWaterConsumption(getHydrationModifier());
    FluidStack liquid=Fluids.WATER.getFluid(liquidAmount);
    if (liquid.amount > 0 && !hasLiquid(liquid)) {
      continue;
    }
 else {
      hasLiquid=true;
    }
    if (cultivateTarget(target,logic)) {
      removeFertilizer(logic.getFertilizerConsumption());
      removeLiquid(liquid);
      didWork=true;
    }
  }
  if (!hasFarmland) {
    setErrorState(EnumErrorCode.NOFARMLAND);
  }
 else   if (!hasFertilizer) {
    setErrorState(EnumErrorCode.NOFERTILIZER);
  }
 else   if (!hasLiquid) {
    setErrorState(EnumErrorCode.NOLIQUID);
  }
 else {
    setErrorState(EnumErrorCode.OK);
  }
  return didWork;
}

Fixed version (ground truth):
private FarmWorkStatus cultivateTargets(FarmWorkStatus farmWorkStatus,List<FarmTarget> farmTargets,IFarmLogic logic){
  for (  FarmTarget target : farmTargets) {
    if (target.getExtent() <= 0) {
      break;
    }
 else {
      farmWorkStatus.hasFarmland=true;
    }
    if (!hasFertilizer(logic.getFertilizerConsumption())) {
      continue;
    }
 else {
      farmWorkStatus.hasFertilizer=true;
    }
    int liquidAmount=logic.getWaterConsumption(getHydrationModifier());
    FluidStack liquid=Fluids.WATER.getFluid(liquidAmount);
    if (liquid.amount > 0 && !hasLiquid(liquid)) {
      continue;
    }
 else {
      farmWorkStatus.hasLiquid=true;
    }
    if (cultivateTarget(target,logic)) {
      removeFertilizer(logic.getFertilizerConsumption());
      removeLiquid(liquid);
      farmWorkStatus.didWork=true;
    }
  }
  return farmWorkStatus;
}
Program: 63705
Project: 63705
Buggy source:
private void drawTradePreview(int x,int y){
  fontRendererObj.drawString(boldUnderline + container.getTradeInfo().address.getName(),x,y,fontColor.get("String_Node_Str"));
  TradeStationInfo info=container.getTradeInfo();
  fontRendererObj.drawString(String.format(StringUtil.localize("String_Node_Str"),info.owner.getName()),x,y + 18,fontColor.get("String_Node_Str"));
  clearTradeInfoWidgets();
  addTradeInfoWidget(new ItemStackWidget(x - guiLeft,y - guiTop + 28,info.tradegood));
  fontRendererObj.drawString(StringUtil.localize("String_Node_Str"),x,y + 46,fontColor.get("String_Node_Str"));
  for (int i=0; i < container.getTradeInfo().required.length; i++) {
    addTradeInfoWidget(new ItemStackWidget(x - guiLeft + i * 18,y - guiTop + 56,info.required[i]));
  }
  if (info.state.isOk())   fontRendererObj.drawSplitString(EnumChatFormatting.DARK_GREEN + StringUtil.localize("String_Node_Str" + info.state.getIdentifier()),x,y + 82,119,fontColor.get("String_Node_Str"));
 else   fontRendererObj.drawSplitString(EnumChatFormatting.DARK_RED + StringUtil.localize("String_Node_Str" + info.state.getIdentifier()),x,y + 82,119,fontColor.get("String_Node_Str"));
}

Fixed version (ground truth):
private void drawTradePreview(int x,int y){
  fontRendererObj.drawString(boldUnderline + container.getTradeInfo().address.getName(),x,y,fontColor.get("String_Node_Str"));
  TradeStationInfo info=container.getTradeInfo();
  fontRendererObj.drawString(String.format(StringUtil.localize("String_Node_Str"),info.owner.getName()),x,y + 18,fontColor.get("String_Node_Str"));
  addTradeInfoWidget(new ItemStackWidget(x - guiLeft,y - guiTop + 28,info.tradegood));
  fontRendererObj.drawString(StringUtil.localize("String_Node_Str"),x,y + 46,fontColor.get("String_Node_Str"));
  for (int i=0; i < container.getTradeInfo().required.length; i++) {
    addTradeInfoWidget(new ItemStackWidget(x - guiLeft + i * 18,y - guiTop + 56,info.required[i]));
  }
  if (info.state.isOk())   fontRendererObj.drawSplitString(EnumChatFormatting.DARK_GREEN + StringUtil.localize("String_Node_Str" + info.state.getIdentifier()),x,y + 82,119,fontColor.get("String_Node_Str"));
 else   fontRendererObj.drawSplitString(EnumChatFormatting.DARK_RED + StringUtil.localize("String_Node_Str" + info.state.getIdentifier()),x,y + 82,119,fontColor.get("String_Node_Str"));
}
Program: 63706
Project: 63706
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float var1,int mouseX,int mouseY){
  super.drawGuiContainerBackgroundLayer(var1,mouseX,mouseY);
  fontRendererObj.drawString(String.format("String_Node_Str",container.getCurrentPos(),container.getMaxCount()),guiLeft + xSize - 72,guiTop + 12,fontColor.get("String_Node_Str"));
  if (container.getTradeInfo() != null)   drawTradePreview(guiLeft + 38,guiTop + 30);
 else   drawNoTrade(guiLeft + 38,guiTop + 30);
  buttonFilter.displayString=StringUtil.localize("String_Node_Str" + container.getFilterIdent());
  buttonCopy.enabled=container.getTradeInfo() != null && container.getTradeInfo().state.isOk();
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float var1,int mouseX,int mouseY){
  super.drawGuiContainerBackgroundLayer(var1,mouseX,mouseY);
  fontRendererObj.drawString(String.format("String_Node_Str",container.getCurrentPos(),container.getMaxCount()),guiLeft + xSize - 72,guiTop + 12,fontColor.get("String_Node_Str"));
  clearTradeInfoWidgets();
  if (container.getTradeInfo() != null)   drawTradePreview(guiLeft + 38,guiTop + 30);
 else   drawNoTrade(guiLeft + 38,guiTop + 30);
  buttonFilter.displayString=StringUtil.localize("String_Node_Str" + container.getFilterIdent());
  buttonCopy.enabled=container.getTradeInfo() != null && container.getTradeInfo().state.isOk();
}
Program: 63708
Project: 63708
Buggy source:
@Override public Collection<ICrop> harvest(int x,int y,int z,ForgeDirection direction,int extent){
  World world=getWorld();
  Stack<ICrop> crops=new Stack<ICrop>();
  for (int i=0; i < extent; i++) {
    Vect position=translateWithOffset(x,y,z,direction,i);
    ItemStack occupant=getAsItemStack(position);
    if (occupant == null)     continue;
    Block block=BlockSoil.getBlockFromItem(occupant.getItem());
    if (block == null || !(block instanceof BlockSoil))     continue;
    BlockSoil blockSoil=(BlockSoil)block;
    BlockSoil.SoilType soilType=blockSoil.getTypeFromMeta(occupant.getItemDamage());
    if (soilType == BlockSoil.SoilType.PEAT)     crops.push(new CropPeat(world,position));
  }
  return crops;
}

Fixed version (ground truth):
@Override public Collection<ICrop> harvest(int x,int y,int z,ForgeDirection direction,int extent){
  World world=getWorld();
  Stack<ICrop> crops=new Stack<ICrop>();
  for (int i=0; i < extent; i++) {
    Vect position=translateWithOffset(x,y,z,direction,i);
    ItemStack occupant=getAsItemStack(position);
    if (occupant.getItem() == null)     continue;
    Block block=BlockSoil.getBlockFromItem(occupant.getItem());
    if (block == null || !(block instanceof BlockSoil))     continue;
    BlockSoil blockSoil=(BlockSoil)block;
    BlockSoil.SoilType soilType=blockSoil.getTypeFromMeta(occupant.getItemDamage());
    if (soilType == BlockSoil.SoilType.PEAT)     crops.push(new CropPeat(world,position));
  }
  return crops;
}
Program: 63709
Project: 63709
Buggy source:
@Override public ItemStack getCraftingResult(InventoryCrafting crafting){
  IButterfly butterfly=null;
  IButterfly serum=null;
  for (int i=0; i < crafting.getSizeInventory(); i++) {
    if (PluginLepidopterology.butterflyInterface.isMember(crafting.getStackInSlot(i),EnumFlutterType.BUTTERFLY.ordinal())) {
      butterfly=PluginLepidopterology.butterflyInterface.getMember(crafting.getStackInSlot(i));
    }
 else     if (PluginLepidopterology.butterflyInterface.isMember(crafting.getStackInSlot(i),EnumFlutterType.SERUM.ordinal()))     serum=PluginLepidopterology.butterflyInterface.getMember(crafting.getStackInSlot(i));
  }
  IButterfly mated=butterfly.copy();
  mated.mate(serum);
  return PluginLepidopterology.butterflyInterface.getMemberStack(mated,EnumFlutterType.BUTTERFLY.ordinal());
}

Fixed version (ground truth):
@Override public ItemStack getCraftingResult(InventoryCrafting crafting){
  IButterfly butterfly=null;
  IButterfly serum=null;
  for (int i=0; i < crafting.getSizeInventory(); i++) {
    if (PluginLepidopterology.butterflyInterface.isMember(crafting.getStackInSlot(i),EnumFlutterType.BUTTERFLY.ordinal())) {
      butterfly=PluginLepidopterology.butterflyInterface.getMember(crafting.getStackInSlot(i));
    }
 else     if (PluginLepidopterology.butterflyInterface.isMember(crafting.getStackInSlot(i),EnumFlutterType.SERUM.ordinal()))     serum=PluginLepidopterology.butterflyInterface.getMember(crafting.getStackInSlot(i));
  }
  if (butterfly == null || serum == null)   return null;
  IButterfly mated=butterfly.copy();
  mated.mate(serum);
  return PluginLepidopterology.butterflyInterface.getMemberStack(mated,EnumFlutterType.BUTTERFLY.ordinal());
}
Program: 63710
Project: 63710
Buggy source:
@Override public boolean shouldExecute(){
  player=entity.worldObj.getClosestPlayerToEntity(entity,entity.getButterfly().getGenome().getPrimary().getFlightDistance());
  if (player == null || player.isSneaking())   return false;
  if (!entity.getEntitySenses().canSee(player))   return false;
  flightTarget=getRandomDestination();
  if (flightTarget == null)   return false;
  if (player.getDistanceSq(flightTarget.posX,flightTarget.posY,flightTarget.posZ) < player.getDistanceSqToEntity(entity))   return false;
  entity.setDestination(flightTarget);
  entity.setState(EnumButterflyState.FLYING);
  return true;
}

Fixed version (ground truth):
@Override public boolean shouldExecute(){
  EntityPlayer player=entity.worldObj.getClosestPlayerToEntity(entity,entity.getButterfly().getGenome().getPrimary().getFlightDistance());
  if (player == null || player.isSneaking())   return false;
  if (!entity.getEntitySenses().canSee(player))   return false;
  flightTarget=getRandomDestination();
  if (flightTarget == null)   return false;
  if (player.getDistanceSq(flightTarget.posX,flightTarget.posY,flightTarget.posZ) < player.getDistanceSqToEntity(entity))   return false;
  entity.setDestination(flightTarget);
  entity.setState(EnumButterflyState.FLYING);
  return true;
}
Program: 63711
Project: 63711
Buggy source:
@Override public IInventory getInventory(){
  return getInternalInventory();
}

Fixed version (ground truth):
@Override public final IInventory getInventory(){
  return getStructureInventory();
}
Program: 63712
Project: 63712
Buggy source:
@Override protected void updateServerSide(){
  super.updateServerSide();
  if (transferTime <= 0 && liquidTank.getFluidAmount() > 0) {
    currentRecipe=getRecipe(liquidTank.getFluid());
    if (currentRecipe != null) {
      liquidTank.drain(currentRecipe.liquid.amount,true);
      transferTime=currentRecipe.transferTime;
    }
  }
  if (transferTime > 0) {
    transferTime--;
    if (currentRecipe != null) {
      IAlvearyComponent component=(IAlvearyComponent)this.getCentralTE();
      if (component != null) {
        component.addHumidityChange(currentRecipe.humidChange,0.0f,1.0f);
        component.addTemperatureChange(currentRecipe.tempChange,0.0f,2.0f);
      }
    }
 else     transferTime=0;
  }
  if (worldObj.getTotalWorldTime() % 20 * 10 != 0)   return;
  TileInventoryAdapter canInventory=getInternalInventory();
  if (canInventory.getStackInSlot(0) != null) {
    FluidHelper.drainContainers(tankManager,canInventory,0);
  }
}

Fixed version (ground truth):
@Override protected void updateServerSide(){
  super.updateServerSide();
  if (transferTime <= 0 && liquidTank.getFluidAmount() > 0) {
    currentRecipe=getRecipe(liquidTank.getFluid());
    if (currentRecipe != null) {
      liquidTank.drain(currentRecipe.liquid.amount,true);
      transferTime=currentRecipe.transferTime;
    }
  }
  if (transferTime > 0) {
    transferTime--;
    if (currentRecipe != null) {
      IAlvearyComponent component=(IAlvearyComponent)this.getCentralTE();
      if (component != null) {
        component.addHumidityChange(currentRecipe.humidChange,0.0f,1.0f);
        component.addTemperatureChange(currentRecipe.tempChange,0.0f,2.0f);
      }
    }
 else     transferTime=0;
  }
  if (worldObj.getTotalWorldTime() % 20 * 10 != 0)   return;
  TileInventoryAdapter canInventory=getInternalInventory();
  if (canInventory.getStackInSlot(0) != null)   FluidHelper.drainContainers(tankManager,canInventory,0);
}
Program: 63713
Project: 63713
Buggy source:
@Override public void setInventorySlotContents(int slotIndex,ItemStack itemstack){
  TileInventoryAdapter inventory=getInternalInventory();
  if (inventory == null && !Proxies.common.isSimulating(worldObj))   createInventory();
  IInventory inv=getStructureInventory();
  if (inv != null)   inv.setInventorySlotContents(slotIndex,itemstack);
}

Fixed version (ground truth):
@Override public void setInventorySlotContents(int slotIndex,ItemStack itemstack){
  IInventory inv=getStructureInventory();
  if (inv == null && !Proxies.common.isSimulating(worldObj)) {
    createInventory();
    inv=getInternalInventory();
  }
  if (inv != null)   inv.setInventorySlotContents(slotIndex,itemstack);
}
Program: 63714
Project: 63714
Buggy source:
@Override public boolean canExtractItem(int slotIndex,ItemStack itemstack,int side){
  TileInventoryAdapter inventory=getInternalInventory();
  if (inventory == null)   return false;
  if (!inventory.canExtractItem(slotIndex,itemstack,side))   return false;
  return slotIndex != SLOT_QUEEN && slotIndex != SLOT_DRONE;
}

Fixed version (ground truth):
@Override public boolean canExtractItem(int slotIndex,ItemStack itemstack,int side){
  ISidedInventory inventory=getStructureInventory();
  if (inventory == null)   return false;
  if (!inventory.canExtractItem(slotIndex,itemstack,side))   return false;
  return slotIndex != SLOT_QUEEN && slotIndex != SLOT_DRONE;
}
Program: 63715
Project: 63715
Buggy source:
private int getHealthDisplay(){
  IInventory inventory=getInternalInventory();
  if (inventory == null || inventory.getStackInSlot(SLOT_QUEEN) == null)   return 0;
  if (PluginApiculture.beeInterface.isMated(inventory.getStackInSlot(SLOT_QUEEN)))   return PluginApiculture.beeInterface.getMember(inventory.getStackInSlot(SLOT_QUEEN)).getHealth();
 else   if (!PluginApiculture.beeInterface.isDrone(inventory.getStackInSlot(SLOT_QUEEN)))   return displayHealth;
 else   return 0;
}

Fixed version (ground truth):
private int getHealthDisplay(){
  IInventory inventory=getStructureInventory();
  if (inventory == null || inventory.getStackInSlot(SLOT_QUEEN) == null)   return 0;
  if (PluginApiculture.beeInterface.isMated(inventory.getStackInSlot(SLOT_QUEEN)))   return PluginApiculture.beeInterface.getMember(inventory.getStackInSlot(SLOT_QUEEN)).getHealth();
 else   if (!PluginApiculture.beeInterface.isDrone(inventory.getStackInSlot(SLOT_QUEEN)))   return displayHealth;
 else   return 0;
}
Program: 63716
Project: 63716
Buggy source:
private int getMaxHealthDisplay(){
  IInventory inventory=getInternalInventory();
  if (inventory == null || inventory.getStackInSlot(SLOT_QUEEN) == null)   return 0;
  if (PluginApiculture.beeInterface.isMated(inventory.getStackInSlot(SLOT_QUEEN)))   return PluginApiculture.beeInterface.getMember(inventory.getStackInSlot(SLOT_QUEEN)).getMaxHealth();
 else   if (!PluginApiculture.beeInterface.isDrone(inventory.getStackInSlot(SLOT_QUEEN)))   return displayHealthMax;
 else   return 0;
}

Fixed version (ground truth):
private int getMaxHealthDisplay(){
  IInventory inventory=getStructureInventory();
  if (inventory == null || inventory.getStackInSlot(SLOT_QUEEN) == null)   return 0;
  if (PluginApiculture.beeInterface.isMated(inventory.getStackInSlot(SLOT_QUEEN)))   return PluginApiculture.beeInterface.getMember(inventory.getStackInSlot(SLOT_QUEEN)).getMaxHealth();
 else   if (!PluginApiculture.beeInterface.isDrone(inventory.getStackInSlot(SLOT_QUEEN)))   return displayHealthMax;
 else   return 0;
}
Program: 63717
Project: 63717
Buggy source:
@Override protected void updateServerSide(){
  if (beekeepingLogic == null)   return;
  if (!isMaster())   return;
  beekeepingLogic.update();
  equalizeTemperature();
  equalizeHumidity();
  IBee queen=beekeepingLogic.getQueen();
  if (queen == null)   return;
  if (worldObj.getTotalWorldTime() % 200 * 10 == 0)   onQueenChange(getInternalInventory().getStackInSlot(SLOT_QUEEN));
  if (getErrorState() == EnumErrorCode.OK)   queen.doFX(beekeepingLogic.getEffectData(),this);
  if (getErrorState() == EnumErrorCode.OK && worldObj.getTotalWorldTime() % 50 == 0) {
    float f=xCoord + 0.5F;
    float f1=yCoord + 0.0F + (worldObj.rand.nextFloat() * 6F) / 16F;
    float f2=zCoord + 0.5F;
    float f3=0.52F;
    float f4=worldObj.rand.nextFloat() * 0.6F - 0.3F;
    Proxies.common.addEntitySwarmFX(worldObj,(f - f3),f1,(f2 + f4),0F,0F,0F);
    Proxies.common.addEntitySwarmFX(worldObj,(f + f3),f1,(f2 + f4),0F,0F,0F);
    Proxies.common.addEntitySwarmFX(worldObj,(f + f4),f1,(f2 - f3),0F,0F,0F);
    Proxies.common.addEntitySwarmFX(worldObj,(f + f4),f1,(f2 + f3),0F,0F,0F);
  }
}

Fixed version (ground truth):
@Override protected void updateServerSide(){
  if (beekeepingLogic == null)   return;
  if (!isMaster())   return;
  beekeepingLogic.update();
  equalizeTemperature();
  equalizeHumidity();
  IBee queen=beekeepingLogic.getQueen();
  if (queen == null)   return;
  if (worldObj.getTotalWorldTime() % 200 * 10 == 0)   onQueenChange(getStructureInventory().getStackInSlot(SLOT_QUEEN));
  if (getErrorState() == EnumErrorCode.OK)   queen.doFX(beekeepingLogic.getEffectData(),this);
  if (getErrorState() == EnumErrorCode.OK && worldObj.getTotalWorldTime() % 50 == 0) {
    float f=xCoord + 0.5F;
    float f1=yCoord + 0.0F + (worldObj.rand.nextFloat() * 6F) / 16F;
    float f2=zCoord + 0.5F;
    float f3=0.52F;
    float f4=worldObj.rand.nextFloat() * 0.6F - 0.3F;
    Proxies.common.addEntitySwarmFX(worldObj,(f - f3),f1,(f2 + f4),0F,0F,0F);
    Proxies.common.addEntitySwarmFX(worldObj,(f + f3),f1,(f2 + f4),0F,0F,0F);
    Proxies.common.addEntitySwarmFX(worldObj,(f + f4),f1,(f2 - f3),0F,0F,0F);
    Proxies.common.addEntitySwarmFX(worldObj,(f + f4),f1,(f2 + f3),0F,0F,0F);
  }
}
Program: 63718
Project: 63718
Buggy source:
@Override public boolean addProduct(ItemStack product,boolean all){
  TileInventoryAdapter inventory=getInternalInventory();
  if (inventory == null)   return false;
  return inventory.tryAddStack(product,SLOT_PRODUCT_1,inventory.getSizeInventory() - SLOT_PRODUCT_1,all);
}

Fixed version (ground truth):
@Override public boolean addProduct(ItemStack product,boolean all){
  TileInventoryAdapter inventory=getStructureInventory();
  if (inventory == null)   return false;
  return inventory.tryAddStack(product,SLOT_PRODUCT_1,inventory.getSizeInventory() - SLOT_PRODUCT_1,all);
}
Program: 63719
Project: 63719
Buggy source:
@Override public int[] getAccessibleSlotsFromSide(int side){
  TileInventoryAdapter inventory=getInternalInventory();
  if (inventory == null)   return Defaults.FACINGS_NONE;
  return inventory.getAccessibleSlotsFromSide(side);
}

Fixed version (ground truth):
@Override public int[] getAccessibleSlotsFromSide(int side){
  ISidedInventory inventory=getStructureInventory();
  if (inventory == null)   return Defaults.FACINGS_NONE;
  return inventory.getAccessibleSlotsFromSide(side);
}
Program: 63720
Project: 63720
Buggy source:
@Override protected void updateClientSide(){
  if (!isMaster())   return;
  if (getInternalInventory() == null)   return;
  if (PluginApiculture.beeInterface.isMated(getInternalInventory().getStackInSlot(SLOT_QUEEN)))   if (getErrorState() == EnumErrorCode.OK && worldObj.getTotalWorldTime() % 2 == 0) {
    IBee displayQueen=PluginApiculture.beeInterface.getMember(getInternalInventory().getStackInSlot(SLOT_QUEEN));
    displayQueen.doFX(beekeepingLogic.getEffectData(),this);
  }
}

Fixed version (ground truth):
@Override protected void updateClientSide(){
  if (!isMaster())   return;
  if (getStructureInventory() == null)   return;
  if (PluginApiculture.beeInterface.isMated(getStructureInventory().getStackInSlot(SLOT_QUEEN)))   if (getErrorState() == EnumErrorCode.OK && worldObj.getTotalWorldTime() % 2 == 0) {
    IBee displayQueen=PluginApiculture.beeInterface.getMember(getStructureInventory().getStackInSlot(SLOT_QUEEN));
    displayQueen.doFX(beekeepingLogic.getEffectData(),this);
  }
}
Program: 63721
Project: 63721
Buggy source:
private IInventory getStructureInventory(){
  TileInventoryAdapter inventory=getInternalInventory();
  if (inventory != null) {
    if (isMaster() || !Proxies.common.isSimulating(worldObj))     return inventory;
  }
 else   if (hasMaster()) {
    ITileStructure central=getCentralTE();
    if (central != null)     return central.getInventory();
  }
  return null;
}

Fixed version (ground truth):
@Override public TileInventoryAdapter getStructureInventory(){
  TileInventoryAdapter inventory=getInternalInventory();
  if (inventory != null) {
    if (isMaster() || !Proxies.common.isSimulating(worldObj))     return inventory;
  }
 else   if (hasMaster()) {
    ITileStructure central=getCentralTE();
    if (central != null)     return (TileInventoryAdapter)central.getInventory();
  }
  return null;
}
Program: 63722
Project: 63722
Buggy source:
@Override public boolean isItemValidForSlot(int slotIndex,ItemStack itemstack){
  TileInventoryAdapter inventory=getInternalInventory();
  if (inventory == null)   return false;
  if (!inventory.isItemValidForSlot(slotIndex,itemstack))   return false;
  if (slotIndex == SLOT_QUEEN && PluginApiculture.beeInterface.isMember(itemstack) && !PluginApiculture.beeInterface.isDrone(itemstack))   return true;
  return slotIndex == SLOT_DRONE && PluginApiculture.beeInterface.isDrone(itemstack);
}

Fixed version (ground truth):
@Override public boolean isItemValidForSlot(int slotIndex,ItemStack itemstack){
  ISidedInventory inventory=getStructureInventory();
  if (inventory == null)   return false;
  if (!inventory.isItemValidForSlot(slotIndex,itemstack))   return false;
  if (slotIndex == SLOT_QUEEN && PluginApiculture.beeInterface.isMember(itemstack) && !PluginApiculture.beeInterface.isDrone(itemstack))   return true;
  return slotIndex == SLOT_DRONE && PluginApiculture.beeInterface.isDrone(itemstack);
}
Program: 63723
Project: 63723
Buggy source:
public int getIcon(int side,int metadata){
  if (side == 0 || side == 1)   return BlockAlveary.BOTTOM;
  return BlockAlveary.STABILISER;
}

Fixed version (ground truth):
@Override public int getIcon(int side,int metadata){
  if (side == 0 || side == 1)   return BlockAlveary.BOTTOM;
  return BlockAlveary.STABILISER;
}
Program: 63724
Project: 63724
Buggy source:
@Override public void onNeighborBlockChange(World world,int x,int y,int z,Block neighbour){
  if (Proxies.common.isSimulating(world) && !this.canBlockStay(world,x,y,z)) {
    dropAsSapling(world,x,y,z);
    world.setBlockToAir(x,y,z);
  }
}

Fixed version (ground truth):
@Override public void onNeighborBlockChange(World world,int x,int y,int z,Block neighbour){
  super.onNeighborBlockChange(world,x,y,z,neighbour);
  if (Proxies.common.isSimulating(world) && !this.canBlockStay(world,x,y,z)) {
    dropAsSapling(world,x,y,z);
    world.setBlockToAir(x,y,z);
  }
}
Program: 63725
Project: 63725
Buggy source:
@Override public void initialize(){
  super.initialize();
  this.biome=Utils.getBiomeAt(worldObj,xCoord,zCoord);
  setErrorState(EnumErrorCode.OK);
}

Fixed version (ground truth):
@Override public void initialize(){
  super.initialize();
  setBiomeInformation();
}
Program: 63727
Project: 63727
Buggy source:
@Override public void updateServerSide(){
  if (ic2EnergySink == null) {
    setErrorState(EnumErrorCode.NOENERGYNET);
    return;
  }
  ic2EnergySink.updateEntity();
  super.updateServerSide();
  if (forceCooldown) {
    setErrorState(EnumErrorCode.FORCEDCOOLDOWN);
    return;
  }
  if (inventory.getStackInSlot(batterySlot) != null)   replenishFromBattery(batterySlot);
  if (!delayUpdateTimer.delayPassed(worldObj,80))   return;
  if (currentOutput <= 0 && getErrorState() == EnumErrorCode.OK)   setErrorState(EnumErrorCode.NOFUEL);
 else   setErrorState(EnumErrorCode.OK);
}

Fixed version (ground truth):
@Override public void updateServerSide(){
  if (ic2EnergySink == null) {
    setErrorState(EnumErrorCode.NOENERGYNET);
    return;
  }
  ic2EnergySink.updateEntity();
  super.updateServerSide();
  if (forceCooldown) {
    setErrorState(EnumErrorCode.FORCEDCOOLDOWN);
    return;
  }
  if (inventory.getStackInSlot(batterySlot) != null)   replenishFromBattery(batterySlot);
  if (!delayUpdateTimer.delayPassed(worldObj,80))   return;
  if (currentOutput <= 0)   setErrorState(EnumErrorCode.NOFUEL);
 else   setErrorState(EnumErrorCode.OK);
}
Program: 63729
Project: 63729
Buggy source:
@Override public boolean workCycle(){
  if (currentRecipe == null) {
    checkRecipe();
    resetRecipe();
    if (currentRecipe != null) {
      currentResourceModifier=determineResourceMod(inventory.getStackInSlot(SLOT_RESOURCE));
      decrStackSize(SLOT_RESOURCE,1);
      return true;
    }
 else     return false;
  }
 else   if (fuelBurnTime > 0) {
    if (currentRecipe == null) {
      throw new NullPointerException("String_Node_Str");
    }
    if (resourceTank.getFluidAmount() < fuelCurrentFerment)     return false;
    if (fermentationTime <= 0)     return false;
    int fermented=Math.min(fermentationTime,this.fuelCurrentFerment);
    if (!addProduct(new FluidStack(currentRecipe.output,Math.round(fermented * currentRecipe.modifier * currentResourceModifier)))) {
      return false;
    }
    fuelBurnTime--;
    resourceTank.drain(fuelCurrentFerment,true);
    fermentationTime-=this.fuelCurrentFerment;
    if (fermentationTime > 0)     return true;
    currentRecipe=null;
    return true;
  }
 else {
    fuelBurnTime=fuelTotalTime=determineFuelValue(getFuelStack());
    if (fuelBurnTime > 0) {
      this.fuelCurrentFerment=determineFermentPerCycle(getFuelStack());
      decrStackSize(1,1);
      return true;
    }
 else {
      this.fuelCurrentFerment=0;
      return false;
    }
  }
}

Fixed version (ground truth):
@Override public boolean workCycle(){
  if (currentRecipe == null) {
    checkRecipe();
    resetRecipe();
    if (currentRecipe != null) {
      currentResourceModifier=determineResourceMod(inventory.getStackInSlot(SLOT_RESOURCE));
      decrStackSize(SLOT_RESOURCE,1);
      return true;
    }
 else     return false;
  }
 else   if (fuelBurnTime > 0) {
    if (resourceTank.getFluidAmount() < fuelCurrentFerment)     return false;
    if (fermentationTime <= 0)     return false;
    int fermented=Math.min(fermentationTime,this.fuelCurrentFerment);
    if (!addProduct(new FluidStack(currentRecipe.output,Math.round(fermented * currentRecipe.modifier * currentResourceModifier)))) {
      return false;
    }
    fuelBurnTime--;
    resourceTank.drain(fuelCurrentFerment,true);
    fermentationTime-=this.fuelCurrentFerment;
    if (fermentationTime > 0)     return true;
    currentRecipe=null;
    return true;
  }
 else {
    fuelBurnTime=fuelTotalTime=determineFuelValue(getFuelStack());
    if (fuelBurnTime > 0) {
      this.fuelCurrentFerment=determineFermentPerCycle(getFuelStack());
      decrStackSize(1,1);
      return true;
    }
 else {
      this.fuelCurrentFerment=0;
      return false;
    }
  }
}
Program: 63730
Project: 63730
Buggy source:
@Override public boolean hasWork(){
  if (this.getFuelStack() == null && fuelBurnTime <= 0)   return false;
 else   if (fuelBurnTime <= 0)   if (RecipeManager.findMatchingRecipe(inventory.getStackInSlot(SLOT_RESOURCE),resourceTank.getFluid()) == null)   return false;
  if (this.getFermentationStack() == null && fermentationTime <= 0)   return false;
 else   if (fermentationTime <= 0)   if (RecipeManager.findMatchingRecipe(inventory.getStackInSlot(SLOT_RESOURCE),resourceTank.getFluid()) == null)   return false;
  if (resourceTank.getFluidAmount() <= 0)   return false;
  if (productTank.getFluidAmount() >= productTank.getCapacity())   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean hasWork(){
  if (this.getFuelStack() == null && fuelBurnTime <= 0)   return false;
 else   if (fuelBurnTime <= 0)   if (RecipeManager.findMatchingRecipe(inventory.getStackInSlot(SLOT_RESOURCE),resourceTank.getFluid()) == null)   return false;
  if (this.getFermentationStack() == null && fermentationTime <= 0)   return false;
 else   if (fermentationTime <= 0)   if (RecipeManager.findMatchingRecipe(inventory.getStackInSlot(SLOT_RESOURCE),resourceTank.getFluid()) == null)   return false;
  if (resourceTank.getFluidAmount() <= fuelCurrentFerment)   return false;
  if (productTank.getFluidAmount() >= productTank.getCapacity())   return false;
  return true;
}
Program: 63732
Project: 63732
Buggy source:
@Override public boolean canSustainPlant(IBlockAccess world,int x,int y,int z,ForgeDirection direction,IPlantable plant){
  EnumPlantType plantType=plant.getPlantType(world,x,y,z);
  if (plantType != EnumPlantType.Crop && plantType != EnumPlantType.Plains)   return false;
  int meta=world.getBlockMetadata(x,y,z);
  return (meta & 0x03) == 0;
}

Fixed version (ground truth):
@Override public boolean canSustainPlant(IBlockAccess world,int x,int y,int z,ForgeDirection direction,IPlantable plant){
  EnumPlantType plantType=plant.getPlantType(world,x,y,z);
  if (plantType != EnumPlantType.Crop && plantType != EnumPlantType.Plains)   return false;
  int meta=world.getBlockMetadata(x,y,z);
  SoilType type=getTypeFromMeta(meta);
  return type == SoilType.HUMUS;
}
Program: 63733
Project: 63733
Buggy source:
@Override @SideOnly(Side.CLIENT) public IIcon getIcon(int i,int j){
  int meta=j;
  int type=meta & 0x0f;
  int maturity=meta >> 2;
  if (type == 1)   if (maturity < this.degradeDelimiter)   return iconBogEarth;
 else   return iconPeat;
 else   if (type == 0)   return iconHumus;
 else   return null;
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side,int meta){
  SoilType type=getTypeFromMeta(meta);
switch (type) {
case HUMUS:
    return iconHumus;
case BOG_EARTH:
  return iconBogEarth;
case PEAT:
return iconPeat;
}
return null;
}
Program: 63734
Project: 63734
Buggy source:
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  int type=(metadata & 0x03);
  int maturity=metadata >> 2;
  if (maturity >= this.degradeDelimiter && type == 1) {
    ret.add(ForestryItem.peat.getItemStack());
    ret.add(new ItemStack(Blocks.dirt));
  }
 else   if (type == 0)   ret.add(new ItemStack(Blocks.dirt));
 else   ret.add(new ItemStack(this,1,type));
  return ret;
}

Fixed version (ground truth):
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  SoilType type=getTypeFromMeta(metadata);
  if (type == SoilType.PEAT) {
    ret.add(ForestryItem.peat.getItemStack());
    ret.add(new ItemStack(Blocks.dirt));
  }
 else   if (type == SoilType.HUMUS)   ret.add(new ItemStack(Blocks.dirt));
 else   ret.add(new ItemStack(this,1,SoilType.BOG_EARTH.ordinal()));
  return ret;
}
Program: 63735
Project: 63735
Buggy source:
@Override public void updateTick(World world,int i,int j,int k,Random random){
  if (!Proxies.common.isSimulating(world))   return;
  int meta=world.getBlockMetadata(i,j,k);
  int type=(meta & 0x03);
  if (type == 0)   updateTickHumus(world,i,j,k,random);
 else   if (type == 1)   updateTickBogEarth(world,i,j,k,random);
 else   Proxies.log.warning(this.getClass() + "String_Node_Str" + type+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void updateTick(World world,int i,int j,int k,Random random){
  if (!Proxies.common.isSimulating(world))   return;
  int meta=world.getBlockMetadata(i,j,k);
  SoilType type=getTypeFromMeta(meta);
  if (type == SoilType.HUMUS)   updateTickHumus(world,i,j,k,random);
 else   if (type == SoilType.BOG_EARTH)   updateTickBogEarth(world,i,j,k,random);
}
Program: 63740
Project: 63740
Buggy source:
private void listPluginInfoForSender(ICommandSender sender,String[] arguments){
  if (arguments.length < 3)   throw new WrongUsageException("String_Node_Str" + getCommandName() + "String_Node_Str");
  IPlugin found=null;
  for (  IPlugin plugin : PluginManager.plugins) {
    PluginInfo info=plugin.getClass().getAnnotation(PluginInfo.class);
    if (info == null)     continue;
    if ((info.pluginID().equalsIgnoreCase(arguments[2]) || info.name().equalsIgnoreCase(arguments[2]))) {
      found=plugin;
      break;
    }
  }
  if (found == null)   throw new CommandException(StringUtil.localize("String_Node_Str",arguments[2]));
  String entry="String_Node_Str";
  if (found.isAvailable())   entry="String_Node_Str";
  PluginInfo info=found.getClass().getAnnotation(PluginInfo.class);
  if (info != null) {
    sendChatMessage(sender,entry + "String_Node_Str" + info.name());
    if (!info.version().isEmpty())     sendChatMessage(sender,"String_Node_Str" + info.version());
    if (!info.author().isEmpty())     sendChatMessage(sender,"String_Node_Str" + info.author());
    if (!info.url().isEmpty())     sendChatMessage(sender,"String_Node_Str" + info.url());
    if (!info.description().isEmpty())     sendChatMessage(sender,info.description());
  }
}

Fixed version (ground truth):
private void listPluginInfoForSender(ICommandSender sender,String[] arguments){
  if (arguments.length < 3)   throw new WrongUsageException("String_Node_Str" + getCommandName() + "String_Node_Str");
  IPlugin found=null;
  for (  IPlugin plugin : PluginManager.plugins) {
    PluginInfo info=plugin.getClass().getAnnotation(PluginInfo.class);
    if (info == null)     continue;
    if ((info.pluginID().equalsIgnoreCase(arguments[2]) || info.name().equalsIgnoreCase(arguments[2]))) {
      found=plugin;
      break;
    }
  }
  if (found == null)   throw new CommandException(StringUtil.localizeAndFormat("String_Node_Str",arguments[2]));
  String entry="String_Node_Str";
  if (found.isAvailable())   entry="String_Node_Str";
  PluginInfo info=found.getClass().getAnnotation(PluginInfo.class);
  if (info != null) {
    sendChatMessage(sender,entry + "String_Node_Str" + info.name());
    if (!info.version().isEmpty())     sendChatMessage(sender,"String_Node_Str" + info.version());
    if (!info.author().isEmpty())     sendChatMessage(sender,"String_Node_Str" + info.author());
    if (!info.url().isEmpty())     sendChatMessage(sender,"String_Node_Str" + info.url());
    if (!info.description().isEmpty())     sendChatMessage(sender,info.description());
  }
}
Program: 63741
Project: 63741
Buggy source:
@Override public void processCommand(ICommandSender sender,String[] arguments){
  if (arguments.length <= 0)   throw new WrongUsageException(StringUtil.localize("String_Node_Str",this.getCommandUsage(sender)));
  if (arguments[0].matches("String_Node_Str")) {
    commandVersion(sender,arguments);
    return;
  }
 else   if (arguments[0].matches("String_Node_Str")) {
    commandPlugins(sender,arguments);
    return;
  }
 else   if (arguments[0].matches("String_Node_Str")) {
    sendChatMessage(sender,StringUtil.localize("String_Node_Str",this.getCommandName()));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    return;
  }
  throw new WrongUsageException(this.getCommandUsage(sender));
}

Fixed version (ground truth):
@Override public void processCommand(ICommandSender sender,String[] arguments){
  if (arguments.length <= 0)   throw new WrongUsageException(StringUtil.localizeAndFormat("String_Node_Str",this.getCommandUsage(sender)));
  if (arguments[0].matches("String_Node_Str")) {
    commandVersion(sender,arguments);
    return;
  }
 else   if (arguments[0].matches("String_Node_Str")) {
    commandPlugins(sender,arguments);
    return;
  }
 else   if (arguments[0].matches("String_Node_Str")) {
    sendChatMessage(sender,StringUtil.localizeAndFormat("String_Node_Str",this.getCommandName()));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    sendChatMessage(sender,StringUtil.localize("String_Node_Str"));
    return;
  }
  throw new WrongUsageException(this.getCommandUsage(sender));
}
Program: 63742
Project: 63742
Buggy source:
@Override public String getItemStackDisplayName(ItemStack itemstack){
  ResearchNote note=new ResearchNote(itemstack.getTagCompound());
  return StringUtil.localize(getUnlocalizedName(itemstack) + "String_Node_Str",note.researcher);
}

Fixed version (ground truth):
@Override public String getItemStackDisplayName(ItemStack itemstack){
  ResearchNote note=new ResearchNote(itemstack.getTagCompound());
  return StringUtil.localizeAndFormat(getUnlocalizedName(itemstack) + "String_Node_Str",note.researcher);
}
Program: 63743
Project: 63743
Buggy source:
public static String localize(String key,Object... args){
  String text=StringUtil.localize(key);
  try {
    return String.format(text,args);
  }
 catch (  IllegalFormatException ex) {
    return "String_Node_Str" + text;
  }
}

Fixed version (ground truth):
public static String localize(String key){
  return StatCollector.translateToLocal(key).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str");
}