nus-yam/ex-repair huggingface dataset:
Program: 30711
Project: 30711
Buggy source:
@Override public void Init(){
}

Fixed version (ground truth):
@Override public void Init(){
  api=(InvTweaksAPI)Loader.instance().getIndexedModList().get("String_Node_Str").getMod();
}
Program: 30714
Project: 30714
Buggy source:
public Class<? extends GuiContainer> getGuiClass(){
  return GuiInscriber.class;
}

Fixed version (ground truth):
public Class<? extends GuiContainer> getGuiClass(){
  return GuiGrinder.class;
}
Program: 30715
Project: 30715
Buggy source:
public OreRefrence isOre(ItemStack ItemStack){
  ItemRef ir=new ItemRef(ItemStack);
  OreResult or=refrences.get(ir);
  if (or == null) {
    or=new OreResult();
    refrences.put(ir,or);
    OreRefrence ref=new OreRefrence();
    Collection<Integer> ores=ref.getOres();
    Collection<ItemStack> set=ref.getEquivilients();
    Collection<IAEItemStack> aeset=ref.getAEEquivilients();
    for (    String ore : OreDictionary.getOreNames()) {
      boolean add=false;
      for (      ItemStack oreItem : OreDictionary.getOres(ore)) {
        if (OreDictionary.itemMatches(oreItem,ItemStack,false)) {
          add=true;
          set.add(oreItem.copy());
        }
      }
      if (add)       ores.add(OreDictionary.getOreID(ore));
    }
    if (!set.isEmpty()) {
      or.oreValue=ref;
      for (      ItemStack is : set)       aeset.add(AEItemStack.create(is));
    }
  }
  return or.oreValue;
}

Fixed version (ground truth):
public OreRefrence isOre(ItemStack ItemStack){
  ItemRef ir=new ItemRef(ItemStack);
  OreResult or=refrences.get(ir);
  if (or == null) {
    or=new OreResult();
    refrences.put(ir,or);
    OreRefrence ref=new OreRefrence();
    Collection<Integer> ores=ref.getOres();
    Collection<ItemStack> set=ref.getEquivilients();
    Collection<IAEItemStack> aeset=ref.getAEEquivilients();
    for (    String ore : OreDictionary.getOreNames()) {
      boolean add=false;
      for (      ItemStack oreItem : OreDictionary.getOres(ore)) {
        if (OreDictionary.itemMatches(oreItem,ItemStack,false)) {
          add=true;
          break;
        }
      }
      if (add) {
        for (        ItemStack oreItem : OreDictionary.getOres(ore))         set.add(oreItem.copy());
        ores.add(OreDictionary.getOreID(ore));
      }
    }
    if (!set.isEmpty()) {
      or.oreValue=ref;
      for (      ItemStack is : set)       aeset.add(AEItemStack.create(is));
    }
  }
  return or.oreValue;
}
Program: 30716
Project: 30716
Buggy source:
@Override public String[] getASMTransformerClass(){
  return new String[]{"String_Node_Str","String_Node_Str"};
}

Fixed version (ground truth):
@Override public String[] getASMTransformerClass(){
  return new String[]{"String_Node_Str"};
}
Program: 30717
Project: 30717
Buggy source:
@Override public void setInventorySlotContents(int var1,ItemStack var2){
  if (var2 == null)   makePlate();
}

Fixed version (ground truth):
@Override public void setInventorySlotContents(int var1,ItemStack var2){
  if (var2 == null && Platform.isServer())   makePlate();
}
Program: 30718
Project: 30718
Buggy source:
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;
  }
  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=mat.baseDamage + varID;
    ItemStackSrc output=new ItemStackSrc(this,newPartNum);
    PartTypeIst pti=new PartTypeIst();
    pti.part=mat;
    pti.varient=varID;
    if (dmgToPart.get(newPartNum) == null) {
      dmgToPart.put(newPartNum,pti);
      return output;
    }
 else     throw new RuntimeException("String_Node_Str");
  }
  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) {
    AELog.integration(e);
    return null;
  }
  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=mat.baseDamage + varID;
    ItemStackSrc output=new ItemStackSrc(this,newPartNum);
    PartTypeIst pti=new PartTypeIst();
    pti.part=mat;
    pti.varient=varID;
    if (dmgToPart.get(newPartNum) == null) {
      dmgToPart.put(newPartNum,pti);
      return output;
    }
 else     throw new RuntimeException("String_Node_Str");
  }
  return null;
}
Program: 30719
Project: 30719
Buggy source:
public void readClass(Class listAs,Class c){
  if (readClasses.contains(c))   return;
  readClasses.add(c);
  for (  Method m : c.getMethods()) {
    MENetworkEventSubscribe s=m.getAnnotation(MENetworkEventSubscribe.class);
    if (s != null) {
      Class types[]=m.getParameterTypes();
      if (types.length == 1) {
        if (MENetworkEvent.class.isAssignableFrom(types[0])) {
          Hashtable<Class,MENetworkEventInfo> classEvents=events.get(types[0]);
          if (classEvents == null)           events.put(types[0],classEvents=new Hashtable());
          MENetworkEventInfo thisEvent=classEvents.get(listAs);
          if (thisEvent == null)           thisEvent=new MENetworkEventInfo();
          thisEvent.Add(types[0],c,m);
          classEvents.put(listAs,thisEvent);
        }
 else         throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
      }
 else       throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void readClass(Class listAs,Class c){
  if (readClasses.contains(c))   return;
  readClasses.add(c);
  try {
    for (    Method m : c.getMethods()) {
      MENetworkEventSubscribe s=m.getAnnotation(MENetworkEventSubscribe.class);
      if (s != null) {
        Class types[]=m.getParameterTypes();
        if (types.length == 1) {
          if (MENetworkEvent.class.isAssignableFrom(types[0])) {
            Hashtable<Class,MENetworkEventInfo> classEvents=events.get(types[0]);
            if (classEvents == null)             events.put(types[0],classEvents=new Hashtable());
            MENetworkEventInfo thisEvent=classEvents.get(listAs);
            if (thisEvent == null)             thisEvent=new MENetworkEventInfo();
            thisEvent.Add(types[0],c,m);
            classEvents.put(listAs,thisEvent);
          }
 else           throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
        }
 else         throw new RuntimeException("String_Node_Str" + m.getName() + "String_Node_Str");
      }
    }
  }
 catch (  Throwable t) {
    throw new RuntimeException("String_Node_Str" + c.getName() + "String_Node_Str",t);
  }
}
Program: 30720
Project: 30720
Buggy source:
public ItemStackSrc createPart(OldPartType mat,Enum varient){
  try {
    ItemStack is=new ItemStack(this);
    mat.getPart().getConstructor(ItemStack.class).newInstance(is);
  }
 catch (  Throwable e) {
    e.printStackTrace();
    return null;
  }
  String name=varient == null ? mat.name() : mat.name() + "String_Node_Str" + varient.name();
  int varID=varient == null ? 0 : varient.ordinal();
  for (  OldPartTypeIst 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(mat.ordinal() * 32 + varID)).getInt();
    ItemStackSrc output=new ItemStackSrc(this,newPartNum);
    OldPartTypeIst pti=new OldPartTypeIst();
    pti.part=mat;
    pti.varient=varID;
    dmgToPart.put(newPartNum,pti);
    return output;
  }
  return null;
}

Fixed version (ground truth):
public ItemStackSrc createPart(OldPartType mat,Enum varient){
  try {
    ItemStack is=new ItemStack(this);
    mat.getPart().getConstructor(ItemStack.class).newInstance(is);
  }
 catch (  Throwable e) {
    AELog.integration(e);
    return null;
  }
  String name=varient == null ? mat.name() : mat.name() + "String_Node_Str" + varient.name();
  int varID=varient == null ? 0 : varient.ordinal();
  for (  OldPartTypeIst 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(mat.ordinal() * 32 + varID)).getInt();
    ItemStackSrc output=new ItemStackSrc(this,newPartNum);
    OldPartTypeIst pti=new OldPartTypeIst();
    pti.part=mat;
    pti.varient=varID;
    dmgToPart.put(newPartNum,pti);
    return output;
  }
  return null;
}
Program: 30721
Project: 30721
Buggy source:
public static IAEItemStack loadItemStackFromPacket(ByteBuf data) throws IOException {
  byte mask=data.readByte();
  byte StackType=(byte)((mask & 0x0C) >> 2);
  byte CountReqType=(byte)((mask & 0x30) >> 4);
  boolean isCraftable=(mask & 0x40) > 0;
  boolean hasTagCompound=(mask & 0x80) > 0;
  NBTTagCompound d=new NBTTagCompound();
  d.setShort("String_Node_Str",data.readShort());
  d.setShort("String_Node_Str",data.readShort());
  d.setByte("String_Node_Str",(byte)0);
  if (hasTagCompound) {
    int len=data.readInt();
    byte[] bd=new byte[len];
    data.readBytes(bd);
    DataInput di=ByteStreams.newDataInput(bd);
    d.setTag("String_Node_Str",CompressedStreamTools.read(di));
  }
  long stackSize=getPacketValue(StackType,data);
  long countRequestable=getPacketValue(CountReqType,data);
  ItemStack itemstack=ItemStack.loadItemStackFromNBT(d);
  if (itemstack == null)   return null;
  AEItemStack aeis=AEItemStack.create(itemstack);
  aeis.stackSize=stackSize;
  aeis.setCountRequestable(countRequestable);
  aeis.setCraftable(isCraftable);
  return aeis;
}

Fixed version (ground truth):
public static IAEItemStack loadItemStackFromPacket(ByteBuf data) throws IOException {
  byte mask=data.readByte();
  byte StackType=(byte)((mask & 0x0C) >> 2);
  byte CountReqType=(byte)((mask & 0x30) >> 4);
  boolean isCraftable=(mask & 0x40) > 0;
  boolean hasTagCompound=(mask & 0x80) > 0;
  NBTTagCompound d=new NBTTagCompound();
  d.setShort("String_Node_Str",data.readShort());
  d.setShort("String_Node_Str",data.readShort());
  d.setByte("String_Node_Str",(byte)0);
  if (hasTagCompound) {
    int len=data.readInt();
    byte[] bd=new byte[len];
    data.readBytes(bd);
    ByteArrayInputStream di=new ByteArrayInputStream(bd);
    d.setTag("String_Node_Str",CompressedStreamTools.read(new DataInputStream(di)));
  }
  long stackSize=getPacketValue(StackType,data);
  long countRequestable=getPacketValue(CountReqType,data);
  ItemStack itemstack=ItemStack.loadItemStackFromNBT(d);
  if (itemstack == null)   return null;
  AEItemStack aeis=AEItemStack.create(itemstack);
  aeis.stackSize=stackSize;
  aeis.setCountRequestable(countRequestable);
  aeis.setCraftable(isCraftable);
  return aeis;
}
Program: 30722
Project: 30722
Buggy source:
List<PartP2PLiquids> getOutputs(Fluid input){
  List<PartP2PLiquids> outs=new LinkedList<PartP2PLiquids>();
  try {
    for (    PartP2PLiquids l : getOutputs()) {
      IFluidHandler targ=getTarget();
      if (targ != null) {
        if (targ.canFill(side.getOpposite(),input))         outs.add(l);
      }
    }
  }
 catch (  GridAccessException e) {
  }
  return outs;
}

Fixed version (ground truth):
List<PartP2PLiquids> getOutputs(Fluid input){
  List<PartP2PLiquids> outs=new LinkedList<PartP2PLiquids>();
  try {
    for (    PartP2PLiquids l : getOutputs()) {
      IFluidHandler targ=l.getTarget();
      if (targ != null) {
        if (targ.canFill(side.getOpposite(),input))         outs.add(l);
      }
    }
  }
 catch (  GridAccessException e) {
  }
  return outs;
}
Program: 30723
Project: 30723
Buggy source:
IFluidHandler getTarget(){
  if (cachedTank != null)   return cachedTank;
  TileEntity te=tile.getWorldObj().getTileEntity(tile.xCoord + side.offsetX,tile.yCoord + side.offsetY,tile.zCoord + side.offsetZ);
  if (te instanceof IFluidHandler)   return cachedTank=(IFluidHandler)te;
  return null;
}

Fixed version (ground truth):
IFluidHandler getTarget(){
  if (!proxy.isActive())   return null;
  if (cachedTank != null)   return cachedTank;
  TileEntity te=tile.getWorldObj().getTileEntity(tile.xCoord + side.offsetX,tile.yCoord + side.offsetY,tile.zCoord + side.offsetZ);
  if (te instanceof IFluidHandler)   return cachedTank=(IFluidHandler)te;
  return null;
}
Program: 30727
Project: 30727
Buggy source:
@Override public void Init() throws Throwable {
  Method registerRecipeHandler=API.getDeclaredMethod("String_Node_Str",new Class[]{codechicken.nei.recipe.ICraftingHandler.class});
  Method registerUsageHandler=API.getDeclaredMethod("String_Node_Str",new Class[]{codechicken.nei.recipe.IUsageHandler.class});
  registerRecipeHandler.invoke(API,new NEIAEShapedRecipeHandler());
  registerUsageHandler.invoke(API,new NEIAEShapedRecipeHandler());
  registerRecipeHandler.invoke(API,new NEIAEShapelessRecipeHandler());
  registerUsageHandler.invoke(API,new NEIAEShapelessRecipeHandler());
}

Fixed version (ground truth):
@Override public void Init() throws Throwable {
  registerRecipeHandler=API.getDeclaredMethod("String_Node_Str",new Class[]{codechicken.nei.recipe.ICraftingHandler.class});
  registerUsageHandler=API.getDeclaredMethod("String_Node_Str",new Class[]{codechicken.nei.recipe.IUsageHandler.class});
  registerRecipeHandler(new NEIAEShapedRecipeHandler());
  registerRecipeHandler(new NEIAEShapelessRecipeHandler());
  registerRecipeHandler(new NEIInscriberRecipeHandler());
  Method registerGuiOverlay=API.getDeclaredMethod("String_Node_Str",new Class[]{Class.class,String.class,int.class,int.class});
  Class IOverlayHandler=Class.forName("String_Node_Str");
  Class DefaultOverlayHandler=NEICraftingHandler.class;
  Method registerGuiOverlayHandler=API.getDeclaredMethod("String_Node_Str",new Class[]{Class.class,IOverlayHandler,String.class});
  registerGuiOverlay.invoke(API,GuiCraftingTerm.class,"String_Node_Str",6,75);
  Constructor DefaultOverlayHandlerConstructor=DefaultOverlayHandler.getConstructor(new Class[]{int.class,int.class});
  registerGuiOverlayHandler.invoke(API,GuiCraftingTerm.class,DefaultOverlayHandlerConstructor.newInstance(6,75),"String_Node_Str");
}
Program: 30728
Project: 30728
Buggy source:
@Override public void onUpdateTick(){
  currentTick++;
  while (!upcomingTicks.isEmpty()) {
    TickTracker tt=upcomingTicks.peek();
    int diff=(int)(currentTick - tt.lastTick);
    if (diff >= tt.current_rate) {
      upcomingTicks.poll();
      TickRateModulation mod=tt.gt.tickingRequest(tt.node,diff);
switch (mod) {
case FASTER:
        tt.setRate(tt.current_rate - 1);
      break;
case IDLE:
    tt.setRate(tt.request.maxTickRate);
  break;
case SAME:
break;
case SLEEP:
sleepDevice(tt.node);
break;
case SLOWER:
tt.setRate(tt.current_rate + 1);
break;
case URGENT:
tt.setRate(0);
break;
default :
break;
}
if (awake.containsKey(tt.node)) addToQueue(tt);
}
 else return;
}
}

Fixed version (ground truth):
@Override public void onUpdateTick(){
  currentTick++;
  while (!upcomingTicks.isEmpty()) {
    TickTracker tt=upcomingTicks.peek();
    int diff=(int)(currentTick - tt.lastTick);
    if (diff >= tt.current_rate) {
      upcomingTicks.poll();
      TickRateModulation mod=tt.gt.tickingRequest(tt.node,diff);
switch (mod) {
case FASTER:
        tt.setRate(tt.current_rate - 2);
      break;
case IDLE:
    tt.setRate(tt.request.maxTickRate);
  break;
case SAME:
break;
case SLEEP:
sleepDevice(tt.node);
break;
case SLOWER:
tt.setRate(tt.current_rate + 1);
break;
case URGENT:
tt.setRate(0);
break;
default :
break;
}
if (awake.containsKey(tt.node)) addToQueue(tt);
}
 else return;
}
}
Program: 30729
Project: 30729
Buggy source:
private boolean importStuff(InventoryAdaptor myAdaptor,IAEItemStack whatToImport,IMEMonitor<IAEItemStack> inv,IEnergySource energy,FuzzyMode fzMode){
  if (itemToSend > 64)   itemToSend=64;
  ItemStack newItems;
  if (getInstalledUpgrades(Upgrades.FUZZY) > 0)   newItems=myAdaptor.removeSimilarItems(itemToSend,whatToImport == null ? null : whatToImport.getItemStack(),fzMode,configDest(inv));
 else   newItems=myAdaptor.removeItems(itemToSend,whatToImport == null ? null : whatToImport.getItemStack(),configDest(inv));
  if (newItems != null) {
    newItems.stackSize=(int)(Math.min(newItems.stackSize,energy.extractAEPower(newItems.stackSize,Actionable.SIMULATE,PowerMultiplier.CONFIG)) + 0.01);
    itemToSend-=newItems.stackSize;
    if (lastItemChecked == null || !lastItemChecked.isSameType(newItems))     lastItemChecked=AEApi.instance().storage().createItemStack(newItems);
 else     lastItemChecked.setStackSize(newItems.stackSize);
    IAEItemStack failed=Platform.poweredInsert(energy,destination,lastItemChecked,mySrc);
    if (failed != null) {
      myAdaptor.addItems(failed.getItemStack());
      return true;
    }
 else     worked=true;
  }
 else   return true;
  return false;
}

Fixed version (ground truth):
private boolean importStuff(InventoryAdaptor myAdaptor,IAEItemStack whatToImport,IMEMonitor<IAEItemStack> inv,IEnergySource energy,FuzzyMode fzMode){
  int toSend=this.itemToSend;
  if (toSend > 64)   toSend=64;
  ItemStack newItems;
  if (getInstalledUpgrades(Upgrades.FUZZY) > 0)   newItems=myAdaptor.removeSimilarItems(toSend,whatToImport == null ? null : whatToImport.getItemStack(),fzMode,configDest(inv));
 else   newItems=myAdaptor.removeItems(toSend,whatToImport == null ? null : whatToImport.getItemStack(),configDest(inv));
  if (newItems != null) {
    newItems.stackSize=(int)(Math.min(newItems.stackSize,energy.extractAEPower(newItems.stackSize,Actionable.SIMULATE,PowerMultiplier.CONFIG)) + 0.01);
    itemToSend-=newItems.stackSize;
    if (lastItemChecked == null || !lastItemChecked.isSameType(newItems))     lastItemChecked=AEApi.instance().storage().createItemStack(newItems);
 else     lastItemChecked.setStackSize(newItems.stackSize);
    IAEItemStack failed=Platform.poweredInsert(energy,destination,lastItemChecked,mySrc);
    if (failed != null) {
      myAdaptor.addItems(failed.getItemStack());
      return true;
    }
 else     worked=true;
  }
 else   return true;
  return false;
}
Program: 30730
Project: 30730
Buggy source:
private void visitorConnection(IGridVisitor g,LinkedList<GridNode> nextRun,LinkedList<IGridConnection> nextConnections){
  if (g.visitNode(this)) {
    for (    IGridConnection gc : getConnections()) {
      GridNode gn=(GridNode)gc.getOtherSide(this);
      GridConnection gcc=(GridConnection)gc;
      if (gcc.visitorIterationNumber != currentVisitorIterationNumber) {
        gcc.visitorIterationNumber=currentChannelsIterationNumber;
        nextConnections.add(gc);
      }
      if (currentVisitorIterationNumber == gn.visitorIterationNumber)       continue;
      gn.visitorIterationNumber=currentVisitorIterationNumber;
      nextRun.add(gn);
    }
  }
}

Fixed version (ground truth):
private void visitorConnection(Object tracker,IGridVisitor g,LinkedList<GridNode> nextRun,LinkedList<IGridConnection> nextConnections){
  if (g.visitNode(this)) {
    for (    IGridConnection gc : getConnections()) {
      GridNode gn=(GridNode)gc.getOtherSide(this);
      GridConnection gcc=(GridConnection)gc;
      if (gcc.visitorIterationNumber != tracker) {
        gcc.visitorIterationNumber=tracker;
        nextConnections.add(gc);
      }
      if (tracker == gn.visitorIterationNumber)       continue;
      gn.visitorIterationNumber=tracker;
      nextRun.add(gn);
    }
  }
}
Program: 30731
Project: 30731
Buggy source:
private void visitorNode(IGridVisitor g,LinkedList<GridNode> nextRun){
  if (g.visitNode(this)) {
    for (    IGridConnection gc : getConnections()) {
      GridNode gn=(GridNode)gc.getOtherSide(this);
      if (currentVisitorIterationNumber == gn.visitorIterationNumber)       continue;
      gn.visitorIterationNumber=currentVisitorIterationNumber;
      nextRun.add(gn);
    }
  }
}

Fixed version (ground truth):
private void visitorNode(Object tracker,IGridVisitor g,LinkedList<GridNode> nextRun){
  if (g.visitNode(this)) {
    for (    IGridConnection gc : getConnections()) {
      GridNode gn=(GridNode)gc.getOtherSide(this);
      if (tracker == gn.visitorIterationNumber)       continue;
      gn.visitorIterationNumber=tracker;
      nextRun.add(gn);
    }
  }
}
Program: 30732
Project: 30732
Buggy source:
@Override public void beginVisition(IGridVisitor g){
  currentVisitorIterationNumber++;
  LinkedList<GridNode> nextRun=new LinkedList();
  nextRun.add(this);
  visitorIterationNumber=currentVisitorIterationNumber;
  if (g instanceof IGridConnecitonVisitor) {
    LinkedList<IGridConnection> nextConn=new LinkedList();
    IGridConnecitonVisitor gcv=(IGridConnecitonVisitor)g;
    while (!nextRun.isEmpty()) {
      while (!nextConn.isEmpty())       gcv.visitConnection(nextConn.poll());
      LinkedList<GridNode> thisRun=nextRun;
      nextRun=new LinkedList();
      for (      GridNode n : thisRun)       n.visitorConnection(g,nextRun,nextConn);
    }
  }
 else {
    while (!nextRun.isEmpty()) {
      LinkedList<GridNode> thisRun=nextRun;
      nextRun=new LinkedList();
      for (      GridNode n : thisRun)       n.visitorNode(g,nextRun);
    }
  }
}

Fixed version (ground truth):
@Override public void beginVisition(IGridVisitor g){
  Object tracker=new Object();
  LinkedList<GridNode> nextRun=new LinkedList();
  nextRun.add(this);
  visitorIterationNumber=tracker;
  if (g instanceof IGridConnecitonVisitor) {
    LinkedList<IGridConnection> nextConn=new LinkedList();
    IGridConnecitonVisitor gcv=(IGridConnecitonVisitor)g;
    while (!nextRun.isEmpty()) {
      while (!nextConn.isEmpty())       gcv.visitConnection(nextConn.poll());
      LinkedList<GridNode> thisRun=nextRun;
      nextRun=new LinkedList();
      for (      GridNode n : thisRun)       n.visitorConnection(tracker,g,nextRun,nextConn);
    }
  }
 else {
    while (!nextRun.isEmpty()) {
      LinkedList<GridNode> thisRun=nextRun;
      nextRun=new LinkedList();
      for (      GridNode n : thisRun)       n.visitorNode(tracker,g,nextRun);
    }
  }
}
Program: 30734
Project: 30734
Buggy source:
@Override public void onUpdateTick(){
  if (!interests.isEmpty()) {
    double oldPower=lastStoredPower;
    lastStoredPower=getStoredPower();
    EnergyThreshold low=new EnergyThreshold(Math.min(oldPower,lastStoredPower),null);
    EnergyThreshold high=new EnergyThreshold(Math.max(oldPower,lastStoredPower),null);
    for (    EnergyThreshold th : interests.subSet(low,true,high,true)) {
      ((EnergyWatcher)th.watcher).post(this);
    }
  }
  avgDrainPerTick*=(AvgLength - 1) / AvgLength;
  avgInjectionPerTick*=(AvgLength - 1) / AvgLength;
  avgDrainPerTick+=tickDrainPerTick / AvgLength;
  avgInjectionPerTick+=tickInjectionPerTick / AvgLength;
  tickDrainPerTick=0;
  tickInjectionPerTick=0;
  double drained=extractAEPower(getIdlePowerUsage(),Actionable.MODULATE,PowerMultiplier.CONFIG);
  boolean currentlyHasPower=drained >= drainPerTick - 0.1;
  if (currentlyHasPower == hasPower)   ticksSinceHasPowerChange++;
 else   ticksSinceHasPowerChange=0;
  hasPower=currentlyHasPower;
  if (hasPower && ticksSinceHasPowerChange > 30)   publicPowerState(true,myGrid);
 else   if (!hasPower)   publicPowerState(false,myGrid);
  availableTicksSinceUpdate++;
}

Fixed version (ground truth):
@Override public void onUpdateTick(){
  if (!interests.isEmpty()) {
    double oldPower=lastStoredPower;
    lastStoredPower=getStoredPower();
    EnergyThreshold low=new EnergyThreshold(Math.min(oldPower,lastStoredPower),null);
    EnergyThreshold high=new EnergyThreshold(Math.max(oldPower,lastStoredPower),null);
    for (    EnergyThreshold th : interests.subSet(low,true,high,true)) {
      ((EnergyWatcher)th.watcher).post(this);
    }
  }
  avgDrainPerTick*=(AvgLength - 1) / AvgLength;
  avgInjectionPerTick*=(AvgLength - 1) / AvgLength;
  avgDrainPerTick+=tickDrainPerTick / AvgLength;
  avgInjectionPerTick+=tickInjectionPerTick / AvgLength;
  tickDrainPerTick=0;
  tickInjectionPerTick=0;
  double drained=extractAEPower(getIdlePowerUsage(),Actionable.MODULATE,PowerMultiplier.CONFIG);
  boolean currentlyHasPower=drained >= drainPerTick - 0.001;
  if (currentlyHasPower == hasPower)   ticksSinceHasPowerChange++;
 else   ticksSinceHasPowerChange=0;
  hasPower=currentlyHasPower;
  if (hasPower && ticksSinceHasPowerChange > 30)   publicPowerState(true,myGrid);
 else   if (!hasPower)   publicPowerState(false,myGrid);
  availableTicksSinceUpdate++;
}
Program: 30735
Project: 30735
Buggy source:
@Override public void updateSetting(IConfigManager manager,Enum setting,Enum newValue){
  for (  Enum e : settings.getSettings()) {
    String Category=e.getClass().getSimpleName();
    this.get(Category,e.name(),settings.getSetting(e).name());
  }
  save();
}

Fixed version (ground truth):
@Override public void updateSetting(IConfigManager manager,Enum setting,Enum newValue){
  for (  Enum e : settings.getSettings()) {
    if (e == setting) {
      String Category=e.getClass().getSimpleName();
      Property p=this.get(Category,e.name(),settings.getSetting(e).name());
      p.set(newValue.name());
    }
  }
  save();
}
Program: 30738
Project: 30738
Buggy source:
@Override public TickingRequest getTickingRequest(IGridNode node){
  return new TickingRequest(TickRates.METunnel.min,TickRates.METunnel.max,output,false);
}

Fixed version (ground truth):
@Override public TickingRequest getTickingRequest(IGridNode node){
  return new TickingRequest(TickRates.METunnel.min,TickRates.METunnel.max,true,false);
}
Program: 30740
Project: 30740
Buggy source:
@EventHandler void Init(FMLInitializationEvent event){
  AELog.info("String_Node_Str");
  Registration.instance.Init(event);
  integrationModules.init();
  AELog.info("String_Node_Str");
}

Fixed version (ground truth):
@EventHandler void Init(FMLInitializationEvent event){
  Stopwatch star=Stopwatch.createStarted();
  AELog.info("String_Node_Str");
  Registration.instance.Init(event);
  integrationModules.init();
  AELog.info("String_Node_Str" + star.elapsed(TimeUnit.MILLISECONDS) + "String_Node_Str");
}
Program: 30741
Project: 30741
Buggy source:
@EventHandler void PostInit(FMLPostInitializationEvent event){
  AELog.info("String_Node_Str");
  Registration.instance.PostInit(event);
  integrationModules.postinit();
  AEConfig.instance.save();
  NetworkRegistry.INSTANCE.registerGuiHandler(this,GuiBridge.GUI_Handler);
  NetworkHandler.instance=new NetworkHandler("String_Node_Str");
  AELog.info("String_Node_Str");
}

Fixed version (ground truth):
@EventHandler void PostInit(FMLPostInitializationEvent event){
  Stopwatch star=Stopwatch.createStarted();
  AELog.info("String_Node_Str");
  Registration.instance.PostInit(event);
  integrationModules.postinit();
  AEConfig.instance.save();
  NetworkRegistry.INSTANCE.registerGuiHandler(this,GuiBridge.GUI_Handler);
  NetworkHandler.instance=new NetworkHandler("String_Node_Str");
  AELog.info("String_Node_Str" + star.elapsed(TimeUnit.MILLISECONDS) + "String_Node_Str");
}
Program: 30742
Project: 30742
Buggy source:
@EventHandler void PreInit(FMLPreInitializationEvent event){
  configPath=event.getModConfigurationDirectory().getPath() + File.separator + "String_Node_Str"+ File.separator;
  AEConfig.instance=new AEConfig(configPath);
  FacadeConfig.instance=new FacadeConfig(configPath);
  AELog.info("String_Node_Str");
  if (Platform.isClient()) {
    CreativeTab.init();
    CreativeTabFacade.init();
    CommonHelper.proxy.init();
  }
  Registration.instance.PreInit(event);
  if (AEConfig.instance.isFeatureEnabled(AEFeature.Profiler)) {
    AELog.info("String_Node_Str");
    startService("String_Node_Str",(new Thread(Profiler.instance=new Profiler())));
  }
  if (AEConfig.instance.isFeatureEnabled(AEFeature.VersionChecker)) {
    AELog.info("String_Node_Str");
    startService("String_Node_Str",new Thread(VersionChecker.instance=new VersionChecker()));
  }
  AELog.info("String_Node_Str");
}

Fixed version (ground truth):
@EventHandler void PreInit(FMLPreInitializationEvent event){
  Stopwatch star=Stopwatch.createStarted();
  configPath=event.getModConfigurationDirectory().getPath() + File.separator + "String_Node_Str"+ File.separator;
  AEConfig.instance=new AEConfig(configPath);
  FacadeConfig.instance=new FacadeConfig(configPath);
  AELog.info("String_Node_Str");
  if (Platform.isClient()) {
    CreativeTab.init();
    CreativeTabFacade.init();
    CommonHelper.proxy.init();
  }
  Registration.instance.PreInit(event);
  if (AEConfig.instance.isFeatureEnabled(AEFeature.Profiler)) {
    AELog.info("String_Node_Str");
    startService("String_Node_Str",(new Thread(Profiler.instance=new Profiler())));
  }
  if (AEConfig.instance.isFeatureEnabled(AEFeature.VersionChecker)) {
    AELog.info("String_Node_Str");
    startService("String_Node_Str",new Thread(VersionChecker.instance=new VersionChecker()));
  }
  AELog.info("String_Node_Str" + star.elapsed(TimeUnit.MILLISECONDS) + "String_Node_Str");
}
Program: 30743
Project: 30743
Buggy source:
public TileInscriberHandler(){
  super(TileEventType.TICK,TileEventType.WORLD_NBT,TileEventType.NETWORK);
}

Fixed version (ground truth):
public TileInscriberHandler(){
  super(TileEventType.WORLD_NBT,TileEventType.NETWORK);
}
Program: 30745
Project: 30745
Buggy source:
@Override public void addNode(IGridNode node,IGridHost machine){
  if (machine instanceof IEnergyGridProvider)   gproviders.add((IEnergyGridProvider)machine);
  GridNode gnode=(GridNode)node;
  IGridBlock gb=gnode.getGridBlock();
  gnode.previousDraw=gb.getIdlePowerUsage();
  drainPerTick+=gnode.previousDraw;
  if (machine instanceof IAEPowerStorage) {
    IAEPowerStorage ps=(IAEPowerStorage)machine;
    if (ps.isAEPublicPowerStorage()) {
      double max=ps.getAEMaxPower();
      double current=ps.getAECurrentPower();
      if (current > 0 && ps.getPowerFlow() != AccessRestriction.WRITE) {
        globalMaxPower+=ps.getAEMaxPower();
        globalAvailablePower+=((IAEPowerStorage)machine).getAECurrentPower();
        providers.add(ps);
      }
      if (current < max && ps.getPowerFlow() != AccessRestriction.READ)       requesters.add(ps);
    }
  }
  if (machine instanceof IEnergyWatcherHost) {
    IEnergyWatcherHost swh=(IEnergyWatcherHost)machine;
    EnergyWatcher iw=new EnergyWatcher(this,(IEnergyWatcherHost)swh);
    watchers.put(node,iw);
    swh.updateWatcher(iw);
  }
  myGrid.postEventTo(node,new MENetworkPowerStatusChange());
}

Fixed version (ground truth):
@Override public void addNode(IGridNode node,IGridHost machine){
  if (machine instanceof IEnergyGridProvider)   gproviders.add((IEnergyGridProvider)machine);
  GridNode gnode=(GridNode)node;
  IGridBlock gb=gnode.getGridBlock();
  gnode.previousDraw=gb.getIdlePowerUsage();
  drainPerTick+=gnode.previousDraw;
  if (machine instanceof IAEPowerStorage) {
    IAEPowerStorage ps=(IAEPowerStorage)machine;
    if (ps.isAEPublicPowerStorage()) {
      double max=ps.getAEMaxPower();
      double current=ps.getAECurrentPower();
      if (ps.getPowerFlow() != AccessRestriction.WRITE) {
        globalMaxPower+=ps.getAEMaxPower();
      }
      if (current > 0 && ps.getPowerFlow() != AccessRestriction.WRITE) {
        globalAvailablePower+=current;
        providers.add(ps);
      }
      if (current < max && ps.getPowerFlow() != AccessRestriction.READ)       requesters.add(ps);
    }
  }
  if (machine instanceof IEnergyWatcherHost) {
    IEnergyWatcherHost swh=(IEnergyWatcherHost)machine;
    EnergyWatcher iw=new EnergyWatcher(this,(IEnergyWatcherHost)swh);
    watchers.put(node,iw);
    swh.updateWatcher(iw);
  }
  myGrid.postEventTo(node,new MENetworkPowerStatusChange());
}
Program: 30746
Project: 30746
Buggy source:
@Override public boolean onActivated(World w,int x,int y,int z,EntityPlayer p,int side,float hitX,float hitY,float hitZ){
  TileChest tg=getTileEntity(w,x,y,z);
  if (tg != null && !p.isSneaking()) {
    if (Platform.isClient())     return true;
    if (side != tg.getUp().ordinal()) {
      Platform.openGUI(p,tg,ForgeDirection.getOrientation(side),GuiBridge.GUI_CHEST);
    }
 else     if (tg.isPowered()) {
      ItemStack cell=tg.getStackInSlot(1);
      if (cell != null) {
        ICellHandler ch=AEApi.instance().registries().cell().getHander(cell);
        tg.openGui(p,ch,cell,side);
      }
 else       p.addChatMessage(PlayerMessages.ChestCannotReadStorageCell.get());
    }
 else     p.addChatMessage(PlayerMessages.MachineNotPowered.get());
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onActivated(World w,int x,int y,int z,EntityPlayer p,int side,float hitX,float hitY,float hitZ){
  TileChest tg=getTileEntity(w,x,y,z);
  if (tg != null && !p.isSneaking()) {
    if (Platform.isClient())     return true;
    if (side != tg.getUp().ordinal()) {
      Platform.openGUI(p,tg,ForgeDirection.getOrientation(side),GuiBridge.GUI_CHEST);
    }
 else     if (tg.isPowered()) {
      ItemStack cell=tg.getStackInSlot(1);
      if (cell != null) {
        ICellHandler ch=AEApi.instance().registries().cell().getHandler(cell);
        tg.openGui(p,ch,cell,side);
      }
 else       p.addChatMessage(PlayerMessages.ChestCannotReadStorageCell.get());
    }
 else     p.addChatMessage(PlayerMessages.MachineNotPowered.get());
    return true;
  }
  return false;
}
Program: 30748
Project: 30748
Buggy source:
public IMEInventoryHandler getHandler(StorageChannel channel) throws ChestNoHandler {
  if (!isCached) {
    icell=null;
    fcell=null;
    ItemStack is=inv.getStackInSlot(1);
    if (is != null) {
      isCached=true;
      cellHandler=AEApi.instance().registries().cell().getHander(is);
      if (cellHandler != null) {
        double power=1.0;
        IMEInventoryHandler<IAEItemStack> itemCell=cellHandler.getCellInventory(is,StorageChannel.ITEMS);
        IMEInventoryHandler<IAEFluidStack> fluidCell=cellHandler.getCellInventory(is,StorageChannel.FLUIDS);
        if (itemCell != null)         power+=cellHandler.cellIdleDrain(is,itemCell);
 else         if (fluidCell != null)         power+=cellHandler.cellIdleDrain(is,fluidCell);
        gridProxy.setIdlePowerUsage(power);
        icell=wrap(itemCell);
        fcell=wrap(fluidCell);
      }
    }
  }
switch (channel) {
case FLUIDS:
    if (fcell == null)     throw noHandler;
  return fcell;
case ITEMS:
if (icell == null) throw noHandler;
return icell;
default :
}
return null;
}

Fixed version (ground truth):
public IMEInventoryHandler getHandler(StorageChannel channel) throws ChestNoHandler {
  if (!isCached) {
    icell=null;
    fcell=null;
    ItemStack is=inv.getStackInSlot(1);
    if (is != null) {
      isCached=true;
      cellHandler=AEApi.instance().registries().cell().getHandler(is);
      if (cellHandler != null) {
        double power=1.0;
        IMEInventoryHandler<IAEItemStack> itemCell=cellHandler.getCellInventory(is,StorageChannel.ITEMS);
        IMEInventoryHandler<IAEFluidStack> fluidCell=cellHandler.getCellInventory(is,StorageChannel.FLUIDS);
        if (itemCell != null)         power+=cellHandler.cellIdleDrain(is,itemCell);
 else         if (fluidCell != null)         power+=cellHandler.cellIdleDrain(is,fluidCell);
        gridProxy.setIdlePowerUsage(power);
        icell=wrap(itemCell);
        fcell=wrap(fluidCell);
      }
    }
  }
switch (channel) {
case FLUIDS:
    if (fcell == null)     throw noHandler;
  return fcell;
case ITEMS:
if (icell == null) throw noHandler;
return icell;
default :
}
return null;
}
Program: 30749
Project: 30749
Buggy source:
@Override public int getCellStatus(int slot){
  if (Platform.isClient())   return (state >> (slot * 3)) & 3;
  ItemStack cell=inv.getStackInSlot(1);
  ICellHandler ch=AEApi.instance().registries().cell().getHander(cell);
  if (ch != null) {
    try {
      IMEInventoryHandler handler=getHandler(StorageChannel.ITEMS);
      if (ch != null && handler instanceof ChestMonitorHandler)       return ch.getStatusForCell(cell,((ChestMonitorHandler)handler).getInternalHandler());
    }
 catch (    ChestNoHandler e) {
    }
    try {
      IMEInventoryHandler handler=getHandler(StorageChannel.FLUIDS);
      if (ch != null && handler instanceof ChestMonitorHandler)       return ch.getStatusForCell(cell,((ChestMonitorHandler)handler).getInternalHandler());
    }
 catch (    ChestNoHandler e) {
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int getCellStatus(int slot){
  if (Platform.isClient())   return (state >> (slot * 3)) & 3;
  ItemStack cell=inv.getStackInSlot(1);
  ICellHandler ch=AEApi.instance().registries().cell().getHandler(cell);
  if (ch != null) {
    try {
      IMEInventoryHandler handler=getHandler(StorageChannel.ITEMS);
      if (ch != null && handler instanceof ChestMonitorHandler)       return ch.getStatusForCell(cell,((ChestMonitorHandler)handler).getInternalHandler());
    }
 catch (    ChestNoHandler e) {
    }
    try {
      IMEInventoryHandler handler=getHandler(StorageChannel.FLUIDS);
      if (ch != null && handler instanceof ChestMonitorHandler)       return ch.getStatusForCell(cell,((ChestMonitorHandler)handler).getInternalHandler());
    }
 catch (    ChestNoHandler e) {
    }
  }
  return 0;
}
Program: 30750
Project: 30750
Buggy source:
public void updateState(){
  if (!isCached) {
    items=new LinkedList();
    fluids=new LinkedList();
    double power=2.0;
    for (int x=0; x < inv.getSizeInventory(); x++) {
      ItemStack is=inv.getStackInSlot(x);
      invBySlot[x]=null;
      handlersBySlot[x]=null;
      if (is != null) {
        handlersBySlot[x]=AEApi.instance().registries().cell().getHander(is);
        if (handlersBySlot[x] != null) {
          IMEInventoryHandler cell=handlersBySlot[x].getCellInventory(is,StorageChannel.ITEMS);
          if (cell != null) {
            power+=handlersBySlot[x].cellIdleDrain(is,cell);
            DriveWatcher<IAEItemStack> ih=new DriveWatcher(cell,is,handlersBySlot[x],this);
            ih.myPriority=priority;
            invBySlot[x]=ih;
            items.add(ih);
          }
 else {
            cell=handlersBySlot[x].getCellInventory(is,StorageChannel.FLUIDS);
            if (cell != null) {
              power+=handlersBySlot[x].cellIdleDrain(is,cell);
              DriveWatcher<IAEItemStack> ih=new DriveWatcher(cell,is,handlersBySlot[x],this);
              ih.myPriority=priority;
              invBySlot[x]=ih;
              fluids.add(ih);
            }
          }
        }
      }
    }
    gridProxy.setIdlePowerUsage(power);
    isCached=true;
  }
}

Fixed version (ground truth):
public void updateState(){
  if (!isCached) {
    items=new LinkedList();
    fluids=new LinkedList();
    double power=2.0;
    for (int x=0; x < inv.getSizeInventory(); x++) {
      ItemStack is=inv.getStackInSlot(x);
      invBySlot[x]=null;
      handlersBySlot[x]=null;
      if (is != null) {
        handlersBySlot[x]=AEApi.instance().registries().cell().getHandler(is);
        if (handlersBySlot[x] != null) {
          IMEInventoryHandler cell=handlersBySlot[x].getCellInventory(is,StorageChannel.ITEMS);
          if (cell != null) {
            power+=handlersBySlot[x].cellIdleDrain(is,cell);
            DriveWatcher<IAEItemStack> ih=new DriveWatcher(cell,is,handlersBySlot[x],this);
            ih.myPriority=priority;
            invBySlot[x]=ih;
            items.add(ih);
          }
 else {
            cell=handlersBySlot[x].getCellInventory(is,StorageChannel.FLUIDS);
            if (cell != null) {
              power+=handlersBySlot[x].cellIdleDrain(is,cell);
              DriveWatcher<IAEItemStack> ih=new DriveWatcher(cell,is,handlersBySlot[x],this);
              ih.myPriority=priority;
              invBySlot[x]=ih;
              fluids.add(ih);
            }
          }
        }
      }
    }
    gridProxy.setIdlePowerUsage(power);
    isCached=true;
  }
}
Program: 30751
Project: 30751
Buggy source:
@EventHandler public void serverStarting(FMLServerStartingEvent evt){
  WorldSettings.getInstance().init();
  evt.registerServerCommand(new AECommand(evt.getServer()));
}

Fixed version (ground truth):
@EventHandler public void serverStarting(FMLServerStartingEvent evt){
  evt.registerServerCommand(new AECommand(evt.getServer()));
}
Program: 30752
Project: 30752
Buggy source:
@Override public void generate(Random r,int chunkX,int chunkZ,World w,IChunkProvider chunkGenerator,IChunkProvider chunkProvider){
  if (r.nextFloat() > 0.9) {
    int x=r.nextInt(16) + (chunkX << 4);
    int z=r.nextInt(16) + (chunkZ << 4);
    myGen obj=new myGen();
    Future<?> future=WorldSettings.getInstance().getCompass().getCompassDirection(new DimensionalCoord(w,x,128,z),70,obj);
    try {
      future.get();
      if (obj.distance > AEConfig.instance.minMeteoriteDistanceSq) {
        int depth=180 + r.nextInt(20);
        for (int trys=0; trys < 20; trys++) {
          MeteoritePlacer mp=new MeteoritePlacer();
          if (mp.spawnMeteorite(w,x,depth,z))           return;
          depth-=15;
          if (depth < 40)           return;
        }
      }
    }
 catch (    InterruptedException e) {
      AELog.error(e);
    }
catch (    ExecutionException e) {
      AELog.error(e);
    }
  }
}

Fixed version (ground truth):
@Override public void generate(Random r,int chunkX,int chunkZ,World w,IChunkProvider chunkGenerator,IChunkProvider chunkProvider){
  if (r.nextFloat() > 0.9) {
    int x=r.nextInt(16) + (chunkX << 4);
    int z=r.nextInt(16) + (chunkZ << 4);
    myGen obj=new myGen();
    Future<?> future=WorldSettings.getInstance().getCompass().getCompassDirection(new DimensionalCoord(w,x,128,z),70,obj);
    try {
      future.get();
      if (obj.distance > AEConfig.instance.minMeteoriteDistanceSq) {
        int depth=180 + r.nextInt(20);
        for (int trys=0; trys < 20; trys++) {
          MeteoritePlacer mp=new MeteoritePlacer();
          if (mp.spawnMeteorite(w,x,depth,z))           return;
          depth-=15;
          if (depth < 40)           return;
        }
      }
    }
 catch (    Throwable e) {
      AELog.error(e);
    }
  }
}
Program: 30753
Project: 30753
Buggy source:
@Override protected boolean checkHotbarKeys(int p_146983_1_){
  Slot theSlot=ReflectionHelper.getPrivateValue(GuiContainer.class,this,"String_Node_Str");
  if (this.mc.thePlayer.inventory.getItemStack() == null && theSlot != null) {
    for (int j=0; j < 9; ++j) {
      if (p_146983_1_ == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode()) {
        if (theSlot.getSlotStackLimit() == 64) {
          this.handleMouseClick(theSlot,theSlot.slotNumber,j,2);
          return true;
        }
 else {
          try {
            for (            Slot s : (List<Slot>)inventorySlots.inventorySlots) {
              if (s.getSlotIndex() == j && s.inventory == ((AEBaseContainer)inventorySlots).getPlayerInv()) {
                NetworkHandler.instance.sendToServer(new PacketSwapSlots(s.slotNumber,theSlot.slotNumber));
                return true;
              }
            }
          }
 catch (          IOException e) {
            AELog.error(e);
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean checkHotbarKeys(int p_146983_1_){
  Slot theSlot;
  try {
    theSlot=ObfuscationReflectionHelper.getPrivateValue(GuiContainer.class,this,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Throwable t) {
    return false;
  }
  if (this.mc.thePlayer.inventory.getItemStack() == null && theSlot != null) {
    for (int j=0; j < 9; ++j) {
      if (p_146983_1_ == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode()) {
        if (theSlot.getSlotStackLimit() == 64) {
          this.handleMouseClick(theSlot,theSlot.slotNumber,j,2);
          return true;
        }
 else {
          try {
            for (            Slot s : (List<Slot>)inventorySlots.inventorySlots) {
              if (s.getSlotIndex() == j && s.inventory == ((AEBaseContainer)inventorySlots).getPlayerInv()) {
                NetworkHandler.instance.sendToServer(new PacketSwapSlots(s.slotNumber,theSlot.slotNumber));
                return true;
              }
            }
          }
 catch (          IOException e) {
            AELog.error(e);
          }
        }
      }
    }
  }
  return false;
}
Program: 30754
Project: 30754
Buggy source:
@Override public boolean isLadder(EntityLivingBase entity){
  return mySide.offsetY == 0;
}

Fixed version (ground truth):
@Override public boolean isLadder(EntityLivingBase entity){
  return mySide.offsetY == 0 && entity.isCollidedHorizontally;
}
Program: 30755
Project: 30755
Buggy source:
@Override public boolean isDamaged(ItemStack stack){
  if (stack.getItemDamage() % 200 == 0)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean isDamaged(ItemStack stack){
  return false;
}
Program: 30756
Project: 30756
Buggy source:
@Override public boolean onItemUseFirst(ItemStack is,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  Block b=world.getBlock(x,y,z);
  if (b != null && !player.isSneaking()) {
    if (b.rotateBlock(world,x,y,z,ForgeDirection.getOrientation(side))) {
      player.swingItem();
      return !world.isRemote;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onItemUseFirst(ItemStack is,EntityPlayer player,World world,int x,int y,int z,int side,float hitX,float hitY,float hitZ){
  Block b=world.getBlock(x,y,z);
  if (b != null && !player.isSneaking()) {
    ForgeDirection mySide=ForgeDirection.getOrientation(side);
    if (b.rotateBlock(world,x,y,z,mySide)) {
      b.onNeighborBlockChange(world,x,y,z,Platform.air);
      player.swingItem();
      return !world.isRemote;
    }
  }
  return false;
}
Program: 30757
Project: 30757
Buggy source:
@MENetworkEventSubscribe public void updateChannels(MENetworkChannelsChanged chann){
  boolean currentActive=proxy.isActive();
  if (wasActive != currentActive) {
    wasActive=currentActive;
    try {
      proxy.getGrid().postEvent(new MENetworkCellArrayUpdate());
    }
 catch (    GridAccessException e) {
    }
  }
}

Fixed version (ground truth):
@MENetworkEventSubscribe public void updateChannels(MENetworkChannelsChanged chann){
  updateStatus();
}
Program: 30758
Project: 30758
Buggy source:
private void eatFuel(){
  ItemStack is=getStackInSlot(0);
  if (is != null) {
    int newBurnTime=TileEntityFurnace.getItemBurnTime(is);
    if (newBurnTime > 0 && is.stackSize > 0) {
      burnTime+=newBurnTime;
      maxBurnTime=burnTime;
      is.stackSize--;
      if (is.stackSize <= 0)       setInventorySlotContents(0,null);
 else       setInventorySlotContents(0,is);
    }
  }
  if (burnTime > 0) {
    try {
      gridProxy.getTick().wakeDevice(gridProxy.getNode());
    }
 catch (    GridAccessException e) {
    }
  }
  if ((!isOn && burnTime > 0) || (isOn && burnTime <= 0)) {
    isOn=burnTime > 0;
    markForUpdate();
  }
}

Fixed version (ground truth):
private void eatFuel(){
  ItemStack is=getStackInSlot(0);
  if (is != null) {
    int newBurnTime=TileEntityFurnace.getItemBurnTime(is);
    if (newBurnTime > 0 && is.stackSize > 0) {
      burnTime+=newBurnTime;
      maxBurnTime=burnTime;
      is.stackSize--;
      if (is.stackSize <= 0) {
        ItemStack container=null;
        if (is.getItem().hasContainerItem(is))         container=is.getItem().getContainerItem(is);
        setInventorySlotContents(0,container);
      }
 else       setInventorySlotContents(0,is);
    }
  }
  if (burnTime > 0) {
    try {
      gridProxy.getTick().wakeDevice(gridProxy.getNode());
    }
 catch (    GridAccessException e) {
    }
  }
  if ((!isOn && burnTime > 0) || (isOn && burnTime <= 0)) {
    isOn=burnTime > 0;
    markForUpdate();
  }
}