nus-yam/ex-repair huggingface dataset:
Program: 157013
Project: 157013
Buggy source:
public boolean isPoweredTile(TileEntity tile){
  if (tile instanceof IPowerReceptor) {
    IPowerReceptor receptor=(IPowerReceptor)tile;
    IPowerProvider provider=receptor.getPowerProvider();
    return provider != null && provider.getClass().equals(PneumaticPowerProvider.class);
  }
  return false;
}

Fixed version (ground truth):
public boolean isPoweredTile(TileEntity tile){
  if (tile instanceof IPowerReceptor) {
    IPowerReceptor receptor=(IPowerReceptor)tile;
    IPowerProvider provider=receptor.getPowerProvider();
    return provider != null && provider.getClass().getSuperclass().equals(PowerProvider.class);
  }
  return false;
}
Program: 157014
Project: 157014
Buggy source:
@Override public boolean blockActivated(World world,int i,int j,int k,EntityPlayer entityplayer){
  ItemStack current=entityplayer.inventory.getCurrentItem();
  if (current != null) {
    LiquidStack liquid=LiquidManager.getLiquidForFilledItem(current);
    TileTank tank=(TileTank)world.getBlockTileEntity(i,j,k);
    if (liquid != null) {
      int qty=tank.fill(Orientations.Unknown,liquid,true);
      if (qty != 0 && !BuildCraftCore.debugMode) {
        entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,Utils.consumeItem(current));
      }
      return true;
    }
 else {
      LiquidStack available=tank.drain(Orientations.Unknown,BuildCraftAPI.BUCKET_VOLUME,false);
      ItemStack filled=LiquidManager.fillLiquidContainer(available,current);
      liquid=LiquidManager.getLiquidForFilledItem(filled);
      if (liquid != null) {
        if (current.stackSize > 1) {
          if (!entityplayer.inventory.addItemStackToInventory(filled))           return false;
 else           entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,Utils.consumeItem(current));
        }
 else {
          entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,Utils.consumeItem(current));
          entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,filled);
        }
        tank.drain(Orientations.Unknown,liquid.amount,true);
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean blockActivated(World world,int i,int j,int k,EntityPlayer entityplayer){
  ItemStack current=entityplayer.inventory.getCurrentItem();
  if (current != null) {
    LiquidStack liquid=LiquidManager.getLiquidForFilledItem(current);
    TileTank tank=(TileTank)world.getBlockTileEntity(i,j,k);
    if (liquid != null) {
      int qty=tank.fill(Orientations.Unknown,liquid,true);
      if (qty != 0 && !BuildCraftCore.debugMode) {
        entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,Utils.consumeItem(current));
      }
      return true;
    }
 else {
      LiquidStack available=tank.getTanks()[0].getLiquid();
      ItemStack filled=LiquidManager.fillLiquidContainer(available,current);
      liquid=LiquidManager.getLiquidForFilledItem(filled);
      if (liquid != null) {
        if (current.stackSize > 1) {
          if (!entityplayer.inventory.addItemStackToInventory(filled))           return false;
 else           entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,Utils.consumeItem(current));
        }
 else {
          entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,Utils.consumeItem(current));
          entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem,filled);
        }
        tank.drain(Orientations.Unknown,liquid.amount,true);
        return true;
      }
    }
  }
  return false;
}
Program: 157016
Project: 157016
Buggy source:
public Orientations resolveDestination(EntityData data){
  LinkedList<Orientations> listOfPossibleMovements=getPossibleMovements(new Position(xCoord,yCoord,zCoord,data.orientation),data.item);
  if (listOfPossibleMovements.size() == 0)   return Orientations.Unknown;
 else {
    int i;
    if (APIProxy.isClient(worldObj) || APIProxy.isServerSide())     i=Math.abs(data.item.entityId + xCoord + yCoord+ zCoord+ data.item.deterministicRandomization) % listOfPossibleMovements.size();
 else     i=worldObj.rand.nextInt(listOfPossibleMovements.size());
    return listOfPossibleMovements.get(i);
  }
}

Fixed version (ground truth):
public Orientations resolveDestination(EntityData data){
  LinkedList<Orientations> listOfPossibleMovements=getPossibleMovements(new Position(xCoord,yCoord,zCoord,data.orientation),data.item);
  if (listOfPossibleMovements.size() == 0)   return Orientations.Unknown;
 else {
    int i;
    if (APIProxy.isClient(worldObj) || APIProxy.isServerSide()) {
      i=Math.abs(data.item.entityId + xCoord + yCoord+ zCoord+ data.item.deterministicRandomization) % listOfPossibleMovements.size();
      data.item.deterministicRandomization*=11;
    }
 else     i=worldObj.rand.nextInt(listOfPossibleMovements.size());
    return listOfPossibleMovements.get(i);
  }
}
Program: 157017
Project: 157017
Buggy source:
public void drawSprite(int cornerX,int cornerY){
  if (isDefined())   if (getItemStack() != null)   drawStack(getItemStack());
 else   if (getTexture() != null && !getTexture().equals("String_Node_Str")) {
    int texture=mc.renderEngine.getTexture(getTexture());
    mc.renderEngine.bindTexture(texture);
    int textureI=getTextureIndex() >> 4;
    int textureJ=getTextureIndex() - textureI * 16;
    drawTexturedModalRect(cornerX + x,cornerY + y,16 * textureJ,16 * textureI,16,16);
  }
}

Fixed version (ground truth):
public void drawSprite(int cornerX,int cornerY){
  if (!isDefined())   return;
  GL11.glDisable(GL11.GL_LIGHTING);
  if (getItemStack() != null)   drawStack(getItemStack());
 else   if (getTexture() != null && !getTexture().equals("String_Node_Str")) {
    int texture=mc.renderEngine.getTexture(getTexture());
    mc.renderEngine.bindTexture(texture);
    int textureI=getTextureIndex() >> 4;
    int textureJ=getTextureIndex() - textureI * 16;
    drawTexturedModalRect(cornerX + x,cornerY + y,16 * textureJ,16 * textureI,16,16);
  }
  GL11.glEnable(GL11.GL_LIGHTING);
}
Program: 157018
Project: 157018
Buggy source:
public ItemEngine(int i){
  super(i,"String_Node_Str");
}

Fixed version (ground truth):
public ItemEngine(int i){
  super(i,"String_Node_Str");
  setMaxDamage(0);
  setHasSubtypes(true);
}
Program: 157019
Project: 157019
Buggy source:
@Override public void entityEntering(EntityPassiveItem item,Orientations orientation){
  if (item.isCorrupted())   return;
  readjustSpeed(item);
  if (!travelingEntities.containsKey(new Integer(item.entityId))) {
    travelingEntities.put(new Integer(item.entityId),new EntityData(item,orientation));
    if (item.container != null && item.container != this.container)     ((PipeTransportSolids)((TileGenericPipe)item.container).pipe.transport).scheduleRemoval(item);
    item.container=container;
  }
  if (orientation != Orientations.YPos && orientation != Orientations.YNeg)   item.setPosition(item.posX,yCoord + Utils.getPipeFloorOf(item.item),item.posZ);
  if (container.pipe instanceof IPipeTransportItemsHook)   ((IPipeTransportItemsHook)container.pipe).entityEntered(item,orientation);
  if (APIProxy.isServerSide())   if (item.synchroTracker.markTimeIfDelay(worldObj,6 * BuildCraftCore.updateFactor))   CoreProxy.sendToPlayers(createItemPacket(item,orientation),xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
  if (travelingEntities.size() > BuildCraftTransport.groupItemsTrigger) {
    groupEntities();
    if (travelingEntities.size() > BuildCraftTransport.maxItemsInPipes)     worldObj.createExplosion(null,xCoord,yCoord,zCoord,1);
  }
}

Fixed version (ground truth):
@Override public void entityEntering(EntityPassiveItem item,Orientations orientation){
  if (item.isCorrupted())   return;
  readjustSpeed(item);
  if (!travelingEntities.containsKey(new Integer(item.entityId))) {
    travelingEntities.put(new Integer(item.entityId),new EntityData(item,orientation));
    if (item.container != null && item.container != this.container)     ((PipeTransportSolids)((TileGenericPipe)item.container).pipe.transport).scheduleRemoval(item);
    item.container=container;
  }
  if (orientation != Orientations.YPos && orientation != Orientations.YNeg)   item.setPosition(item.posX,yCoord + Utils.getPipeFloorOf(item.item),item.posZ);
  if (container.pipe instanceof IPipeTransportItemsHook)   ((IPipeTransportItemsHook)container.pipe).entityEntered(item,orientation);
  if (APIProxy.isServerSide())   if (item.synchroTracker.markTimeIfDelay(worldObj,6 * BuildCraftCore.updateFactor))   CoreProxy.sendToPlayers(createItemPacket(item,orientation),container.worldObj,xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
  if (travelingEntities.size() > BuildCraftTransport.groupItemsTrigger) {
    groupEntities();
    if (travelingEntities.size() > BuildCraftTransport.maxItemsInPipes)     worldObj.createExplosion(null,xCoord,yCoord,zCoord,1);
  }
}
Program: 157020
Project: 157020
Buggy source:
public static void sendToPlayers(Packet packet,int x,int y,int z,int maxDistance,NetworkMod mod){
}

Fixed version (ground truth):
public static void sendToPlayers(Packet packet,World w,int x,int y,int z,int maxDistance,NetworkMod mod){
}
Program: 157021
Project: 157021
Buggy source:
public static void sendToPlayers(Packet packet,int x,int y,int z,int maxDistance,NetworkMod mod){
  if (packet != null) {
    World[] worlds=DimensionManager.getWorlds();
    for (int i=0; i < worlds.length; i++)     for (int j=0; j < worlds[i].playerEntities.size(); j++) {
      EntityPlayerMP player=(EntityPlayerMP)worlds[i].playerEntities.get(j);
      if (Math.abs(player.posX - x) <= maxDistance && Math.abs(player.posY - y) <= maxDistance && Math.abs(player.posZ - z) <= maxDistance)       player.playerNetServerHandler.sendPacket(packet);
    }
  }
}

Fixed version (ground truth):
public static void sendToPlayers(Packet packet,World w,int x,int y,int z,int maxDistance,NetworkMod mod){
  if (packet != null) {
    for (int j=0; j < w.playerEntities.size(); j++) {
      EntityPlayerMP player=(EntityPlayerMP)w.playerEntities.get(j);
      if (Math.abs(player.posX - x) <= maxDistance && Math.abs(player.posY - y) <= maxDistance && Math.abs(player.posZ - z) <= maxDistance)       player.playerNetServerHandler.sendPacket(packet);
    }
  }
}
Program: 157022
Project: 157022
Buggy source:
public void sendNetworkUpdate(){
  if (this instanceof ISynchronizedTile)   CoreProxy.sendToPlayers(((ISynchronizedTile)this).getUpdatePacket(),xCoord,yCoord,zCoord,50,mod_BuildCraftCore.instance);
}

Fixed version (ground truth):
public void sendNetworkUpdate(){
  if (this instanceof ISynchronizedTile)   CoreProxy.sendToPlayers(((ISynchronizedTile)this).getUpdatePacket(),worldObj,xCoord,yCoord,zCoord,50,mod_BuildCraftCore.instance);
}
Program: 157023
Project: 157023
Buggy source:
public void sendSelectionTo(EntityPlayer player){
  for (  AssemblyRecipe r : BuildCraftCore.assemblyRecipes) {
    SelectionMessage message=new SelectionMessage();
    message.itemID=r.output.itemID;
    message.itemDmg=r.output.getItemDamage();
    if (isPlanned(r)) {
      message.select=true;
    }
 else {
      message.select=false;
    }
    PacketUpdate packet=new PacketUpdate(PacketIds.SELECTION_ASSEMBLY,selectionMessageWrapper.toPayload(xCoord,yCoord,zCoord,message));
    packet.posX=xCoord;
    packet.posY=yCoord;
    packet.posZ=zCoord;
    CoreProxy.sendToPlayers(packet.getPacket(),(int)player.posX,(int)player.posY,(int)player.posZ,100,mod_BuildCraftSilicon.instance);
  }
}

Fixed version (ground truth):
public void sendSelectionTo(EntityPlayer player){
  for (  AssemblyRecipe r : BuildCraftCore.assemblyRecipes) {
    SelectionMessage message=new SelectionMessage();
    message.itemID=r.output.itemID;
    message.itemDmg=r.output.getItemDamage();
    if (isPlanned(r)) {
      message.select=true;
    }
 else {
      message.select=false;
    }
    PacketUpdate packet=new PacketUpdate(PacketIds.SELECTION_ASSEMBLY,selectionMessageWrapper.toPayload(xCoord,yCoord,zCoord,message));
    packet.posX=xCoord;
    packet.posY=yCoord;
    packet.posZ=zCoord;
    CoreProxy.sendToPlayers(packet.getPacket(),worldObj,(int)player.posX,(int)player.posY,(int)player.posZ,100,mod_BuildCraftSilicon.instance);
  }
}
Program: 157024
Project: 157024
Buggy source:
@Override public ItemStack decrStackSize(int i,int j){
  ItemStack stack=items[i].copy();
  stack.stackSize=j;
  items[i].stackSize-=j;
  if (items[i].stackSize == 0)   items[i]=null;
  if (APIProxy.isServerSide())   for (int p=0; p < 6; ++p)   CoreProxy.sendToPlayers(getContentsPacket(p),xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
  return stack;
}

Fixed version (ground truth):
@Override public ItemStack decrStackSize(int i,int j){
  ItemStack stack=items[i].copy();
  stack.stackSize=j;
  items[i].stackSize-=j;
  if (items[i].stackSize == 0)   items[i]=null;
  if (APIProxy.isServerSide())   for (int p=0; p < 6; ++p)   CoreProxy.sendToPlayers(getContentsPacket(p),worldObj,xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
  return stack;
}
Program: 157025
Project: 157025
Buggy source:
@Override public void setInventorySlotContents(int i,ItemStack itemstack){
  if (items[i] == null && itemstack == null)   return;
 else   if (items[i] != null && itemstack != null && items[i].isStackEqual(itemstack))   return;
  if (itemstack != null)   items[i]=itemstack.copy();
 else   items[i]=null;
  if (APIProxy.isServerSide())   for (int p=0; p < 6; ++p)   CoreProxy.sendToPlayers(getContentsPacket(p),xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
}

Fixed version (ground truth):
@Override public void setInventorySlotContents(int i,ItemStack itemstack){
  if (items[i] == null && itemstack == null)   return;
 else   if (items[i] != null && itemstack != null && items[i].isStackEqual(itemstack))   return;
  if (itemstack != null)   items[i]=itemstack.copy();
 else   items[i]=null;
  if (APIProxy.isServerSide())   for (int p=0; p < 6; ++p)   CoreProxy.sendToPlayers(getContentsPacket(p),worldObj,xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
}
Program: 157026
Project: 157026
Buggy source:
@Override public void updateEntity(){
  if (tracker.markTimeIfDelay(worldObj,20 * BuildCraftCore.updateFactor))   if (APIProxy.isServerSide())   for (int p=0; p < 6; ++p)   CoreProxy.sendToPlayers(getContentsPacket(p),xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
}

Fixed version (ground truth):
@Override public void updateEntity(){
  if (tracker.markTimeIfDelay(worldObj,20 * BuildCraftCore.updateFactor))   if (APIProxy.isServerSide())   for (int p=0; p < 6; ++p)   CoreProxy.sendToPlayers(getContentsPacket(p),worldObj,xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
}
Program: 157027
Project: 157027
Buggy source:
@Override public void entityEntering(EntityPassiveItem item,Orientations orientation){
  if (item.isCorrupted())   return;
  readjustSpeed(item);
  if (!travelingEntities.containsKey(new Integer(item.entityId))) {
    travelingEntities.put(new Integer(item.entityId),new EntityData(item,orientation));
    if (item.container != null && item.container != this.container)     ((PipeTransportItems)((TileGenericPipe)item.container).pipe.transport).scheduleRemoval(item);
    item.container=container;
  }
  if (orientation != Orientations.YPos && orientation != Orientations.YNeg)   item.setPosition(item.posX,yCoord + Utils.getPipeFloorOf(item.item),item.posZ);
  if (container.pipe instanceof IPipeTransportItemsHook)   ((IPipeTransportItemsHook)container.pipe).entityEntered(item,orientation);
  if (APIProxy.isServerSide())   if (item.synchroTracker.markTimeIfDelay(worldObj,6 * BuildCraftCore.updateFactor))   CoreProxy.sendToPlayers(createItemPacket(item,orientation),xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
  if (travelingEntities.size() > BuildCraftTransport.groupItemsTrigger) {
    groupEntities();
    if (travelingEntities.size() > BuildCraftTransport.maxItemsInPipes)     worldObj.createExplosion(null,xCoord,yCoord,zCoord,1);
  }
}

Fixed version (ground truth):
@Override public void entityEntering(EntityPassiveItem item,Orientations orientation){
  if (item.isCorrupted())   return;
  readjustSpeed(item);
  if (!travelingEntities.containsKey(new Integer(item.entityId))) {
    travelingEntities.put(new Integer(item.entityId),new EntityData(item,orientation));
    if (item.container != null && item.container != this.container)     ((PipeTransportItems)((TileGenericPipe)item.container).pipe.transport).scheduleRemoval(item);
    item.container=container;
  }
  if (orientation != Orientations.YPos && orientation != Orientations.YNeg)   item.setPosition(item.posX,yCoord + Utils.getPipeFloorOf(item.item),item.posZ);
  if (container.pipe instanceof IPipeTransportItemsHook)   ((IPipeTransportItemsHook)container.pipe).entityEntered(item,orientation);
  if (APIProxy.isServerSide())   if (item.synchroTracker.markTimeIfDelay(worldObj,6 * BuildCraftCore.updateFactor))   CoreProxy.sendToPlayers(createItemPacket(item,orientation),worldObj,xCoord,yCoord,zCoord,50,mod_BuildCraftTransport.instance);
  if (travelingEntities.size() > BuildCraftTransport.groupItemsTrigger) {
    groupEntities();
    if (travelingEntities.size() > BuildCraftTransport.maxItemsInPipes)     worldObj.createExplosion(null,xCoord,yCoord,zCoord,1);
  }
}
Program: 157029
Project: 157029
Buggy source:
public void synchronizeIfDelay(int delay){
  if (APIProxy.isServerSide())   if (networkSyncTracker.markTimeIfDelay(worldObj,delay))   CoreProxy.sendToPlayers(getUpdatePacket(),xCoord,yCoord,zCoord,40,mod_BuildCraftCore.instance);
}

Fixed version (ground truth):
public void synchronizeIfDelay(int delay){
  if (APIProxy.isServerSide())   if (networkSyncTracker.markTimeIfDelay(worldObj,delay))   CoreProxy.sendToPlayers(getUpdatePacket(),worldObj,xCoord,yCoord,zCoord,40,mod_BuildCraftCore.instance);
}
Program: 157031
Project: 157031
Buggy source:
private void closeOpenAlerts(OpsGenieClient client,String apiKey,Check check) throws OpsGenieClientException, ParseException, IOException {
}

Fixed version (ground truth):
private void closeOpenAlerts(OpsGenieClient client,String apiKey,Check check) throws OpsGenieClientException, ParseException, IOException {
  List<com.ifountain.opsgenie.client.model.beans.Alert> opsAlerts=getOpenAlerts(client,apiKey,check);
  for (  com.ifountain.opsgenie.client.model.beans.Alert alert : opsAlerts) {
    closeAlert(alert,client,apiKey,check);
  }
}
Program: 157032
Project: 157032
Buggy source:
private void sendMessage(String ircCatHost,int ircCatPort,String message,String channel) throws IOException {
  Socket socket=new Socket(ircCatHost,ircCatPort);
  Closer closer=Closer.create();
  try {
    Writer out=closer.register(new OutputStreamWriter(socket.getOutputStream()));
    out.write(format("String_Node_Str",channel,message));
    out.flush();
  }
 catch (  IOException e) {
    socket.close();
    throw closer.rethrow(e);
  }
 finally {
    closer.close();
  }
}

Fixed version (ground truth):
private void sendMessage(String ircCatHost,int ircCatPort,String message,String channel) throws IOException {
  Socket socket=new Socket(ircCatHost,ircCatPort);
  Closer closer=Closer.create();
  try {
    Writer out=closer.register(new OutputStreamWriter(socket.getOutputStream(),Charset.forName("String_Node_Str")));
    out.write(format("String_Node_Str",channel,message));
    out.flush();
  }
 catch (  IOException e) {
    socket.close();
    throw closer.rethrow(e);
  }
 finally {
    closer.close();
  }
}
Program: 157033
Project: 157033
Buggy source:
public static MessageType fromAlertType(AlertType alert){
switch (alert) {
case OK:
    return RECOVERY;
case WARN:
case UNKNOWN:
  return WARNING;
case ERROR:
case EXCEPTION:
return CRITICAL;
}
return INFO;
}

Fixed version (ground truth):
public static MessageType fromAlertType(AlertType alert){
switch (alert) {
case OK:
    return RECOVERY;
case WARN:
case UNKNOWN:
  return WARNING;
case ERROR:
case EXCEPTION:
return CRITICAL;
default :
return INFO;
}
}
Program: 157034
Project: 157034
Buggy source:
public static String create(String target){
  if (target == null) {
    return null;
  }
  return new String(DigestUtils.md5(target));
}

Fixed version (ground truth):
public static String create(String target){
  if (target == null) {
    return null;
  }
  return new String(DigestUtils.md5(target),Charset.forName("String_Node_Str"));
}
Program: 157035
Project: 157035
Buggy source:
@Inject public MongoStore(SeyrenConfig seyrenConfig){
  try {
    String uri=seyrenConfig.getMongoUrl();
    MongoClientURI mongoClientUri=new MongoClientURI(uri);
    MongoClient mongoClient=new MongoClient(mongoClientUri);
    DB mongo=mongoClient.getDB(mongoClientUri.getDatabase());
    mongo.setWriteConcern(WriteConcern.ACKNOWLEDGED);
    this.mongo=mongo;
    bootstrapMongo();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Inject public MongoStore(SeyrenConfig seyrenConfig){
  try {
    String uri=seyrenConfig.getMongoUrl();
    MongoClientURI mongoClientUri=new MongoClientURI(uri);
    MongoClient mongoClient=new MongoClient(mongoClientUri);
    DB mongoDB=mongoClient.getDB(mongoClientUri.getDatabase());
    mongoDB.setWriteConcern(WriteConcern.ACKNOWLEDGED);
    this.mongo=mongoDB;
    bootstrapMongo();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}
Program: 157036
Project: 157036
Buggy source:
@Override public Check saveCheck(Check check){
  DBObject findObject=forId(check.getId());
  DBObject updateObject=object("String_Node_Str",check.getName()).with("String_Node_Str",check.getDescription()).with("String_Node_Str",check.getTarget()).with("String_Node_Str",check.getWarn().toPlainString()).with("String_Node_Str",check.getError().toPlainString()).with("String_Node_Str",check.isEnabled()).with("String_Node_Str",new Date(check.getLastCheck().getMillis())).with("String_Node_Str",check.getState().toString());
  DBObject setObject=object("String_Node_Str",updateObject);
  getChecksCollection().update(findObject,setObject);
  return check;
}

Fixed version (ground truth):
@Override public Check saveCheck(Check check){
  DBObject findObject=forId(check.getId());
  DateTime lastCheck=check.getLastCheck();
  DBObject updateObject=object("String_Node_Str",check.getName()).with("String_Node_Str",check.getDescription()).with("String_Node_Str",check.getTarget()).with("String_Node_Str",check.getWarn().toPlainString()).with("String_Node_Str",check.getError().toPlainString()).with("String_Node_Str",check.isEnabled()).with("String_Node_Str",lastCheck == null ? null : new Date(lastCheck.getMillis())).with("String_Node_Str",check.getState().toString());
  DBObject setObject=object("String_Node_Str",updateObject);
  getChecksCollection().update(findObject,setObject);
  return check;
}
Program: 157038
Project: 157038
Buggy source:
@Scheduled(fixedRate=10000) public void performChecks(){
  List<Check> checks=checksStore.getChecks();
  for (  Check check : checks) {
    if (check.isEnabled()) {
      try {
        Alert alert=checker.check(check);
        if (alert != null) {
          alertsStore.createAlert(check.getId(),alert);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
@Scheduled(fixedRate=10000) public void performChecks(){
  List<Check> checks=checksStore.getChecks();
  for (  Check check : checks) {
    if (check.isEnabled()) {
      try {
        Alert alert=checker.check(check);
        if (alert != null) {
          alertsStore.createAlert(check.getId(),alert);
          check.setState(alert.getToType());
          checksStore.saveCheck(check);
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 157039
Project: 157039
Buggy source:
@Override public Check saveCheck(Check check){
  DBObject dbo=basicDBObjectById(check.getId());
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getName()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getTarget()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getWarn()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getError()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.isEnabled()));
  return check;
}

Fixed version (ground truth):
@Override public Check saveCheck(Check check){
  DBObject dbo=basicDBObjectById(check.getId());
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getName()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getTarget()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getWarn()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getError()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.isEnabled()));
  getChecksCollection().update(dbo,basicDBObjectWithSet("String_Node_Str",check.getState().toString()));
  return check;
}
Program: 157040
Project: 157040
Buggy source:
public static boolean canBeWrapped(Object object){
  if (object instanceof WrappedStack) {
    return true;
  }
 else   if (object instanceof Item || object instanceof Block) {
    return true;
  }
 else   if (object instanceof ItemStack && ((ItemStack)object).getItem() != null) {
    return true;
  }
 else   if (object instanceof OreStack) {
    return true;
  }
 else   if (object instanceof List && OreStack.getOreStackFrom((List<?>)object) != null) {
    return true;
  }
 else   if (object instanceof Fluid || object instanceof FluidStack) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean canBeWrapped(Object object){
  if (object instanceof WrappedStack) {
    return true;
  }
 else   if (object instanceof Item || object instanceof Block) {
    return true;
  }
 else   if (object instanceof ItemStack && ((ItemStack)object).getItem() != null && !((ItemStack)object).isEmpty()) {
    return true;
  }
 else   if (object instanceof OreStack) {
    return true;
  }
 else   if (object instanceof List && OreStack.getOreStackFrom((List<?>)object) != null) {
    return true;
  }
 else   if (object instanceof Fluid || object instanceof FluidStack) {
    return true;
  }
  return false;
}
Program: 157042
Project: 157042
Buggy source:
@Override public void onPostInit(FMLPostInitializationEvent event){
  FluidHelper.initMilk();
  Abilities.init();
  new VanillaTestSuite().build().save();
  new EETestSuite().build().save();
}

Fixed version (ground truth):
@Override public void onPostInit(FMLPostInitializationEvent event){
  FluidHelper.init();
  Abilities.init();
  new VanillaTestSuite().build().save();
  new EETestSuite().build().save();
}
Program: 157044
Project: 157044
Buggy source:
/** 
 * An awkward fix for the case where milk may not be registered as a liquid but we want to assign an energy value to milk (the liquid). TLDR we substitute a dummy liquid and assign value/recipes to it
 */
public static void initMilk(){
  if (!FluidRegistry.isFluidRegistered("String_Node_Str")) {
    if (FluidRegistry.registerFluid(new Fluid("String_Node_Str",ResourceLocationHelper.getResourceLocation("String_Node_Str"),ResourceLocationHelper.getResourceLocation("String_Node_Str")))) {
      RecipeRegistryProxy.addRecipe(Items.MILK_BUCKET,Items.BUCKET,new FluidStack(FluidRegistry.getFluid("String_Node_Str"),Fluid.BUCKET_VOLUME));
      EnergyValueRegistryProxy.setEnergyValue(FluidRegistry.getFluid("String_Node_Str"),0.064,EnergyValueRegistryProxy.Phase.PRE_CALCULATION);
    }
  }
 else {
    RecipeRegistryProxy.addRecipe(Items.MILK_BUCKET,Items.BUCKET,new FluidStack(FluidRegistry.getFluid("String_Node_Str"),Fluid.BUCKET_VOLUME));
    EnergyValueRegistryProxy.setEnergyValue(FluidRegistry.getFluid("String_Node_Str"),0.064,EnergyValueRegistryProxy.Phase.PRE_CALCULATION);
  }
}

Fixed version (ground truth):
/** 
 * An awkward fix for the case where milk may not be registered as a liquid but we want to assign an energy value to milk (the liquid). <p>TL-DR; we substitute a dummy liquid and assign value/recipes to it
 */
private static void initMilk(){
  if (!FluidRegistry.isFluidRegistered("String_Node_Str")) {
    if (FluidRegistry.registerFluid(new Fluid("String_Node_Str",ResourceLocationHelper.getResourceLocation("String_Node_Str"),ResourceLocationHelper.getResourceLocation("String_Node_Str")))) {
      RecipeRegistryProxy.addRecipe(Items.MILK_BUCKET,Items.BUCKET,new FluidStack(FluidRegistry.getFluid("String_Node_Str"),Fluid.BUCKET_VOLUME));
      EnergyValueRegistryProxy.setEnergyValue(FluidRegistry.getFluid("String_Node_Str"),0.064,EnergyValueRegistryProxy.Phase.PRE_CALCULATION);
    }
  }
 else {
    RecipeRegistryProxy.addRecipe(Items.MILK_BUCKET,Items.BUCKET,new FluidStack(FluidRegistry.getFluid("String_Node_Str"),Fluid.BUCKET_VOLUME));
    EnergyValueRegistryProxy.setEnergyValue(FluidRegistry.getFluid("String_Node_Str"),0.064,EnergyValueRegistryProxy.Phase.PRE_CALCULATION);
  }
}
Program: 157047
Project: 157047
Buggy source:
@Override public int compare(WrappedStack wrappedStack1,WrappedStack wrappedStack2){
  if (wrappedStack1.wrappedStack instanceof ItemStack) {
    if (wrappedStack2.wrappedStack instanceof ItemStack) {
      return ItemHelper.compare((ItemStack)wrappedStack1.wrappedStack,(ItemStack)wrappedStack2.wrappedStack);
    }
 else {
      return 1;
    }
  }
 else   if (wrappedStack1.wrappedStack instanceof OreStack) {
    if (wrappedStack2.wrappedStack instanceof ItemStack) {
      return -1;
    }
 else     if (wrappedStack2.wrappedStack instanceof OreStack) {
      return OreStack.compare((OreStack)wrappedStack1.wrappedStack,(OreStack)wrappedStack2.wrappedStack);
    }
 else {
      return 1;
    }
  }
 else   if (wrappedStack1.wrappedStack instanceof FluidStack) {
    if (wrappedStack2.wrappedStack instanceof ItemStack || wrappedStack2.wrappedStack instanceof OreStack) {
      return -1;
    }
 else     if (wrappedStack2.wrappedStack instanceof FluidStack) {
      return FluidHelper.compare((FluidStack)wrappedStack1.wrappedStack,(FluidStack)wrappedStack2.wrappedStack);
    }
 else {
      return 1;
    }
  }
 else   if (wrappedStack1.wrappedStack == null) {
    if (wrappedStack2.wrappedStack != null) {
      return -1;
    }
 else {
      return 0;
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compare(WrappedStack wrappedStack1,WrappedStack wrappedStack2){
  if (wrappedStack1.wrappedStack instanceof ItemStack) {
    if (wrappedStack2.wrappedStack instanceof ItemStack) {
      int compareResult=ItemHelper.compare((ItemStack)wrappedStack1.wrappedStack,(ItemStack)wrappedStack2.wrappedStack);
      if (compareResult == 0) {
        return wrappedStack1.stackSize - wrappedStack2.stackSize;
      }
 else {
        return compareResult;
      }
    }
 else {
      return 1;
    }
  }
 else   if (wrappedStack1.wrappedStack instanceof OreStack) {
    if (wrappedStack2.wrappedStack instanceof ItemStack) {
      return -1;
    }
 else     if (wrappedStack2.wrappedStack instanceof OreStack) {
      int compareResult=OreStack.compare((OreStack)wrappedStack1.wrappedStack,(OreStack)wrappedStack2.wrappedStack);
      if (compareResult == 0) {
        return wrappedStack1.stackSize - wrappedStack2.stackSize;
      }
 else {
        return compareResult;
      }
    }
 else {
      return 1;
    }
  }
 else   if (wrappedStack1.wrappedStack instanceof FluidStack) {
    if (wrappedStack2.wrappedStack instanceof ItemStack || wrappedStack2.wrappedStack instanceof OreStack) {
      return -1;
    }
 else     if (wrappedStack2.wrappedStack instanceof FluidStack) {
      int compareResult=FluidHelper.compare((FluidStack)wrappedStack1.wrappedStack,(FluidStack)wrappedStack2.wrappedStack);
      if (compareResult == 0) {
        return wrappedStack1.stackSize - wrappedStack2.stackSize;
      }
 else {
        return compareResult;
      }
    }
 else {
      return 1;
    }
  }
 else   if (wrappedStack1.wrappedStack == null) {
    if (wrappedStack2.wrappedStack != null) {
      return -1;
    }
 else {
      return 0;
    }
  }
  return 0;
}
Program: 157048
Project: 157048
Buggy source:
/** 
 * TODO Finish JavaDoc
 * @param object
 * @param blacklist
 */
public void removeFromBlacklist(Object object,Blacklist blacklist){
  if (WrappedStack.canBeWrapped(object)) {
    WrappedStack wrappedStack=WrappedStack.wrap(object,1);
    if (blacklist == Blacklist.KNOWLEDGE) {
      if (wrappedStack != null && !MinecraftForge.EVENT_BUS.post(new KnowledgeWhitelistEvent(object))) {
        LogHelper.trace(KNOWLEDGE_WHITELIST_MARKER,"String_Node_Str",LoaderHelper.getLoaderState(),Loader.instance().activeModContainer().getModId(),wrappedStack);
        knowledgeBlacklist.remove(wrappedStack);
      }
    }
 else     if (blacklist == Blacklist.EXCHANGE) {
      if (wrappedStack != null && !MinecraftForge.EVENT_BUS.post(new ExchangeWhitelistEvent(object))) {
        LogHelper.trace(EXCHANGE_WHITELIST_MARKER,"String_Node_Str",LoaderHelper.getLoaderState(),Loader.instance().activeModContainer().getModId(),wrappedStack);
        exchangeBlacklist.remove(wrappedStack);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * TODO Finish JavaDoc
 * @param object
 * @param blacklist
 */
public void removeFromBlacklist(Object object,Blacklist blacklist){
  if (WrappedStack.canBeWrapped(object)) {
    WrappedStack wrappedStack=WrappedStack.wrap(object,1);
    if (blacklist == Blacklist.KNOWLEDGE) {
      if (wrappedStack != null && !MinecraftForge.EVENT_BUS.post(new KnowledgeWhitelistEvent(object))) {
        LogHelper.trace(KNOWLEDGE_WHITELIST_MARKER,"String_Node_Str",LoaderHelper.getLoaderState(),Loader.instance().activeModContainer().getModId(),wrappedStack);
        knowledgeBlacklist.remove(wrappedStack);
        save(blacklist);
      }
    }
 else     if (blacklist == Blacklist.EXCHANGE) {
      if (wrappedStack != null && !MinecraftForge.EVENT_BUS.post(new ExchangeWhitelistEvent(object))) {
        LogHelper.trace(EXCHANGE_WHITELIST_MARKER,"String_Node_Str",LoaderHelper.getLoaderState(),Loader.instance().activeModContainer().getModId(),wrappedStack);
        exchangeBlacklist.remove(wrappedStack);
        save(blacklist);
      }
    }
  }
}
Program: 157052
Project: 157052
Buggy source:
/** 
 * @param valueMap
 */
public void load(Map<WrappedStack,EnergyValue> valueMap){
  if (valueMap != null) {
    setShouldSave(false);
    ImmutableSortedMap.Builder<WrappedStack,EnergyValue> stackMappingsBuilder=ImmutableSortedMap.naturalOrder();
    stackMappingsBuilder.putAll(valueMap);
    stackValueMap=stackMappingsBuilder.build();
    calculateValueStackMap();
  }
}

Fixed version (ground truth):
/** 
 * @param valueMap
 */
public void load(Map<WrappedStack,EnergyValue> valueMap){
  if (valueMap != null) {
    setShouldSave(false);
    ImmutableSortedMap.Builder<WrappedStack,EnergyValue> stackMappingsBuilder=ImmutableSortedMap.naturalOrder();
    valueMap.keySet().stream().filter(wrappedStack -> wrappedStack != null && wrappedStack.getWrappedObject() != null && valueMap.get(wrappedStack) != null).forEach(wrappedStack -> stackMappingsBuilder.put(wrappedStack,valueMap.get(wrappedStack)));
    stackValueMap=stackMappingsBuilder.build();
    calculateValueStackMap();
  }
}
Program: 157054
Project: 157054
Buggy source:
@Override public JsonElement serialize(JsonFluidStack src,Type typeOfSrc,JsonSerializationContext context){
  JsonObject jsonObject=new JsonObject();
  jsonObject.addProperty("String_Node_Str",src.fluidID);
  jsonObject.addProperty("String_Node_Str",src.amount);
  if (src.tag != null) {
    jsonObject.addProperty("String_Node_Str",src.tag.toString());
  }
  return jsonObject;
}

Fixed version (ground truth):
@Override public JsonElement serialize(JsonFluidStack src,Type typeOfSrc,JsonSerializationContext context){
  JsonObject jsonObject=new JsonObject();
  jsonObject.addProperty("String_Node_Str",src.fluid.getName());
  jsonObject.addProperty("String_Node_Str",src.amount);
  if (src.tag != null) {
    jsonObject.addProperty("String_Node_Str",src.tag.toString());
  }
  return jsonObject;
}
Program: 157055
Project: 157055
Buggy source:
@Override public String toString(){
  return String.format("String_Node_Str",fluidID,amount,tag);
}

Fixed version (ground truth):
@Override public String toString(){
  return String.format("String_Node_Str",fluid,amount,tag);
}
Program: 157056
Project: 157056
Buggy source:
public JsonFluidStack(int fluidID,int amount,NBTTagCompound tag){
  this.fluidID=fluidID;
  this.amount=amount;
  this.tag=tag;
}

Fixed version (ground truth):
public JsonFluidStack(FluidStack fluidStack){
  this.fluid=fluidStack.getFluid();
  this.amount=fluidStack.amount;
  this.tag=fluidStack.tag;
}
Program: 157057
Project: 157057
Buggy source:
@Override public JsonFluidStack deserialize(JsonElement json,Type typeOfT,JsonDeserializationContext context) throws JsonParseException {
  if (json.isJsonObject()) {
    JsonObject jsonObject=(JsonObject)json;
    JsonFluidStack jsonFluidStack=new JsonFluidStack();
    if (jsonObject.has("String_Node_Str")) {
      jsonFluidStack.fluidID=jsonObject.get("String_Node_Str").getAsInt();
    }
 else {
      throw new JsonParseException("String_Node_Str");
    }
    if (jsonObject.has("String_Node_Str")) {
      jsonFluidStack.amount=jsonObject.get("String_Node_Str").getAsInt();
    }
 else {
      throw new JsonParseException("String_Node_Str");
    }
    if (jsonObject.has("String_Node_Str")) {
      try {
        NBTBase nbtBase=JsonToNBT.func_150315_a(jsonObject.get("String_Node_Str").getAsString());
        if (nbtBase instanceof NBTTagCompound) {
          jsonFluidStack.tag=(NBTTagCompound)nbtBase;
        }
      }
 catch (      NBTException e) {
        throw new JsonParseException(e.getMessage(),e.getCause());
      }
    }
    return jsonFluidStack;
  }
  return null;
}

Fixed version (ground truth):
@Override public JsonFluidStack deserialize(JsonElement json,Type typeOfT,JsonDeserializationContext context) throws JsonParseException {
  if (json.isJsonObject()) {
    JsonObject jsonObject=(JsonObject)json;
    JsonFluidStack jsonFluidStack=new JsonFluidStack();
    if (jsonObject.has("String_Node_Str")) {
      jsonFluidStack.fluid=FluidRegistry.getFluid(jsonObject.get("String_Node_Str").getAsString());
    }
 else {
      throw new JsonParseException("String_Node_Str");
    }
    if (jsonObject.has("String_Node_Str")) {
      jsonFluidStack.amount=jsonObject.get("String_Node_Str").getAsInt();
    }
 else {
      throw new JsonParseException("String_Node_Str");
    }
    if (jsonObject.has("String_Node_Str")) {
      try {
        NBTBase nbtBase=JsonToNBT.func_150315_a(jsonObject.get("String_Node_Str").getAsString());
        if (nbtBase instanceof NBTTagCompound) {
          jsonFluidStack.tag=(NBTTagCompound)nbtBase;
        }
      }
 catch (      NBTException e) {
        throw new JsonParseException(e.getMessage(),e.getCause());
      }
    }
    return jsonFluidStack;
  }
  return null;
}
Program: 157059
Project: 157059
Buggy source:
@Override public int getInventoryStackLimit(){
  return 64;
}

Fixed version (ground truth):
@Override public int getInventoryStackLimit(){
  return 1;
}
Program: 157060
Project: 157060
Buggy source:
public static void registerFluids(){
  if (!FluidRegistry.isFluidRegistered("String_Node_Str")) {
    Fluid milk=new Fluid("String_Node_Str").setUnlocalizedName(Names.Fluids.MILK);
    FluidRegistry.registerFluid(milk);
    FluidContainerRegistry.registerFluidContainer(new FluidStack(milk,1000),new ItemStack(Items.milk_bucket),new ItemStack(Items.bucket));
  }
}

Fixed version (ground truth):
public static void registerFluids(){
  if (!FluidRegistry.isFluidRegistered("String_Node_Str")) {
    Fluid milk=new Fluid("String_Node_Str").setUnlocalizedName(Names.Fluids.MILK);
    if (FluidRegistry.registerFluid(milk)) {
      FluidContainerRegistry.registerFluidContainer(new FluidStack(milk,1000),new ItemStack(Items.milk_bucket),new ItemStack(Items.bucket));
    }
  }
}
Program: 157061
Project: 157061
Buggy source:
public void savePlayerKnowledgeToDisk(UUID playerUUID){
  if (playerUUID != null && playerKnowledgeDirectory != null) {
    if (playerKnowledgeMap.containsKey(playerUUID) && playerKnowledgeMap.get(playerUUID) != null) {
      if (playerKnowledgeMap.get(playerUUID).hasBeenModified()) {
        SerializationHelper.writeTransmutationKnowledgeToFile(playerKnowledgeDirectory,playerUUID.toString() + "String_Node_Str",playerKnowledgeMap.get(playerUUID));
      }
    }
 else {
      loadPlayerFromDiskIfNeeded(playerUUID);
      SerializationHelper.writeTransmutationKnowledgeToFile(playerKnowledgeDirectory,playerUUID.toString() + "String_Node_Str",new TransmutationKnowledge());
    }
  }
}

Fixed version (ground truth):
public void savePlayerKnowledgeToDisk(UUID playerUUID){
  if (playerUUID != null && playerKnowledgeDirectory != null) {
    if (playerKnowledgeMap.containsKey(playerUUID) && playerKnowledgeMap.get(playerUUID) != null) {
      if (playerKnowledgeMap.get(playerUUID).hasBeenModified()) {
        SerializationHelper.writeTransmutationKnowledgeToFile(playerKnowledgeDirectory,playerUUID.toString() + "String_Node_Str",playerKnowledgeMap.get(playerUUID));
      }
    }
 else {
      loadPlayerFromDiskIfNeeded(playerUUID);
      SerializationHelper.writeTransmutationKnowledgeToFile(playerKnowledgeDirectory,playerUUID.toString() + "String_Node_Str",playerKnowledgeMap.get(playerUUID));
    }
  }
}
Program: 157062
Project: 157062
Buggy source:
public List<String> getOreNamesForItemStack(ItemStack itemStack){
  List<String> oreNameList=new ArrayList<String>();
  WrappedStack wrappedStack=new WrappedStack(itemStack);
  if (itemStackToOreNameMap.containsKey(wrappedStack)) {
    for (    String oreName : itemStackToOreNameMap.get(wrappedStack)) {
      oreNameList.add(oreName);
    }
  }
  return oreNameList;
}

Fixed version (ground truth):
public List<String> getOreNamesForItemStack(ItemStack itemStack){
  List<String> oreNameList=new ArrayList<String>();
  WrappedStack wrappedStack=new WrappedStack(itemStack);
  if (itemStackToOreNameMap.containsKey(wrappedStack)) {
    for (    String oreName : itemStackToOreNameMap.get(wrappedStack)) {
      oreNameList.add(oreName);
    }
  }
 else {
    for (    WrappedStack wrappedStack1 : itemStackToOreNameMap.keySet()) {
    }
  }
  return oreNameList;
}
Program: 157064
Project: 157064
Buggy source:
public void dumpEnergyValueRegistryToLog(EnergyValueRegistryProxy.Phase phase){
  LogHelper.info(String.format("String_Node_Str",phase));
  if (phase == EnergyValueRegistryProxy.Phase.PRE_ASSIGNMENT) {
    for (    WrappedStack wrappedStack : this.preAssignedMappings.keySet()) {
      LogHelper.info(String.format("String_Node_Str",wrappedStack,EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
    }
  }
 else   if (phase == EnergyValueRegistryProxy.Phase.POST_ASSIGNMENT) {
    LogHelper.info("String_Node_Str");
    if (this.postAssignedDependentMappings != null) {
      for (      WrappedStack wrappedStack : this.postAssignedDependentMappings.keySet()) {
        LogHelper.info(String.format("String_Node_Str",wrappedStack,EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
      }
    }
    LogHelper.info("String_Node_Str");
    if (this.postAssignedExactMappings != null) {
      for (      WrappedStack wrappedStack : this.postAssignedExactMappings.keySet()) {
        LogHelper.info(String.format("String_Node_Str",wrappedStack,EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
      }
    }
  }
 else   if (phase == EnergyValueRegistryProxy.Phase.ALL) {
    for (    WrappedStack wrappedStack : EnergyValueRegistry.getInstance().getStackValueMap().keySet()) {
      LogHelper.info(String.format("String_Node_Str",wrappedStack,EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
    }
  }
  LogHelper.info(String.format("String_Node_Str",phase));
}

Fixed version (ground truth):
public void dumpEnergyValueRegistryToLog(EnergyValueRegistryProxy.Phase phase){
  LogHelper.info(String.format("String_Node_Str",phase));
  if (phase == EnergyValueRegistryProxy.Phase.PRE_ASSIGNMENT) {
    for (    WrappedStack wrappedStack : this.preAssignedMappings.keySet()) {
      LogHelper.info(String.format("String_Node_Str",wrappedStack,EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
    }
  }
 else   if (phase == EnergyValueRegistryProxy.Phase.POST_ASSIGNMENT) {
    if (this.postAssignedMappings != null) {
      for (      WrappedStack wrappedStack : this.postAssignedMappings.keySet()) {
        LogHelper.info(String.format("String_Node_Str",wrappedStack,EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
      }
    }
  }
 else   if (phase == EnergyValueRegistryProxy.Phase.ALL) {
    for (    WrappedStack wrappedStack : EnergyValueRegistry.getInstance().getStackValueMap().keySet()) {
      LogHelper.info(String.format("String_Node_Str",wrappedStack,EnergyValueRegistry.getInstance().getStackValueMap().get(wrappedStack)));
    }
  }
  LogHelper.info(String.format("String_Node_Str",phase));
}
Program: 157065
Project: 157065
Buggy source:
public void addPostAssignedExactEnergyValue(Object object,EnergyValue energyValue){
  if (postAssignedExactMappings == null) {
    postAssignedExactMappings=new TreeMap<WrappedStack,EnergyValue>();
  }
  if (WrappedStack.canBeWrapped(object) && energyValue != null && Float.compare(energyValue.getEnergyValue(),0f) > 0) {
    WrappedStack wrappedStack=new WrappedStack(object);
    if (wrappedStack.getStackSize() > 0) {
      WrappedStack factoredWrappedStack=new WrappedStack(wrappedStack,1);
      EnergyValue factoredEnergyValue=EnergyValueHelper.factorEnergyValue(energyValue,wrappedStack.getStackSize());
      postAssignedExactMappings.put(factoredWrappedStack,factoredEnergyValue);
    }
  }
}

Fixed version (ground truth):
public void addPostAssignedExactEnergyValue(Object object,EnergyValue energyValue){
  if (postAssignedMappings == null) {
    postAssignedMappings=new TreeMap<WrappedStack,EnergyValue>();
  }
  if (WrappedStack.canBeWrapped(object) && energyValue != null && Float.compare(energyValue.getEnergyValue(),0f) > 0) {
    WrappedStack wrappedStack=new WrappedStack(object);
    if (wrappedStack.getStackSize() > 0) {
      WrappedStack factoredWrappedStack=new WrappedStack(wrappedStack,1);
      EnergyValue factoredEnergyValue=EnergyValueHelper.factorEnergyValue(energyValue,wrappedStack.getStackSize());
      postAssignedMappings.put(factoredWrappedStack,factoredEnergyValue);
    }
  }
}
Program: 157067
Project: 157067
Buggy source:
public OreStack(ItemStack itemStack){
  if (itemStack != null && OreDictionary.getOreIDs(itemStack).length > 0) {
    this.oreName=OreDictionary.getOreName(OreDictionary.getOreIDs(itemStack)[0]);
    this.stackSize=itemStack.stackSize;
  }
}

Fixed version (ground truth):
public OreStack(String oreName,int stackSize){
  this.oreName=oreName;
  this.stackSize=stackSize;
}
Program: 157069
Project: 157069
Buggy source:
public RecipeAludel(ItemStack recipeOutput,OreStack inputStack,ItemStack dustStack){
  this.recipeOutput=recipeOutput.copy();
  this.inputStack=new WrappedStack(inputStack);
  this.dustStack=dustStack.copy();
}

Fixed version (ground truth):
public RecipeAludel(ItemStack recipeOutput,ItemStack inputStack,ItemStack dustStack){
  this.recipeOutput=recipeOutput.copy();
  this.inputStack=new WrappedStack(inputStack);
  this.dustStack=dustStack.copy();
}