nus-yam/ex-repair huggingface dataset:
Program: 30759
Project: 30759
Buggy source:
@Override public void onChangeInventory(IInventory inv,int slot,InvOperation mc,ItemStack removed,ItemStack added){
  if (burnTime <= 0) {
    eatFuel();
    if (burnTime > 0) {
      try {
        gridProxy.getTick().wakeDevice(gridProxy.getNode());
      }
 catch (      GridAccessException e) {
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onChangeInventory(IInventory inv,int slot,InvOperation mc,ItemStack removed,ItemStack added){
  if (burnTime <= 0) {
    if (canEatFuel()) {
      try {
        gridProxy.getTick().wakeDevice(gridProxy.getNode());
      }
 catch (      GridAccessException e) {
      }
    }
  }
}
Program: 30760
Project: 30760
Buggy source:
public static int NBTOrderlessHash(NBTBase A){
  int hash=0;
  byte id=A.getId();
  hash+=id;
switch (id) {
case 10:
{
      NBTTagCompound ctA=(NBTTagCompound)A;
      Set<String> cA=ctA.func_150296_c();
      Iterator<String> i=cA.iterator();
      while (i.hasNext()) {
        String name=i.next();
        hash+=NBTOrderlessHash(ctA.getTag(name));
      }
      return hash;
    }
case 9:
{
    NBTTagList lA=(NBTTagList)A;
    hash+=9 * lA.tagCount();
    List<NBTBase> l=tagList(lA);
    for (int x=0; x < l.size(); x++) {
      hash+=NBTOrderlessHash(l.get(x));
    }
    return hash;
  }
case 1:
return hash + ((NBTTagByte)A).func_150290_f();
case 4:
return hash + (int)((NBTTagLong)A).func_150291_c();
case 8:
return hash + ((NBTTagString)A).func_150285_a_().hashCode();
case 6:
return hash + (int)((NBTTagDouble)A).func_150286_g();
case 5:
return hash + (int)((NBTTagFloat)A).func_150288_h();
case 3:
return hash + ((NBTTagInt)A).func_150287_d();
default :
return hash;
}
}

Fixed version (ground truth):
public static int NBTOrderlessHash(NBTBase A){
  int hash=0;
  byte id=A.getId();
  hash+=id;
switch (id) {
case 10:
{
      NBTTagCompound ctA=(NBTTagCompound)A;
      Set<String> cA=ctA.func_150296_c();
      Iterator<String> i=cA.iterator();
      while (i.hasNext()) {
        String name=i.next();
        hash+=name.hashCode() ^ NBTOrderlessHash(ctA.getTag(name));
      }
      return hash;
    }
case 9:
{
    NBTTagList lA=(NBTTagList)A;
    hash+=9 * lA.tagCount();
    List<NBTBase> l=tagList(lA);
    for (int x=0; x < l.size(); x++) {
      hash+=((Integer)x).hashCode() ^ NBTOrderlessHash(l.get(x));
    }
    return hash;
  }
case 1:
return hash + ((NBTTagByte)A).func_150290_f();
case 4:
return hash + (int)((NBTTagLong)A).func_150291_c();
case 8:
return hash + ((NBTTagString)A).func_150285_a_().hashCode();
case 6:
return hash + (int)((NBTTagDouble)A).func_150286_g();
case 5:
return hash + (int)((NBTTagFloat)A).func_150288_h();
case 3:
return hash + ((NBTTagInt)A).func_150287_d();
default :
return hash;
}
}
Program: 30761
Project: 30761
Buggy source:
@Override public int compareTo(AEItemStack b){
  int id=def.item.hashCode() - b.def.item.hashCode();
  int dv=def.damageValue - b.def.damageValue;
  int dspv=def.dspDamage - b.def.dspDamage;
  return id == 0 ? (dv == 0 ? (dspv == 0 ? ((def.tagCompound == null ? 0 : def.tagCompound.getHash()) - (b.def.tagCompound == null ? 0 : b.def.tagCompound.getHash())) : dspv) : dv) : id;
}

Fixed version (ground truth):
@Override public int compareTo(AEItemStack b){
  int id=compare(def.item.hashCode(),b.def.item.hashCode());
  int dv=compare(def.damageValue,b.def.damageValue);
  int dspv=compare(def.dspDamage,b.def.dspDamage);
  return id == 0 ? (dv == 0 ? (dspv == 0 ? compareNBT(b.def) : dspv) : dv) : id;
}
Program: 30762
Project: 30762
Buggy source:
public IAEItemStack getLow(FuzzyMode fuzzy,boolean ignoreMeta){
  AEItemStack bottom=new AEItemStack(this);
  AEItemDef newDef=bottom.def=bottom.def.copy();
  if (ignoreMeta) {
    newDef.dspDamage=newDef.damageValue=0;
    newDef.reHash();
    return bottom;
  }
  if (fuzzy == FuzzyMode.IGNORE_ALL) {
    newDef.dspDamage=0;
  }
 else {
    int low=fuzzy.calculateBreakPoint(def.maxDamage);
    newDef.dspDamage=low < def.dspDamage ? low : 0;
  }
  if (newDef.item.isDamageable())   newDef.damageValue=newDef.dspDamage;
  newDef.reHash();
  return bottom;
}

Fixed version (ground truth):
public IAEItemStack getLow(FuzzyMode fuzzy,boolean ignoreMeta){
  AEItemStack bottom=new AEItemStack(this);
  AEItemDef newDef=bottom.def=bottom.def.copy();
  if (ignoreMeta) {
    newDef.dspDamage=newDef.damageValue=0;
    newDef.reHash();
    return bottom;
  }
  if (fuzzy == FuzzyMode.IGNORE_ALL) {
    newDef.dspDamage=0;
  }
 else {
    int low=fuzzy.calculateBreakPoint(def.maxDamage);
    newDef.dspDamage=low < def.dspDamage ? low : 0;
  }
  if (newDef.item.isDamageable())   newDef.damageValue=newDef.dspDamage;
  newDef.tagCompound=newDef.lowTag;
  newDef.reHash();
  return bottom;
}
Program: 30763
Project: 30763
Buggy source:
public IAEItemStack getHigh(FuzzyMode fuzzy,boolean ignoreMeta){
  AEItemStack top=new AEItemStack(this);
  AEItemDef newDef=top.def=top.def.copy();
  if (ignoreMeta) {
    newDef.dspDamage=newDef.damageValue=Integer.MAX_VALUE;
    newDef.reHash();
    return top;
  }
  if (fuzzy == FuzzyMode.IGNORE_ALL) {
    newDef.dspDamage=def.maxDamage + 1;
  }
 else {
    int high=fuzzy.calculateBreakPoint(def.maxDamage) + 1;
    newDef.dspDamage=high > def.dspDamage ? high : def.maxDamage + 1;
  }
  if (newDef.item.isDamageable())   newDef.damageValue=top.def.dspDamage;
  newDef.reHash();
  return top;
}

Fixed version (ground truth):
public IAEItemStack getHigh(FuzzyMode fuzzy,boolean ignoreMeta){
  AEItemStack top=new AEItemStack(this);
  AEItemDef newDef=top.def=top.def.copy();
  if (ignoreMeta) {
    newDef.dspDamage=newDef.damageValue=Integer.MAX_VALUE;
    newDef.reHash();
    return top;
  }
  if (fuzzy == FuzzyMode.IGNORE_ALL) {
    newDef.dspDamage=def.maxDamage + 1;
  }
 else {
    int high=fuzzy.calculateBreakPoint(def.maxDamage) + 1;
    newDef.dspDamage=high > def.dspDamage ? high : def.maxDamage + 1;
  }
  if (newDef.item.isDamageable())   newDef.damageValue=top.def.dspDamage;
  newDef.tagCompound=newDef.highTag;
  newDef.reHash();
  return top;
}
Program: 30764
Project: 30764
Buggy source:
public boolean matches(Item itemid2,int meta2,int orderlessHash){
  return itemid2 == itemid && meta == meta2 && hash == orderlessHash;
}

Fixed version (ground truth):
public boolean matches(Item itemid2,int meta2,int orderlessHash){
  return itemid2 == item && meta == meta2 && hash == orderlessHash;
}
Program: 30765
Project: 30765
Buggy source:
private AESharedNBT(Item itemID,int damageValue){
  super();
  itemid=itemID;
  meta=damageValue;
}

Fixed version (ground truth):
public AESharedNBT(int fakeValue){
  super();
  item=null;
  meta=0;
  hash=fakeValue;
}
Program: 30768
Project: 30768
Buggy source:
@Override public double getStoredPower(){
  if (availableTicksSinceUpdate > 90)   refreshPower();
  return globalAvailablePower;
}

Fixed version (ground truth):
@Override public double getStoredPower(){
  if (availableTicksSinceUpdate > 90)   refreshPower();
  return Math.max(0.0,globalAvailablePower);
}
Program: 30769
Project: 30769
Buggy source:
@Override public void removeNode(IGridNode node,IGridHost machine){
  if (machine instanceof IEnergyGridProvider)   gproviders.remove(machine);
  GridNode gnode=(GridNode)node;
  drainPerTick-=gnode.previousDraw;
  if (machine instanceof IAEPowerStorage) {
    IAEPowerStorage ps=(IAEPowerStorage)machine;
    if (ps.getPowerFlow() != AccessRestriction.WRITE)     globalAvailablePower-=ps.getAECurrentPower();
    if (lastProvider == machine)     lastProvider=null;
    if (lastRequestor == machine)     lastRequestor=null;
    globalMaxPower-=ps.getAEMaxPower();
    providers.remove(machine);
    requesters.remove(machine);
  }
  if (machine instanceof IStackWatcherHost) {
    IEnergyWatcher myWatcher=watchers.get(machine);
    if (myWatcher != null) {
      myWatcher.clear();
      watchers.remove(machine);
    }
  }
}

Fixed version (ground truth):
@Override public void removeNode(IGridNode node,IGridHost machine){
  if (machine instanceof IEnergyGridProvider)   gproviders.remove(machine);
  GridNode gnode=(GridNode)node;
  drainPerTick-=gnode.previousDraw;
  if (machine instanceof IAEPowerStorage) {
    IAEPowerStorage ps=(IAEPowerStorage)machine;
    if (ps.isAEPublicPowerStorage()) {
      if (ps.getPowerFlow() != AccessRestriction.WRITE)       globalAvailablePower-=ps.getAECurrentPower();
      if (lastProvider == machine)       lastProvider=null;
      if (lastRequestor == machine)       lastRequestor=null;
      globalMaxPower-=ps.getAEMaxPower();
      providers.remove(machine);
      requesters.remove(machine);
    }
  }
  if (machine instanceof IStackWatcherHost) {
    IEnergyWatcher myWatcher=watchers.get(machine);
    if (myWatcher != null) {
      myWatcher.clear();
      watchers.remove(machine);
    }
  }
}
Program: 30770
Project: 30770
Buggy source:
public TileEnergyAcceptor(){
  gridProxy.setIdlePowerUsage(1.0 / 16.0);
  addNewHandler(new TilePowerRelayHandler());
}

Fixed version (ground truth):
public TileEnergyAcceptor(){
  gridProxy.setIdlePowerUsage(0.0);
  addNewHandler(new TilePowerRelayHandler());
  internalMaxPower=100;
}
Program: 30771
Project: 30771
Buggy source:
@Override public void Tick(){
  if (internalCurrentPower > 0) {
    try {
      IEnergyGrid eg=gridProxy.getEnergy();
      double powerRequested=internalCurrentPower - eg.injectPower(internalCurrentPower,Actionable.SIMULATE);
      if (powerRequested > 0) {
        internalCurrentPower+=eg.injectPower(extractAEPower(powerRequested,Actionable.MODULATE,PowerMultiplier.ONE),Actionable.MODULATE);
      }
    }
 catch (    GridAccessException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void Tick(){
  if (internalCurrentPower > 0) {
    try {
      IEnergyGrid eg=gridProxy.getEnergy();
      double powerRequested=internalCurrentPower - eg.injectPower(internalCurrentPower,Actionable.SIMULATE);
      if (powerRequested > 0) {
        eg.injectPower(extractAEPower(powerRequested,Actionable.MODULATE,PowerMultiplier.ONE),Actionable.MODULATE);
      }
    }
 catch (    GridAccessException e) {
    }
  }
}
Program: 30772
Project: 30772
Buggy source:
private void put(World w,int i,int j,int k,Block skystone,int meta){
  if (w.getBlock(i,j,k) == Blocks.bedrock)   return;
  w.setBlock(i,j,k,skystone,meta,3);
}

Fixed version (ground truth):
private void put(World w,int i,int j,int k,Block blk,int meta){
  if (w.getBlock(i,j,k) == Blocks.bedrock)   return;
  w.setBlock(i,j,k,blk,meta,3);
}
Program: 30773
Project: 30773
Buggy source:
private void placeMetor(World w,int x,int y,int z){
  for (int i=x - 8; i < x + 8; i++)   for (int j=y - 8; j < y + 8; j++)   for (int k=z - 8; k < z + 8; k++) {
    double dx=i - x;
    double dy=j - y;
    double dz=k - z;
    if (dx * dx * 0.7 + dy * dy * (j > y ? 1.4 : 0.8) + dz * dz * 0.7 < sizeOfMetorite)     put(w,i,j,k,skystone);
  }
  put(w,x,y,z,skychest);
}

Fixed version (ground truth):
private void placeMetor(World w,int x,int y,int z){
  for (int i=x - 8; i < x + 8; i++)   for (int j=y - 8; j < y + 8; j++)   for (int k=z - 8; k < z + 8; k++) {
    double dx=i - x;
    double dy=j - y;
    double dz=k - z;
    if (dx * dx * 0.7 + dy * dy * (j > y ? 1.4 : 0.8) + dz * dz * 0.7 < sizeOfMetorite)     put(w,i,j,k,skystone);
  }
  put(w,x,y,z,skychest);
  TileEntity te=w.getTileEntity(x,y,z);
  if (te instanceof IInventory) {
switch ((int)(Math.random() * 1000) % 4) {
case 0:
      ((IInventory)te).setInventorySlotContents(0,AEApi.instance().materials().materialCalcProcessorPress.stack(1));
    break;
case 1:
  ((IInventory)te).setInventorySlotContents(0,AEApi.instance().materials().materialEngProcessorPress.stack(1));
break;
case 2:
((IInventory)te).setInventorySlotContents(0,AEApi.instance().materials().materialLogicProcessorPress.stack(1));
break;
case 3:
((IInventory)te).setInventorySlotContents(0,AEApi.instance().materials().materialSiliconPress.stack(1));
break;
default :
}
switch ((int)(Math.random() * 1000) % 3) {
case 0:
((IInventory)te).setInventorySlotContents(1,AEApi.instance().blocks().blockSkyStone.stack((int)(Math.random() * 12) + 1));
break;
case 1:
((IInventory)te).setInventorySlotContents(1,AEApi.instance().materials().materialIronNugget.stack((int)(Math.random() * 12) + 1));
break;
case 2:
((IInventory)te).setInventorySlotContents(1,new ItemStack(net.minecraft.init.Items.gold_nugget,(int)(Math.random() * 12) + 1));
break;
}
}
}
Program: 30774
Project: 30774
Buggy source:
@Override public ForgeDirection getUp(){
  return up;
}

Fixed version (ground truth):
@Override public ForgeDirection getUp(){
  if (up == ForgeDirection.UNKNOWN)   return ForgeDirection.UP;
  return up;
}
Program: 30775
Project: 30775
Buggy source:
@Override public ForgeDirection getForward(){
  return forward;
}

Fixed version (ground truth):
@Override public ForgeDirection getForward(){
  if (forward == ForgeDirection.UNKNOWN)   return ForgeDirection.SOUTH;
  return forward;
}
Program: 30776
Project: 30776
Buggy source:
public BlockCharger(){
  super(BlockCharger.class,Material.iron);
  setfeature(EnumSet.of(AEFeature.Core));
  setTileEntiy(TileCharger.class);
  setLightOpacity(2);
  isFullSize=false;
  isOpaque=false;
}

Fixed version (ground truth):
public BlockCharger(){
  super(BlockCharger.class,Material.iron);
  setfeature(EnumSet.of(AEFeature.Core));
  setTileEntiy(TileCharger.class);
  setLightOpacity(2);
  isFullSize=isOpaque=false;
}
Program: 30778
Project: 30778
Buggy source:
@Override public void renderTile(AEBaseBlock block,AEBaseTile tile,Tessellator tess,double x,double y,double z,float partialTick,RenderBlocks renderer){
  if (!(tile instanceof TileSkyChest))   return;
  TileSkyChest skyChest=(TileSkyChest)tile;
  if (!skyChest.hasWorldObj())   return;
  GL11.glEnable(32826);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  ResourceLocation loc;
  if (tile.blockMetadata == 1)   loc=new ResourceLocation("String_Node_Str","String_Node_Str");
 else   loc=new ResourceLocation("String_Node_Str","String_Node_Str");
  Minecraft.getMinecraft().getTextureManager().bindTexture(loc);
  this.applyTESRRotation(x,y,z,skyChest.getForward(),skyChest.getUp());
  GL11.glScalef(1.0F,-1F,-1F);
  GL11.glTranslatef(-0.0F,-1.0F,-1.0F);
  long now=System.currentTimeMillis();
  long distnace=now - skyChest.lastEvent;
  if (skyChest.playerOpen > 0)   skyChest.lidAngle+=distnace * 0.0001;
 else   skyChest.lidAngle-=distnace * 0.0001;
  if (skyChest.lidAngle > 0.5f)   skyChest.lidAngle=0.5f;
  if (skyChest.lidAngle < 0.0f)   skyChest.lidAngle=0.0f;
  float lidangle=skyChest.lidAngle;
  lidangle=1.0F - lidangle;
  lidangle=1.0F - lidangle * lidangle * lidangle;
  model.chestLid.offsetY=-(0.9f / 16.0f);
  model.chestLid.rotateAngleX=-((lidangle * 3.141593F) / 2.0F);
  model.renderAll();
  GL11.glDisable(32826);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
}

Fixed version (ground truth):
@Override public void renderTile(AEBaseBlock block,AEBaseTile tile,Tessellator tess,double x,double y,double z,float partialTick,RenderBlocks renderer){
  if (!(tile instanceof TileSkyChest))   return;
  TileSkyChest skyChest=(TileSkyChest)tile;
  if (!skyChest.hasWorldObj())   return;
  GL11.glEnable(32826);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  ResourceLocation loc;
  if (tile.getWorldObj().getBlockMetadata(tile.xCoord,tile.yCoord,tile.zCoord) == 1)   loc=new ResourceLocation("String_Node_Str","String_Node_Str");
 else   loc=new ResourceLocation("String_Node_Str","String_Node_Str");
  Minecraft.getMinecraft().getTextureManager().bindTexture(loc);
  this.applyTESRRotation(x,y,z,skyChest.getForward(),skyChest.getUp());
  GL11.glScalef(1.0F,-1F,-1F);
  GL11.glTranslatef(-0.0F,-1.0F,-1.0F);
  long now=System.currentTimeMillis();
  long distnace=now - skyChest.lastEvent;
  if (skyChest.playerOpen > 0)   skyChest.lidAngle+=distnace * 0.0001;
 else   skyChest.lidAngle-=distnace * 0.0001;
  if (skyChest.lidAngle > 0.5f)   skyChest.lidAngle=0.5f;
  if (skyChest.lidAngle < 0.0f)   skyChest.lidAngle=0.0f;
  float lidangle=skyChest.lidAngle;
  lidangle=1.0F - lidangle;
  lidangle=1.0F - lidangle * lidangle * lidangle;
  model.chestLid.offsetY=-(0.9f / 16.0f);
  model.chestLid.rotateAngleX=-((lidangle * 3.141593F) / 2.0F);
  model.renderAll();
  GL11.glDisable(32826);
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
}
Program: 30779
Project: 30779
Buggy source:
@Override public void onChangeInventory(IInventory inv,int slot,InvOperation mc,ItemStack removedStack,ItemStack newStack){
}

Fixed version (ground truth):
@Override public void onChangeInventory(IInventory inv,int slot,InvOperation mc,ItemStack removedStack,ItemStack newStack){
  host.markForSave();
}
Program: 30780
Project: 30780
Buggy source:
@Override public void parseRecipes(IRecipeLoader loader,String path){
  try {
    BufferedReader reader=null;
    try {
      reader=loader.getFile(path);
    }
 catch (    Exception err) {
      AELog.warning("String_Node_Str" + path);
      AELog.error(err);
      return;
    }
    boolean inQuote=false;
    boolean inComment=false;
    String token="String_Node_Str";
    int line=0;
    int val=-1;
    while ((val=reader.read()) != -1) {
      char c=(char)val;
      if (c == '\n')       line++;
      if (inComment) {
        if (c == '\n' || c == '\r')         inComment=false;
      }
 else       if (inQuote) {
switch (c) {
case '"':
          inQuote=!inQuote;
        break;
default :
      token=token + c;
  }
}
 else {
switch (c) {
case '"':
    inQuote=!inQuote;
  break;
case ',':
if (token.length() > 0) {
  tokens.add(token);
  tokens.add("String_Node_Str");
}
token="String_Node_Str";
break;
case '=':
processTokens(loader,path,line);
if (token.length() > 0) tokens.add(token);
token="String_Node_Str";
break;
case '#':
inComment=true;
case '\n':
case '\t':
case '\r':
case ' ':
if (token.length() > 0) tokens.add(token);
token="String_Node_Str";
break;
default :
token=token + c;
}
}
}
reader.close();
processTokens(loader,path,line);
}
 catch (Throwable e) {
AELog.error(e);
if (data.crash) throw new RuntimeException(e);
}
}

Fixed version (ground truth):
@Override public void parseRecipes(IRecipeLoader loader,String path){
  try {
    BufferedReader reader=null;
    try {
      reader=loader.getFile(path);
    }
 catch (    Exception err) {
      AELog.warning("String_Node_Str" + path);
      if (data.exceptions)       AELog.error(err);
      return;
    }
    boolean inQuote=false;
    boolean inComment=false;
    String token="String_Node_Str";
    int line=0;
    int val=-1;
    while ((val=reader.read()) != -1) {
      char c=(char)val;
      if (c == '\n')       line++;
      if (inComment) {
        if (c == '\n' || c == '\r')         inComment=false;
      }
 else       if (inQuote) {
switch (c) {
case '"':
          inQuote=!inQuote;
        break;
default :
      token=token + c;
  }
}
 else {
switch (c) {
case '"':
    inQuote=!inQuote;
  break;
case ',':
if (token.length() > 0) {
  tokens.add(token);
  tokens.add("String_Node_Str");
}
token="String_Node_Str";
break;
case '=':
processTokens(loader,path,line);
if (token.length() > 0) tokens.add(token);
token="String_Node_Str";
break;
case '#':
inComment=true;
case '\n':
case '\t':
case '\r':
case ' ':
if (token.length() > 0) tokens.add(token);
token="String_Node_Str";
break;
default :
token=token + c;
}
}
}
reader.close();
processTokens(loader,path,line);
}
 catch (Throwable e) {
AELog.error(e);
if (data.crash) throw new RuntimeException(e);
}
}
Program: 30782
Project: 30782
Buggy source:
@Override public void markForSave(){
  markDirty();
}

Fixed version (ground truth):
@Override public void markForSave(){
  super.markDirty();
}
Program: 30783
Project: 30783
Buggy source:
@Override public void registerBlockIcons(IIconRegister iconRegistry){
  return;
}

Fixed version (ground truth):
@Override public void registerBlockIcons(IIconRegister iconRegistry){
  registerNoIcons();
}
Program: 30784
Project: 30784
Buggy source:
@Override public void registerBlockIcons(IIconRegister iconRegistry){
  return;
}

Fixed version (ground truth):
@Override public void registerBlockIcons(IIconRegister iconRegistry){
  registerNoIcons();
}
Program: 30785
Project: 30785
Buggy source:
@Override public void PostInit(){
  registerPowerP2P();
  registerItemP2P();
  registerLiquidsP2P();
}

Fixed version (ground truth):
@Override public void PostInit(){
  registerPowerP2P();
  registerItemP2P();
  Blocks b=AEApi.instance().blocks();
  addFacade(b.blockFluix.stack(1));
  addFacade(b.blockQuartz.stack(1));
  addFacade(b.blockQuartzChiseled.stack(1));
  addFacade(b.blockQuartzPiller.stack(1));
  registerLiquidsP2P();
}
Program: 30786
Project: 30786
Buggy source:
@Override public void readFromNBT(NBTTagCompound data){
  priority=data.getInteger("String_Node_Str");
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound data){
  config.readFromNBT(data);
  priority=data.getInteger("String_Node_Str");
}
Program: 30787
Project: 30787
Buggy source:
@Override public void writeToNBT(NBTTagCompound data){
  data.setInteger("String_Node_Str",priority);
}

Fixed version (ground truth):
@Override public void writeToNBT(NBTTagCompound data){
  config.writeToNBT(data);
  data.setInteger("String_Node_Str",priority);
}
Program: 30788
Project: 30788
Buggy source:
public TileChest(){
  gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL);
  addNewHandler(new invManger());
  internalPublicPowerStorage=true;
  internalPowerFlow=AccessRestriction.WRITE;
}

Fixed version (ground truth):
public TileChest(){
  gridProxy.setFlags(GridFlags.REQUIRE_CHANNEL);
  addNewHandler(new invManger());
  config.registerSetting(Settings.SORT_BY,SortOrder.NAME);
  config.registerSetting(Settings.VIEW_MODE,ViewItems.ALL);
  config.registerSetting(Settings.SORT_DIRECTION,SortDir.ASCENDING);
  internalPublicPowerStorage=true;
  internalPowerFlow=AccessRestriction.WRITE;
}
Program: 30791
Project: 30791
Buggy source:
@Override public void Init(){
  AEApi.instance().partHelper().registerNewLayer("String_Node_Str","String_Node_Str");
  AEApi.instance().registries().externalStorage().addExternalStorageInterface(new BCPipeHandler());
}

Fixed version (ground truth):
@Override public void Init(){
  TestClass(IPipeConnection.class);
  TestClass(ItemFacade.class);
  TestClass(IToolWrench.class);
  AEApi.instance().partHelper().registerNewLayer("String_Node_Str","String_Node_Str");
  AEApi.instance().registries().externalStorage().addExternalStorageInterface(new BCPipeHandler());
}
Program: 30792
Project: 30792
Buggy source:
@Override public void Init(){
}

Fixed version (ground truth):
@Override public void Init(){
  TestClass(IDeepStorageUnit.class);
}
Program: 30793
Project: 30793
Buggy source:
@Override public void Init() throws Throwable {
  if (((Object)this) instanceof MJPerdition) {
  }
}

Fixed version (ground truth):
@Override public void Init() throws Throwable {
  TestClass(MJPerdition.class);
}
Program: 30794
Project: 30794
Buggy source:
@Override public IItemList<IAEItemStack> getAvailableItems(IItemList out){
  return out;
}

Fixed version (ground truth):
@Override public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out){
  return out;
}
Program: 30795
Project: 30795
Buggy source:
@Override public IItemList<IAEItemStack> getAvailableItems(IItemList out){
  ItemStack is=dsu.getStoredItemType();
  if (is != null) {
    out.add(AEItemStack.create(is));
  }
  return out;
}

Fixed version (ground truth):
@Override public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out){
  ItemStack is=dsu.getStoredItemType();
  if (is != null) {
    out.add(AEItemStack.create(is));
  }
  return out;
}
Program: 30796
Project: 30796
Buggy source:
@Override public IExternalStorageHandler getHandler(TileEntity te,ForgeDirection d,StorageChannel chan){
  for (  IExternalStorageHandler x : Handlers) {
    if (x.canHandle(te,d,chan))     return x;
  }
  return null;
}

Fixed version (ground truth):
@Override public IExternalStorageHandler getHandler(TileEntity te,ForgeDirection d,StorageChannel chan){
  for (  IExternalStorageHandler x : Handlers) {
    if (x.canHandle(te,d,chan))     return x;
  }
  if (lastHandler.canHandle(te,d,chan))   return lastHandler;
  return null;
}
Program: 30797
Project: 30797
Buggy source:
public boolean readFromStream(ByteBuf out) throws IOException {
  int facadeSides=out.readByte();
  int ids[]=new int[2];
  for (int x=0; x < facades.length; x++) {
    ForgeDirection side=ForgeDirection.getOrientation(x);
    int ix=(1 << x);
    if ((facadeSides & ix) == ix) {
      ids[0]=out.readInt();
      ids[1]=out.readInt();
      boolean isBC=ids[0] < 0;
      ids[0]=Math.abs(ids[0]);
      if (isBC && AppEng.instance.isIntegrationEnabled("String_Node_Str")) {
        IBC bc=(IBC)AppEng.instance.getIntegration("String_Node_Str");
        facades[x]=bc.createFacadePart(ids,side);
      }
 else       if (!isBC) {
        ItemFacade ifa=(ItemFacade)AEApi.instance().items().itemFacade.item();
        ItemStack facade=ifa.createFromInts(ids);
        if (facade != null)         facades[x]=ifa.createPartFromItemStack(facade,side);
      }
    }
 else     facades[x]=null;
  }
  return false;
}

Fixed version (ground truth):
public boolean readFromStream(ByteBuf out) throws IOException {
  int facadeSides=out.readByte();
  int ids[]=new int[2];
  for (int x=0; x < facades.length; x++) {
    ForgeDirection side=ForgeDirection.getOrientation(x);
    int ix=(1 << x);
    if ((facadeSides & ix) == ix) {
      ids[0]=out.readInt();
      ids[1]=out.readInt();
      boolean isBC=ids[0] < 0;
      ids[0]=Math.abs(ids[0]);
      if (isBC && AppEng.instance.isIntegrationEnabled("String_Node_Str")) {
        IBC bc=(IBC)AppEng.instance.getIntegration("String_Node_Str");
        facades[x]=bc.createFacadePart((Block)Block.blockRegistry.getObjectById(ids[0]),ids[1],side);
      }
 else       if (!isBC) {
        ItemFacade ifa=(ItemFacade)AEApi.instance().items().itemFacade.item();
        ItemStack facade=ifa.createFromInts(ids);
        if (facade != null)         facades[x]=ifa.createPartFromItemStack(facade,side);
      }
    }
 else     facades[x]=null;
  }
  return false;
}
Program: 30798
Project: 30798
Buggy source:
BaseBCperdition createPerdition(BuildCraft buildCraft);

Fixed version (ground truth):
BaseMJperdition createPerdition(BuildCraft buildCraft);
Program: 30799
Project: 30799
Buggy source:
@Override public boolean canHandle(TileEntity te,ForgeDirection d,StorageChannel channel){
  if (channel == StorageChannel.ITEMS && te instanceof ITileStorageMonitorable)   return true;
  if (channel == StorageChannel.ITEMS && te instanceof IInventory)   return true;
  return te instanceof TileCondenser;
}

Fixed version (ground truth):
@Override public boolean canHandle(TileEntity te,ForgeDirection d,StorageChannel channel){
  if (channel == StorageChannel.ITEMS && te instanceof ITileStorageMonitorable)   return true;
  return te instanceof TileCondenser;
}
Program: 30800
Project: 30800
Buggy source:
@Override public IMEInventory getInventory(TileEntity te,ForgeDirection d,StorageChannel channel){
  if (te instanceof TileCondenser) {
    if (channel == StorageChannel.ITEMS)     return new VoidItemInventory((TileCondenser)te);
 else     return new VoidFluidInventory((TileCondenser)te);
  }
  if (te instanceof ITileStorageMonitorable) {
    ITileStorageMonitorable iface=(ITileStorageMonitorable)te;
    IStorageMonitorable sm=iface.getMonitorable(d);
    if (channel == StorageChannel.ITEMS && sm != null) {
      IMEInventory<IAEItemStack> ii=sm.getItemInventory();
      if (ii != null)       return ii;
    }
    if (channel == StorageChannel.FLUIDS && sm != null) {
      IMEInventory<IAEFluidStack> fi=sm.getFluidInventory();
      if (fi != null)       return fi;
    }
  }
  if (channel == StorageChannel.ITEMS && te instanceof IInventory) {
    return new MEMonitorIInventory((IInventory)te,d);
  }
  return null;
}

Fixed version (ground truth):
@Override public IMEInventory getInventory(TileEntity te,ForgeDirection d,StorageChannel channel){
  if (te instanceof TileCondenser) {
    if (channel == StorageChannel.ITEMS)     return new VoidItemInventory((TileCondenser)te);
 else     return new VoidFluidInventory((TileCondenser)te);
  }
  if (te instanceof ITileStorageMonitorable) {
    ITileStorageMonitorable iface=(ITileStorageMonitorable)te;
    IStorageMonitorable sm=iface.getMonitorable(d);
    if (channel == StorageChannel.ITEMS && sm != null) {
      IMEInventory<IAEItemStack> ii=sm.getItemInventory();
      if (ii != null)       return ii;
    }
    if (channel == StorageChannel.FLUIDS && sm != null) {
      IMEInventory<IAEFluidStack> fi=sm.getFluidInventory();
      if (fi != null)       return fi;
    }
  }
  return null;
}
Program: 30802
Project: 30802
Buggy source:
protected void QueueTunnelDrain(PowerUnits mj,float f){
}

Fixed version (ground truth):
protected void QueueTunnelDrain(PowerUnits mj,double f){
}
Program: 30805
Project: 30805
Buggy source:
protected void setTileEntiy(Class<? extends TileEntity> c){
  AEBaseTile.registerTileItem(c,new ItemStack(this));
  GameRegistry.registerTileEntity(tileEntityType=c,FeatureFullname);
}

Fixed version (ground truth):
protected void setTileEntiy(Class<? extends TileEntity> c){
  AEBaseTile.registerTileItem(c,new ItemStackSrc(this,0));
  GameRegistry.registerTileEntity(tileEntityType=c,FeatureFullname);
}
Program: 30808
Project: 30808
Buggy source:
public void add(AEColor v,ItemStack is){
  colors[v.ordinal()]=is;
}

Fixed version (ground truth):
public void add(AEColor v,ItemStackSrc is){
  colors[v.ordinal()]=is;
}
Program: 30809
Project: 30809
Buggy source:
@Override public Item item(AEColor color){
  ItemStack is=colors[color.ordinal()];
  if (is == null)   return null;
  return is.getItem();
}

Fixed version (ground truth):
@Override public Item item(AEColor color){
  ItemStackSrc is=colors[color.ordinal()];
  if (is == null)   return null;
  return is.item;
}
Program: 30810
Project: 30810
Buggy source:
@Override public ItemStack stack(AEColor color,int stackSize){
  ItemStack is=colors[color.ordinal()];
  if (is == null)   return null;
  return new ItemStack(is.getItem(),stackSize,is.getItemDamage());
}

Fixed version (ground truth):
@Override public ItemStack stack(AEColor color,int stackSize){
  ItemStackSrc is=colors[color.ordinal()];
  if (is == null)   return null;
  return is.stack(stackSize);
}
Program: 30811
Project: 30811
Buggy source:
@Override public boolean sameAs(AEColor color,ItemStack comparableItem){
  ItemStack is=colors[color.ordinal()];
  if (comparableItem == null)   return false;
  return comparableItem.getItem() == is.getItem() && comparableItem.getItemDamage() == is.getItemDamage();
}

Fixed version (ground truth):
@Override public boolean sameAs(AEColor color,ItemStack comparableItem){
  ItemStackSrc is=colors[color.ordinal()];
  if (comparableItem == null)   return false;
  return comparableItem.getItem() == is.item && comparableItem.getItemDamage() == is.damage;
}
Program: 30812
Project: 30812
Buggy source:
public DamagedItemDefinition(ItemStack is){
  if (is == null) {
    baseItem=null;
    damage=-1;
  }
 else {
    baseItem=is.getItem();
    damage=is.getItemDamage();
  }
}

Fixed version (ground truth):
public DamagedItemDefinition(ItemStackSrc is){
  if (is == null) {
    baseItem=null;
    damage=-1;
  }
 else {
    baseItem=is.item;
    damage=is.damage;
  }
}
Program: 30813
Project: 30813
Buggy source:
public ItemStack createMaterial(MaterialType mat){
  String name=mat.name();
  if (mat.damageValue == -1) {
    boolean enabled=true;
    for (    AEFeature f : mat.getFeature())     enabled=enabled && AEConfig.instance.isFeatureEnabled(f);
    if (enabled) {
      int newMaterialNum=AEConfig.instance.get("String_Node_Str",name,AEConfig.instance.getFreeMaterial()).getInt();
      mat.damageValue=newMaterialNum;
      ItemStack output=new ItemStack(this,1,newMaterialNum);
      output.setItemDamage(newMaterialNum);
      dmgToMaterial.put(newMaterialNum,mat);
      if (mat.getOreName() != null)       OreDictionary.registerOre(mat.getOreName(),output);
      return output;
    }
    return null;
  }
 else   throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
public ItemStackSrc createMaterial(MaterialType mat){
  String name=mat.name();
  if (mat.damageValue == -1) {
    boolean enabled=true;
    for (    AEFeature f : mat.getFeature())     enabled=enabled && AEConfig.instance.isFeatureEnabled(f);
    if (enabled) {
      int newMaterialNum=AEConfig.instance.get("String_Node_Str",name,AEConfig.instance.getFreeMaterial()).getInt();
      mat.damageValue=newMaterialNum;
      ItemStackSrc output=new ItemStackSrc(this,newMaterialNum);
      dmgToMaterial.put(newMaterialNum,mat);
      if (mat.getOreName() != null)       OreDictionary.registerOre(mat.getOreName(),output.stack(1));
      return output;
    }
    return null;
  }
 else   throw new RuntimeException("String_Node_Str");
}
Program: 30814
Project: 30814
Buggy source:
public ItemStack createPart(PartType mat,Enum varient){
  try {
    ItemStack is=new ItemStack(this);
    mat.getPart().getConstructor(ItemStack.class).newInstance(is);
  }
 catch (  Throwable e) {
    return null;
  }
  String name=varient == null ? mat.name() : mat.name() + "String_Node_Str" + varient.name();
  int varID=varient == null ? 0 : varient.ordinal();
  for (  PartTypeIst p : dmgToPart.values()) {
    if (p.part == mat && p.varient == varID)     throw new RuntimeException("String_Node_Str");
  }
  boolean enabled=true;
  for (  AEFeature f : mat.getFeature())   enabled=enabled && AEConfig.instance.isFeatureEnabled(f);
  if (enabled) {
    int newPartNum=AEConfig.instance.get("String_Node_Str",name,AEConfig.instance.getFreePart()).getInt();
    ItemStack output=new ItemStack(this);
    output.setItemDamage(newPartNum);
    PartTypeIst pti=new PartTypeIst();
    pti.part=mat;
    pti.varient=varID;
    dmgToPart.put(newPartNum,pti);
    return output;
  }
  return null;
}

Fixed version (ground truth):
public ItemStackSrc createPart(PartType mat,Enum varient){
  try {
    ItemStack is=new ItemStack(this);
    mat.getPart().getConstructor(ItemStack.class).newInstance(is);
  }
 catch (  Throwable e) {
    return null;
  }
  String name=varient == null ? mat.name() : mat.name() + "String_Node_Str" + varient.name();
  int varID=varient == null ? 0 : varient.ordinal();
  for (  PartTypeIst p : dmgToPart.values()) {
    if (p.part == mat && p.varient == varID)     throw new RuntimeException("String_Node_Str");
  }
  boolean enabled=true;
  for (  AEFeature f : mat.getFeature())   enabled=enabled && AEConfig.instance.isFeatureEnabled(f);
  if (enabled) {
    int newPartNum=AEConfig.instance.get("String_Node_Str",name,AEConfig.instance.getFreePart()).getInt();
    ItemStackSrc output=new ItemStackSrc(this,newPartNum);
    PartTypeIst pti=new PartTypeIst();
    pti.part=mat;
    pti.varient=varID;
    dmgToPart.put(newPartNum,pti);
    return output;
  }
  return null;
}
Program: 30815
Project: 30815
Buggy source:
static public void registerTileItem(Class c,ItemStack wat){
  myItem.put(c,wat);
}

Fixed version (ground truth):
static public void registerTileItem(Class c,ItemStackSrc wat){
  myItem.put(c,wat);
}
Program: 30816
Project: 30816
Buggy source:
protected ItemStack getItemFromTile(Object obj){
  return myItem.get(obj.getClass());
}

Fixed version (ground truth):
protected ItemStack getItemFromTile(Object obj){
  ItemStackSrc src=myItem.get(obj.getClass());
  if (src == null)   return null;
  return src.stack(1);
}
Program: 30817
Project: 30817
Buggy source:
public PacketValueConfig(String Name,String Value) throws IOException {
  this.Name=Name;
  this.Value=Value;
  ByteBuf data=Unpooled.buffer();
  data.writeInt(getPacketID());
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  DataOutputStream dos=new DataOutputStream(bos);
  data.writeBytes(Name.getBytes());
  data.writeBytes(Value.getBytes());
  dos.close();
  data.writeBytes(bos.toByteArray());
  configureWrite(data);
}

Fixed version (ground truth):
public PacketValueConfig(String Name,String Value) throws IOException {
  this.Name=Name;
  this.Value=Value;
  ByteBuf data=Unpooled.buffer();
  data.writeInt(getPacketID());
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  DataOutputStream dos=new DataOutputStream(bos);
  dos.writeUTF(Name);
  dos.writeUTF(Value);
  data.writeBytes(bos.toByteArray());
  configureWrite(data);
}
Program: 30821
Project: 30821
Buggy source:
@Override protected void keyTyped(char character,int key){
  if (!this.checkHotbarKeys(key)) {
    if (searchField.textboxKeyTyped(character,key)) {
      repo.searchString=this.searchField.getText();
      repo.updateView();
    }
 else {
      super.keyTyped(character,key);
    }
  }
}

Fixed version (ground truth):
@Override protected void keyTyped(char character,int key){
  if (!this.checkHotbarKeys(key)) {
    if (searchField.textboxKeyTyped(character,key)) {
      repo.searchString=this.searchField.getText();
      repo.updateView();
      setScrollBar();
    }
 else {
      super.keyTyped(character,key);
    }
  }
}
Program: 30822
Project: 30822
Buggy source:
@Override public void addCraftingToCrafters(ICrafting c){
  super.addCraftingToCrafters(c);
  if (Platform.isServer() && c instanceof Player && monitor != null) {
    try {
      PacketMEInventoryUpdate piu=new PacketMEInventoryUpdate();
      IItemList<IAEItemStack> monitorCache=monitor.getStorageList();
      for (      IAEItemStack send : monitorCache) {
        if (piu.getLength() > 20000) {
          Packet p=piu.getPacket();
          PacketDispatcher.sendPacketToPlayer(p,(Player)c);
          piu=new PacketMEInventoryUpdate();
        }
        piu.appendItem(send);
      }
      Packet p=piu.getPacket();
      PacketDispatcher.sendPacketToPlayer(p,(Player)c);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
@Override public void addCraftingToCrafters(ICrafting c){
  super.addCraftingToCrafters(c);
  if (Platform.isServer() && c instanceof Player && monitor != null) {
    try {
      PacketMEInventoryUpdate piu=new PacketMEInventoryUpdate();
      IItemList<IAEItemStack> monitorCache=monitor.getStorageList();
      for (      IAEItemStack send : monitorCache) {
        try {
          piu.appendItem(send);
        }
 catch (        BufferOverflowException boe) {
          Packet p=piu.getPacket();
          PacketDispatcher.sendPacketToPlayer(p,(Player)c);
          piu=new PacketMEInventoryUpdate();
          piu.appendItem(send);
        }
      }
      Packet p=piu.getPacket();
      PacketDispatcher.sendPacketToPlayer(p,(Player)c);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 30823
Project: 30823
Buggy source:
@Override public Packet250CustomPayload getPacket(){
  isChunkDataPacket=false;
  configureWrite(bytes.toByteArray());
  return super.getPacket();
}

Fixed version (ground truth):
@Override public Packet250CustomPayload getPacket(){
  isChunkDataPacket=false;
  byte[] dataOut=new byte[lastSize];
  System.arraycopy(bytes.toByteArray(),0,dataOut,0,lastSize);
  configureWrite(dataOut);
  return super.getPacket();
}
Program: 30824
Project: 30824
Buggy source:
public void appendItem(IAEItemStack is) throws IOException {
  is.writeToPacket(data);
  empty=false;
}

Fixed version (ground truth):
public void appendItem(IAEItemStack is) throws IOException, BufferOverflowException {
  is.writeToPacket(data);
  empty=false;
  if (bytes.size() > 20000)   throw new BufferOverflowException();
 else   lastSize=bytes.size();
}
Program: 30826
Project: 30826
Buggy source:
private void renderSegmentBlockCurrentBounds(BusRenderHelper instance,int x,int y,int z,RenderBlocks renderer,double minX,double minY,double minZ,double maxX,double maxY,double maxZ){
  double oldMinX=renderer.renderMinX;
  double oldMinY=renderer.renderMinY;
  double oldMinZ=renderer.renderMinZ;
  double oldMaxX=renderer.renderMaxX;
  double oldMaxY=renderer.renderMaxY;
  double oldMaxZ=renderer.renderMaxZ;
  renderer.renderMinX=Math.max(renderer.renderMinX,minX);
  renderer.renderMinY=Math.max(renderer.renderMinY,minY);
  renderer.renderMinZ=Math.max(renderer.renderMinZ,minZ);
  renderer.renderMaxX=Math.min(renderer.renderMaxX,maxX);
  renderer.renderMaxY=Math.min(renderer.renderMaxY,maxY);
  renderer.renderMaxZ=Math.min(renderer.renderMaxZ,maxZ);
  if (renderer.renderMaxX - renderer.renderMinX >= 1.0 / 16.0 && renderer.renderMaxY - renderer.renderMinY >= 1.0 / 16.0 && renderer.renderMaxZ - renderer.renderMinZ >= 1.0 / 16.0) {
    instance.renderBlockCurrentBounds(x,y,z,renderer);
  }
  renderer.renderMinX=oldMinX;
  renderer.renderMinY=oldMinY;
  renderer.renderMinZ=oldMinZ;
  renderer.renderMaxX=oldMaxX;
  renderer.renderMaxY=oldMaxY;
  renderer.renderMaxZ=oldMaxZ;
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) private void renderSegmentBlockCurrentBounds(BusRenderHelper instance,int x,int y,int z,RenderBlocks renderer,double minX,double minY,double minZ,double maxX,double maxY,double maxZ){
  double oldMinX=renderer.renderMinX;
  double oldMinY=renderer.renderMinY;
  double oldMinZ=renderer.renderMinZ;
  double oldMaxX=renderer.renderMaxX;
  double oldMaxY=renderer.renderMaxY;
  double oldMaxZ=renderer.renderMaxZ;
  renderer.renderMinX=Math.max(renderer.renderMinX,minX);
  renderer.renderMinY=Math.max(renderer.renderMinY,minY);
  renderer.renderMinZ=Math.max(renderer.renderMinZ,minZ);
  renderer.renderMaxX=Math.min(renderer.renderMaxX,maxX);
  renderer.renderMaxY=Math.min(renderer.renderMaxY,maxY);
  renderer.renderMaxZ=Math.min(renderer.renderMaxZ,maxZ);
  if (renderer.renderMaxX - renderer.renderMinX >= 1.0 / 16.0 && renderer.renderMaxY - renderer.renderMinY >= 1.0 / 16.0 && renderer.renderMaxZ - renderer.renderMinZ >= 1.0 / 16.0) {
    instance.renderBlockCurrentBounds(x,y,z,renderer);
  }
  renderer.renderMinX=oldMinX;
  renderer.renderMinY=oldMinY;
  renderer.renderMinZ=oldMinZ;
  renderer.renderMaxX=oldMaxX;
  renderer.renderMaxY=oldMaxY;
  renderer.renderMaxZ=oldMaxZ;
}
Program: 30827
Project: 30827
Buggy source:
@Override public void renderInventory(IPartRenderHelper instance,RenderBlocks renderer){
  if (facade != null) {
    IFacadeItem fi=(IFacadeItem)facade.getItem();
    try {
      ItemStack randomItem=fi.getTextureItem(facade);
      instance.setTexture(facade.getIconIndex());
      instance.setBounds(7,7,4,9,9,14);
      instance.renderInventoryBox(renderer);
      instance.setTexture(null);
      if (randomItem != null) {
        if (randomItem.getItem() instanceof ItemBlock) {
          ItemBlock ib=(ItemBlock)randomItem.getItem();
          Block blk=Block.blocksList[ib.getBlockID()];
          try {
            int color=ib.getColorFromItemStack(randomItem,0);
            float r=(color >> 16 & 0xff) / 255F;
            float g=(color >> 8 & 0xff) / 255F;
            float b=(color & 0xff) / 255F;
            GL11.glColor4f(r,g,b,1.0F);
          }
 catch (          Throwable error) {
          }
          GL11.glColor4f(1,1,1,1.0F);
          Tessellator.instance.setBrightness(15 << 20 | 15 << 4);
          Tessellator.instance.setColorOpaque_F(1,1,1);
          instance.setTexture(blk.getIcon(side.ordinal(),ib.getMetadata(randomItem.getItemDamage())));
          instance.setBounds(0,0,14,16,16,16);
          instance.renderInventoryBox(renderer);
          instance.setTexture(null);
          GL11.glColor4f(1.0f,1.0f,1.0f,1.0F);
          return;
        }
      }
    }
 catch (    Throwable t) {
    }
    return;
  }
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public void renderInventory(IPartRenderHelper instance,RenderBlocks renderer){
  if (facade != null) {
    IFacadeItem fi=(IFacadeItem)facade.getItem();
    try {
      ItemStack randomItem=fi.getTextureItem(facade);
      instance.setTexture(facade.getIconIndex());
      instance.setBounds(7,7,4,9,9,14);
      instance.renderInventoryBox(renderer);
      instance.setTexture(null);
      if (randomItem != null) {
        if (randomItem.getItem() instanceof ItemBlock) {
          ItemBlock ib=(ItemBlock)randomItem.getItem();
          Block blk=Block.blocksList[ib.getBlockID()];
          try {
            int color=ib.getColorFromItemStack(randomItem,0);
            float r=(color >> 16 & 0xff) / 255F;
            float g=(color >> 8 & 0xff) / 255F;
            float b=(color & 0xff) / 255F;
            GL11.glColor4f(r,g,b,1.0F);
          }
 catch (          Throwable error) {
          }
          GL11.glColor4f(1,1,1,1.0F);
          Tessellator.instance.setBrightness(15 << 20 | 15 << 4);
          Tessellator.instance.setColorOpaque_F(1,1,1);
          instance.setTexture(blk.getIcon(side.ordinal(),ib.getMetadata(randomItem.getItemDamage())));
          instance.setBounds(0,0,14,16,16,16);
          instance.renderInventoryBox(renderer);
          instance.setTexture(null);
          GL11.glColor4f(1.0f,1.0f,1.0f,1.0F);
          return;
        }
      }
    }
 catch (    Throwable t) {
    }
    return;
  }
}
Program: 30828
Project: 30828
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public IItemList<IAEItemStack> getAvailableItems(IItemList out){
  if (itemStorage != null)   return itemStorage.getAvailableItems(out);
  return out;
}

Fixed version (ground truth):
@Override public IItemList<IAEItemStack> getAvailableItems(IItemList out){
  if (itemStorage != null)   return itemStorage.getAvailableItems(out);
  return out;
}
Program: 30830
Project: 30830
Buggy source:
@Override public double extractAEPower(double amt,Actionable mode,Set<IEnergyGrid> seen){
  if (!seen.add(this))   return 0;
  double extractedPower=extra;
  if (mode == Actionable.SIMULATE) {
    extractedPower+=simulateExtract(extractedPower,amt);
    return extractedPower;
  }
 else   extractedPower+=doExtract(extractedPower,amt);
  if (extractedPower > amt) {
    extra=extractedPower - amt;
    globalAvailablePower-=amt;
    return amt;
  }
  if (extractedPower < amt) {
    Iterator<IEnergyGridProvider> i=gproviders.iterator();
    while (extractedPower < amt && i.hasNext())     extractedPower+=i.next().extractAEPower(amt - extractedPower,mode,seen);
  }
  globalAvailablePower-=extractedPower;
  return extractedPower;
}

Fixed version (ground truth):
@Override public double extractAEPower(double amt,Actionable mode,Set<IEnergyGrid> seen){
  if (!seen.add(this))   return 0;
  double extractedPower=extra;
  if (mode == Actionable.SIMULATE) {
    extractedPower+=simulateExtract(extractedPower,amt);
    if (extractedPower < amt) {
      Iterator<IEnergyGridProvider> i=gproviders.iterator();
      while (extractedPower < amt && i.hasNext())       extractedPower+=i.next().extractAEPower(amt - extractedPower,mode,seen);
    }
    return extractedPower;
  }
 else   extractedPower+=doExtract(extractedPower,amt);
  if (extractedPower > amt) {
    extra=extractedPower - amt;
    globalAvailablePower-=amt;
    return amt;
  }
  if (extractedPower < amt) {
    Iterator<IEnergyGridProvider> i=gproviders.iterator();
    while (extractedPower < amt && i.hasNext())     extractedPower+=i.next().extractAEPower(amt - extractedPower,mode,seen);
  }
  globalAvailablePower-=extractedPower;
  return extractedPower;
}
Program: 30831
Project: 30831
Buggy source:
@Override public void onSlotChanged(){
  super.onSlotChanged();
  isValid=hasCalculatedValidness.NotAvailable;
}

Fixed version (ground truth):
@Override public void onSlotChanged(){
  if (inventory instanceof AppEngInternalInventory)   ((AppEngInternalInventory)inventory).onInventoryChanged(getSlotIndex());
 else   super.onSlotChanged();
  isValid=hasCalculatedValidness.NotAvailable;
}
Program: 30832
Project: 30832
Buggy source:
public void onInventoryChanged(){
}

Fixed version (ground truth):
public void onInventoryChanged(){
  for (int slot=0; slot < storage.getSizeInventory(); slot++)   onChangeInventory(storage,slot,InvOperation.onInventoryChanged,null,null);
}
Program: 30833
Project: 30833
Buggy source:
@Override public void onInventoryChanged(){
  if (te != null && eventsEnabled()) {
    te.onChangeInventory(this,-1,InvOperation.onInventoryChanged,null,null);
  }
}

Fixed version (ground truth):
public void onInventoryChanged(int slotIndex){
  if (te != null && eventsEnabled()) {
    te.onChangeInventory(this,slotIndex,InvOperation.onInventoryChanged,null,null);
  }
}
Program: 30834
Project: 30834
Buggy source:
public static boolean isSameItemPrecise(ItemStack is,ItemStack filter){
  return isSameItem(is,filter);
}

Fixed version (ground truth):
public static boolean isSameItemPrecise(ItemStack is,ItemStack filter){
  return isSameItem(is,filter) && sameStackStags(is,filter);
}