nus-yam/ex-repair huggingface dataset:
Program: 34551
Project: 34551
Buggy source:
public static final void sendIMCs(){
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void sendIMCs(){
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
  FMLInterModComms.sendMessage("String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 34552
Project: 34552
Buggy source:
public static final void integrateMods(){
  Stopwatch.time("String_Node_Str");
  Class[] handlerClasses=new Class[]{ThaumcraftIntegration.class,MineFactoryReloadedIntegration.class,ArsMagicaFixIntegration.class};
  for (  Class<? extends IIntegrationHandler> cls : handlerClasses) {
    try {
      IIntegrationHandler handler=cls.newInstance();
      String modId=handler.getModId();
      if (Loader.isModLoaded(modId) && !blacklistedMods.contains(modId))       handler.integrate();
    }
 catch (    Throwable e) {
      Log.throwable(e,"String_Node_Str",cls.getSimpleName());
    }
  }
  Stopwatch.finish("String_Node_Str");
}

Fixed version (ground truth):
public static void integrateMods(){
  Stopwatch.time("String_Node_Str");
  Class[] handlerClasses=new Class[]{ThaumcraftIntegration.class,MineFactoryReloadedIntegration.class,ArsMagicaFixIntegration.class};
  for (  Class<? extends IIntegrationHandler> cls : handlerClasses) {
    try {
      IIntegrationHandler handler=cls.newInstance();
      String modId=handler.getModId();
      if (Loader.isModLoaded(modId) && !blacklistedMods.contains(modId))       handler.integrate();
    }
 catch (    Throwable e) {
      Log.throwable(e,"String_Node_Str",cls.getSimpleName());
    }
  }
  Stopwatch.finish("String_Node_Str");
}
Program: 34553
Project: 34553
Buggy source:
/** 
 * Enhances a new ItemStack returned by the tile entity and returns it.
 */
public static <T extends Enum<T>>ItemStack createItemStack(IEnhanceableTile<T> tile){
  ItemStack is=tile.getEnhancementItemStack();
  EnhancementRegistry.<T>getEnhancementList(is).replace(tile.getEnhancements());
  return is;
}

Fixed version (ground truth):
/** 
 * Enhances a new ItemStack returned by the tile entity and returns it.
 */
static <T extends Enum<T>>ItemStack createItemStack(IEnhanceableTile<T> tile){
  ItemStack is=tile.getEnhancementItemStack();
  EnhancementRegistry.<T>getEnhancementList(is).replace(tile.getEnhancements());
  return is;
}
Program: 34554
Project: 34554
Buggy source:
public int getWeight();

Fixed version (ground truth):
int getWeight();
Program: 34555
Project: 34555
Buggy source:
@UnitTest(runTime=RunTime.INGAME,trigger=testTrigger) public void testDecompositionTable(){
  int[] stardust=new int[]{59,59,63,61,57,57,64};
  final List<PosMutable> decomposition=storedLocs.get("String_Node_Str");
  for (int a=0; a < stardust.length; a++) {
    pos.set(decomposition.get(a));
    Assert.equal(getTile(TileEntityDecompositionTable.class).getStackInSlot(1).stackSize,stardust[a],"String_Node_Str");
  }
  Function<Integer,TileEntityChest> get=new Function<Integer,TileEntityChest>(){
    @Override public TileEntityChest apply(    Integer input){
      return (TileEntityChest)pos.set(decomposition.get(input)).move(0,-2,0).getTileEntity(world);
    }
  }
;
  Assert.equal(get.apply(0).getStackInSlot(0).getItem(),Items.diamond,"String_Node_Str");
  Assert.isTrue(get.apply(0).getStackInSlot(0).stackSize > 3,"String_Node_Str");
  Assert.equal(get.apply(1).getStackInSlot(0).getItem(),Items.diamond,"String_Node_Str");
  Assert.equal(get.apply(1).getStackInSlot(0).stackSize,1,"String_Node_Str");
  Assert.equal(get.apply(2).getStackInSlot(0).getItem(),Item.getItemFromBlock(Blocks.log),"String_Node_Str");
  Assert.notNull(get.apply(3).getStackInSlot(0),"String_Node_Str");
  Assert.notNull(get.apply(4).getStackInSlot(0),"String_Node_Str");
  Assert.notNull(get.apply(5).getStackInSlot(0),"String_Node_Str");
  Assert.isNull(get.apply(6).getStackInSlot(0),"String_Node_Str");
}

Fixed version (ground truth):
@UnitTest(runTime=RunTime.INGAME,trigger=testTrigger) public void testDecompositionTable(){
  int[] stardust=new int[]{59,59,63,61,57,57,64};
  final List<PosMutable> decomposition=storedLocs.get("String_Node_Str");
  for (int a=0; a < stardust.length; a++) {
    pos.set(decomposition.get(a));
    Assert.equal(getTile(TileEntityDecompositionTable.class).getStackInSlot(1).stackSize,stardust[a],"String_Node_Str");
  }
  Function<Integer,TileEntityChest> get=input -> {
    return (TileEntityChest)pos.set(decomposition.get(input)).move(0,-2,0).getTileEntity(world);
  }
;
  Assert.equal(get.apply(0).getStackInSlot(0).getItem(),Items.diamond,"String_Node_Str");
  Assert.isTrue(get.apply(0).getStackInSlot(0).stackSize > 3,"String_Node_Str");
  Assert.equal(get.apply(1).getStackInSlot(0).getItem(),Items.diamond,"String_Node_Str");
  Assert.equal(get.apply(1).getStackInSlot(0).stackSize,1,"String_Node_Str");
  Assert.equal(get.apply(2).getStackInSlot(0).getItem(),Item.getItemFromBlock(Blocks.log),"String_Node_Str");
  Assert.notNull(get.apply(3).getStackInSlot(0),"String_Node_Str");
  Assert.notNull(get.apply(4).getStackInSlot(0),"String_Node_Str");
  Assert.notNull(get.apply(5).getStackInSlot(0),"String_Node_Str");
  Assert.isNull(get.apply(6).getStackInSlot(0),"String_Node_Str");
}
Program: 34556
Project: 34556
Buggy source:
@Override public boolean isItemValidForSlot(int slot,ItemStack is){
  return slot == slotStardust ? is.getItem() == ItemList.stardust : slot == 0;
}

Fixed version (ground truth):
@Override public boolean isItemValidForSlot(int slot,ItemStack is){
  return slot == slotStardust ? is.getItem() == ItemList.stardust : slot == slotSubject;
}
Program: 34557
Project: 34557
Buggy source:
public ItemStack processItem(ItemStack is,Random rand);

Fixed version (ground truth):
ItemStack processItem(ItemStack is,Random rand);
Program: 34559
Project: 34559
Buggy source:
public static IBlockPicker basic(final Block block,final int meta){
  return new BlockInfo(block,meta);
}

Fixed version (ground truth):
static IBlockPicker basic(final Block block,final int meta){
  return new BlockInfo(block,meta);
}
Program: 34560
Project: 34560
Buggy source:
@Override protected void renderToolTip(ItemStack is,int screenX,int screenY){
  isHoveringToken=is.getItem() == ItemList.portal_token && screenY * height / mc.displayHeight < 52;
  super.renderToolTip(is,screenX,screenY);
  isHoveringToken=false;
}

Fixed version (ground truth):
@Override protected void renderToolTip(ItemStack is,int mouseX,int mouseY){
  isHoveringToken=is.getItem() == ItemList.portal_token && mouseY - guiTop < 72;
  super.renderToolTip(is,mouseX,mouseY);
  isHoveringToken=false;
}
Program: 34561
Project: 34561
Buggy source:
@Override protected void drawHoveringText(List textLines,int screenX,int screenY,FontRenderer fontRenderer){
  if (isHoveringToken)   textLines.add(EnumChatFormatting.GREEN + "String_Node_Str");
  super.drawHoveringText(textLines,screenX,screenY,fontRenderer);
}

Fixed version (ground truth):
@Override protected void drawHoveringText(List textLines,int mouseX,int mouseY,FontRenderer fontRenderer){
  if (isHoveringToken)   textLines.add(EnumChatFormatting.GREEN + "String_Node_Str");
  super.drawHoveringText(textLines,mouseX,mouseY,fontRenderer);
}
Program: 34562
Project: 34562
Buggy source:
@Override protected void onRender(){
  EntityTechnicalVoidPortal data=BlockVoidPortal.getData(tile.getWorldObj(),tile.xCoord,tile.yCoord,tile.zCoord).orElse(null);
  alpha=data == null ? 0F : data.prevRenderAlpha + (data.renderAlpha - data.prevRenderAlpha) * ptt;
  translation=data == null ? 0F : data.prevRenderTranslation + (data.renderTranslation - data.prevRenderTranslation) * ptt;
  ItemStack tokenIS=data.getActiveToken();
  if (tokenIS != null) {
    EndTerritory territory=ItemPortalToken.getTerritory(tokenIS);
    if (territory != null)     activeEnvironment=territory.environment;
  }
}

Fixed version (ground truth):
@Override protected void onRender(){
  EntityTechnicalVoidPortal data=BlockVoidPortal.getData(tile.getWorldObj(),tile.xCoord,tile.yCoord,tile.zCoord).orElse(null);
  alpha=data == null ? 0F : data.prevRenderAlpha + (data.renderAlpha - data.prevRenderAlpha) * ptt;
  translation=data == null ? 0F : data.prevRenderTranslation + (data.renderTranslation - data.prevRenderTranslation) * ptt;
  ItemStack tokenIS=data == null ? null : data.getActiveToken();
  if (tokenIS != null) {
    EndTerritory territory=ItemPortalToken.getTerritory(tokenIS);
    if (territory != null)     activeEnvironment=territory.environment;
  }
}
Program: 34564
Project: 34564
Buggy source:
@Override public void renderTileEntityAt(TileEntity tile,double x,double y,double z,float partialTickTime){
  int meta=tile.hasWorldObj() ? tile.getBlockMetadata() : 0;
  TileEntityLootChest chest=(TileEntityLootChest)tile;
  bindTexture(texture);
  GL11.glPushMatrix();
  GL11.glEnable(GL12.GL_RESCALE_NORMAL);
  GL11.glColor4f(1F,1F,1F,1F);
  GL11.glTranslated(x,y + 1D,z + 1D);
  GL11.glScalef(1F,-1F,-1F);
  GL11.glTranslatef(0.5F,0.5F,0.5F);
  GL11.glRotatef(meta == 2 ? 180 : meta == 4 ? 90 : meta == 5 ? -90 : 0,0F,1F,0F);
  GL11.glTranslatef(-0.5F,-0.5F,-0.5F);
  model.chestLid.rotateAngleX=-((1F - (float)Math.pow(1F - chest.lidAnim + (chest.prevLidAnim - chest.lidAnim) * partialTickTime,3)) * (float)Math.PI * 0.5F);
  model.renderAll();
  GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  GL11.glPopMatrix();
  GL11.glColor4f(1F,1F,1F,1F);
}

Fixed version (ground truth):
@Override public void renderTileEntityAt(TileEntity tile,double x,double y,double z,float partialTickTime){
  int meta=tile.hasWorldObj() ? tile.getBlockMetadata() : 0;
  TileEntityLootChest chest=(TileEntityLootChest)tile;
  bindTexture(texture);
  GL11.glPushMatrix();
  GL11.glEnable(GL12.GL_RESCALE_NORMAL);
  GL11.glColor4f(1F,1F,1F,1F);
  GL11.glTranslated(x,y + 1D,z + 1D);
  GL11.glScalef(1F,-1F,-1F);
  GL11.glTranslatef(0.5F,0.5F,0.5F);
  GL11.glRotatef(meta == 2 ? 180 : meta == 4 ? 90 : meta == 5 ? -90 : 0,0F,1F,0F);
  GL11.glTranslatef(-0.5F,-0.5F,-0.5F);
  model.chestLid.rotateAngleX=Math.min(0F,-((1F - (float)Math.pow(1F - chest.lidAnim + (chest.prevLidAnim - chest.lidAnim) * partialTickTime,3)) * MathUtil.HALF_PI));
  model.renderAll();
  GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  GL11.glPopMatrix();
  GL11.glColor4f(1F,1F,1F,1F);
}
Program: 34565
Project: 34565
Buggy source:
@Override public void run(String... args){
  int amtX=DragonUtil.tryParse(args.length > 0 ? args[0] : "String_Node_Str",1);
  int amtZ=DragonUtil.tryParse(args.length > 1 ? args[1] : "String_Node_Str",1);
  GenerateOres gen=new GenerateOres(Blocks.air,BlockList.end_powder_ore);
  gen.setChunkSize(12);
  gen.setY(16,16);
  gen.setAttemptsPerChunk(1);
  gen.setClustersPerChunk(1,1);
  gen.setOresPerCluster(4,4,RandomAmount.preferSmaller);
  gen.setOreGenerator(new IOreGenerator.AttachingLines(new RangeGenerator(4,4,RandomAmount.aroundCenter)));
  StructureWorld structureWorld=new StructureWorld(world,12 + 6 * amtX,33,12 + 6 * amtZ);
  gen.generateSplit(structureWorld,world.rand);
  structureWorld.generateInWorld(world,world.rand,MathUtil.floor(player.posX),MathUtil.floor(player.posY) - 24,MathUtil.floor(player.posZ));
}

Fixed version (ground truth):
@Override public void run(String... args){
  int amtX=DragonUtil.tryParse(args.length > 0 ? args[0] : "String_Node_Str",1);
  int amtZ=DragonUtil.tryParse(args.length > 1 ? args[1] : "String_Node_Str",1);
  GenerateOres gen=new GenerateOres(Blocks.air,BlockList.end_powder_ore);
  gen.setChunkSize(12);
  gen.setY(16,16);
  gen.setAttemptsPerChunk(1);
  gen.setClustersPerChunk(1,1);
  gen.setOresPerCluster(4,4,RandomAmount.preferSmaller);
  gen.setOreGenerator(new IOreGenerator.AttachingLines(new RangeGenerator(4,4,RandomAmount.aroundCenter),false));
  StructureWorld structureWorld=new StructureWorld(world,12 + 6 * amtX,33,12 + 6 * amtZ);
  gen.generateSplit(structureWorld,world.rand);
  structureWorld.generateInWorld(world,world.rand,MathUtil.floor(player.posX),MathUtil.floor(player.posY) - 24,MathUtil.floor(player.posZ));
}
Program: 34566
Project: 34566
Buggy source:
public static void initialize(){
  HELP.setHidden().addFragments(new KnowledgeFragment[]{new FragmentText(0).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(1).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(2).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(3).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(4).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(5).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(6).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(7).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(8).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(9).setType(KnowledgeFragmentType.VISIBLE)});
  TEST2.setParent(TEST1,0,4).addFragments(new KnowledgeFragment[]{new FragmentText(20).setType(KnowledgeFragmentType.ESSENTIAL),new FragmentText(21).setType(KnowledgeFragmentType.DISCOVERY)});
  TEST3.setParent(TEST2,-5,3).addParentLine(0,-2).addParentLine(2,-2).addParentLine(2,-3);
  TEST4.setParent(TEST2,3,3).setImportant().addChildLine(0,2).addFragments(new KnowledgeFragment[]{new FragmentText(40).setType(KnowledgeFragmentType.ESSENTIAL),new FragmentText(41).setType(KnowledgeFragmentType.DISCOVERY)});
  TEST5.setParent(TEST4,0,200);
  TEST6.setParent(TEST4,3,8).addParentLine(-3,0);
}

Fixed version (ground truth):
public static void initialize(){
  HELP.setHidden().addFragments(new KnowledgeFragment[]{new FragmentText(0).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(1).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(2).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(3).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(4).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(5).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(6).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(7).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(8).setType(KnowledgeFragmentType.VISIBLE),new FragmentText(9).setType(KnowledgeFragmentType.VISIBLE)});
  TEST2.setParent(TEST1,0,4).addFragments(new KnowledgeFragment[]{new FragmentText(20).setType(KnowledgeFragmentType.ESSENTIAL),new FragmentText(21).setType(KnowledgeFragmentType.DISCOVERY)});
  TEST3.setParent(TEST2,-5,3).addParentLine(0,-2).addParentLine(2,-2).addParentLine(2,-3);
  TEST4.setParent(TEST2,3,3).setImportant().addChildLine(0,2).addFragments(new KnowledgeFragment[]{new FragmentText(40).setType(KnowledgeFragmentType.ESSENTIAL),new FragmentText(41).setType(KnowledgeFragmentType.DISCOVERY),new FragmentText(42).setType(KnowledgeFragmentType.SECRET,10)});
  TEST5.setParent(TEST4,0,200);
  TEST6.setParent(TEST4,3,8).addParentLine(-3,0);
}
Program: 34567
Project: 34567
Buggy source:
@Override @SideOnly(Side.CLIENT) protected void handle(EntityClientPlayerMP player){
  if (file != null)   CompendiumEventsClient.loadClientData(file);
  if (discovered != null) {
    OverlayManager.addNotification(discovered);
    player.worldObj.playSound(player.posX,player.posY,player.posZ,"String_Node_Str",0.25F,0.5F * ((player.getRNG().nextFloat() - player.getRNG().nextFloat()) * 0.7F + 1.6F),false);
  }
  GuiEnderCompendium.pausesGame=GuiEnderCompendium.wasPaused;
  System.out.println("String_Node_Str" + GuiEnderCompendium.wasPaused);
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) protected void handle(EntityClientPlayerMP player){
  if (file != null)   CompendiumEventsClient.loadClientData(file);
  if (discovered != null) {
    OverlayManager.addNotification(discovered);
    player.worldObj.playSound(player.posX,player.posY,player.posZ,"String_Node_Str",0.25F,0.5F * ((player.getRNG().nextFloat() - player.getRNG().nextFloat()) * 0.7F + 1.6F),false);
  }
  GuiEnderCompendium.pausesGame=GuiEnderCompendium.wasPaused;
}
Program: 34568
Project: 34568
Buggy source:
@EventHandler public void onPostInit(FMLPostInitializationEvent e){
  Stopwatch.time("String_Node_Str");
  HeeIMC.runPostInit();
  ModIntegrationManager.integrateMods();
  DimensionOverride.postInit();
  Stopwatch.finish("String_Node_Str");
}

Fixed version (ground truth):
@EventHandler public void onPostInit(FMLPostInitializationEvent e){
  Stopwatch.time("String_Node_Str");
  HeeIMC.runPostInit();
  KnowledgeRegistrations.initialize();
  ModIntegrationManager.integrateMods();
  DimensionOverride.postInit();
  Stopwatch.finish("String_Node_Str");
}
Program: 34569
Project: 34569
Buggy source:
public boolean canSeeFragment(KnowledgeObject<? extends IObjectHolder<?>> obj,KnowledgeFragment fragment){
switch (fragment.getType()) {
case VISIBLE:
    return true;
case ESSENTIAL:
  return getDiscoveryDistance(obj,distanceLimit) != distanceLimit;
case DISCOVERY:
return getDiscoveryDistance(obj,distanceLimit) == 0;
default :
return extraFragments.contains(fragment.globalID);
}
}

Fixed version (ground truth):
public boolean canSeeFragment(KnowledgeObject<? extends IObjectHolder<?>> obj,KnowledgeFragment fragment){
switch (fragment.getType()) {
case VISIBLE:
    return true;
case ESSENTIAL:
  return getDiscoveryDistance(obj) != distanceLimit;
case DISCOVERY:
return getDiscoveryDistance(obj) == 0;
default :
return extraFragments.contains(fragment.globalID);
}
}
Program: 34570
Project: 34570
Buggy source:
public int getDiscoveryDistance(KnowledgeObject<? extends IObjectHolder<?>> obj,int limit){
  for (int level=0; level < limit; level++) {
    if (discoveredObjects.contains(obj))     return level;
 else     obj=obj.getParent();
  }
  return limit;
}

Fixed version (ground truth):
public int getDiscoveryDistance(KnowledgeObject<? extends IObjectHolder<?>> obj){
  for (int level=0; level < distanceLimit; level++) {
    if (discoveredObjects.contains(obj))     return level;
 else     obj=obj.getParent();
  }
  return distanceLimit;
}
Program: 34571
Project: 34571
Buggy source:
public void moveToCurrentObject(boolean animate){
  if (currentObject == null)   return;
  int newY=Integer.MIN_VALUE;
  for (  ObjectDisplayElement element : objectElements) {
    if (element.object.getObject() == currentObject.getObject()) {
      newY=-(element.y + element.object.getY() - (height >> 1) + 11);
      break;
    }
  }
  if (newY == Integer.MIN_VALUE) {
    for (    CategoryDisplayElement element : categoryElements) {
      if (element.category.getCategoryObject().getObject() == currentObject.getObject()) {
        newY=-(element.y + element.category.getCategoryObject().getY() - (height >> 1) + 20);
        break;
      }
    }
  }
  if (newY != Integer.MIN_VALUE) {
    if (animate)     offsetY.startAnimation(offsetY.value(),newY,0.5F);
 else     offsetY.set(newY);
  }
}

Fixed version (ground truth):
public void moveToCurrentObject(boolean animate){
  if (currentObject == null)   return;
  int newY=Integer.MIN_VALUE;
  for (  ObjectDisplayElement element : objectElements) {
    if (element.object == currentObject) {
      newY=-(element.y + element.object.getY() - (height >> 1) + 11);
      break;
    }
  }
  if (newY != Integer.MIN_VALUE) {
    if (animate)     offsetY.startAnimation(offsetY.value(),newY,0.5F);
 else     offsetY.set(newY);
  }
}
Program: 34572
Project: 34572
Buggy source:
public void showObject(KnowledgeObject<? extends IObjectHolder<?>> object){
  if (currentObject != null) {
    currentObjectPages.clear();
    purchaseElements.clear();
    if (currentObject != object) {
      pageIndex=0;
      btnHelp.forcedHover=false;
    }
  }
  if ((currentObject=object) == null)   return;
  byte page=0;
  int yy=0, height=0;
  boolean isUnlocked=false;
  Map<KnowledgeFragment,Boolean> pageMap=new LinkedHashMap<>();
  Iterator<KnowledgeFragment> iter=currentObject.getFragments().iterator();
  while (true) {
    KnowledgeFragment fragment=iter.hasNext() ? iter.next() : null;
    if (fragment == null || yy + (height=8 + fragment.getHeight(this,isUnlocked=(object == KnowledgeRegistrations.HELP || compendiumFile.hasUnlockedFragment(fragment)))) > guiPageHeight) {
      currentObjectPages.put(page++,pageMap);
      if (fragment == null)       break;
 else {
        pageMap=new LinkedHashMap<>();
        pageMap.put(fragment,isUnlocked);
        yy=height;
        continue;
      }
    }
    pageMap.put(fragment,isUnlocked);
    yy+=height;
  }
  if (object == KnowledgeRegistrations.HELP) {
    btnHelp.forcedHover=true;
    if (!compendiumFile.seenHelp()) {
      PacketPipeline.sendToServer(new S03SimpleEvent(EventType.OPEN_COMPENDIUM_HELP));
      compendiumFile.setSeenHelp();
    }
    purchaseElements.clear();
    return;
  }
  updatePurchaseElements();
}

Fixed version (ground truth):
public void showObject(KnowledgeObject<? extends IObjectHolder<?>> object){
  if (currentObject != null) {
    currentObjectPages.clear();
    purchaseElements.clear();
    if (currentObject != object) {
      pageIndex=0;
      btnHelp.forcedHover=false;
    }
  }
  if ((currentObject=object) == null)   return;
  byte page=0;
  int yy=0, height=0;
  boolean isUnlocked=false;
  Map<KnowledgeFragment,Boolean> pageMap=new LinkedHashMap<>();
  Iterator<KnowledgeFragment> iter=currentObject.getFragments().iterator();
  while (true) {
    KnowledgeFragment fragment=iter.hasNext() ? iter.next() : null;
    if (fragment == null || yy + (height=8 + fragment.getHeight(this,isUnlocked=compendiumFile.canSeeFragment(object,fragment))) > guiPageHeight) {
      currentObjectPages.put(page++,pageMap);
      if (fragment == null)       break;
 else {
        pageMap=new LinkedHashMap<>();
        pageMap.put(fragment,isUnlocked);
        yy=height;
        continue;
      }
    }
    pageMap.put(fragment,isUnlocked);
    yy+=height;
  }
  updatePurchaseElements();
}
Program: 34574
Project: 34574
Buggy source:
private void updatePurchaseElements(){
  purchaseElements.clear();
  if (currentObject != null) {
    if (!compendiumFile.hasDiscoveredObject(currentObject)) {
      if (currentObject.isBuyable())       purchaseElements.add(new PurchaseDisplayElement(currentObject,(this.height >> 1) - 3,compendiumFile.getPoints() >= currentObject.getUnlockPrice() ? FragmentPurchaseStatus.CAN_PURCHASE : FragmentPurchaseStatus.NOT_ENOUGH_POINTS));
      return;
    }
    int yy=((this.height - guiPageTexHeight) >> 1) + guiPageTop, height;
    for (    Entry<KnowledgeFragment,Boolean> entry : currentObjectPages.get(pageIndex).entrySet()) {
      height=entry.getKey().getHeight(this,entry.getValue());
      if (!entry.getValue())       purchaseElements.add(new PurchaseDisplayElement(entry.getKey(),yy + (height >> 1) + 2,compendiumFile.canPurchaseFragment(entry.getKey())));
      yy+=8 + height;
    }
  }
}

Fixed version (ground truth):
private void updatePurchaseElements(){
  purchaseElements.clear();
  if (currentObject != null) {
    if (!compendiumFile.isDiscovered(currentObject)) {
      purchaseElements.add(new PurchaseDisplayElement(currentObject,(this.height >> 1) - 3));
      return;
    }
    int yy=((this.height - guiPageTexHeight) >> 1) + guiPageTop, height;
    for (    Entry<KnowledgeFragment,Boolean> entry : currentObjectPages.get(pageIndex).entrySet()) {
      height=entry.getKey().getHeight(this,entry.getValue());
      if (!entry.getValue())       purchaseElements.add(new PurchaseDisplayElement(entry.getKey(),yy + (height >> 1) + 2));
      yy+=8 + height;
    }
  }
}
Program: 34575
Project: 34575
Buggy source:
public GuiEnderCompendium(CompendiumFile compendiumData){
  if (!(this.compendiumFile=compendiumData).seenHelp())   hoverTriggerTimer=0;
  animationList.add(offsetY=new AnimatedFloat(Easing.CUBIC));
  animationList.add(portalSpeed=new AnimatedFloat(Easing.CUBIC));
  int y=0, maxY=0;
  for (  KnowledgeCategory category : KnowledgeCategories.categoryList) {
    y+=32;
    categoryElements.add(new CategoryDisplayElement(category,y));
    y+=44;
    for (    KnowledgeObject obj : category.getAllObjects()) {
      if (!obj.isCategoryObject()) {
        objectElements.add(new ObjectDisplayElement(obj,y));
        if (obj.getY() > maxY)         maxY=obj.getY();
      }
    }
    y+=maxY + 30;
    maxY=0;
  }
  this.totalHeight=y;
  portalSpeed.startAnimation(30F,15F,1.5F);
}

Fixed version (ground truth):
public GuiEnderCompendium(CompendiumFile compendiumFile){
  this.compendiumFile=compendiumFile;
  animationList.add(offsetY=new AnimatedFloat(Easing.CUBIC));
  animationList.add(portalSpeed=new AnimatedFloat(Easing.CUBIC));
  int y=0, maxY=0;
  for (  KnowledgeObject<?> obj : KnowledgeObject.getAllObjects()) {
    objectElements.add(new ObjectDisplayElement(obj,y));
    if (obj.getY() > maxY)     maxY=obj.getY();
  }
  this.totalHeight=y;
  portalSpeed.startAnimation(30F,15F,1.5F);
}
Program: 34576
Project: 34576
Buggy source:
@Override public void updateScreen(){
  prevOffsetY=offsetY.value();
  if (!portalSpeed.isAnimating()) {
    if (currentObject != null) {
      if (MathUtil.floatEquals(portalSpeed.value(),15F))       portalSpeed.startAnimation(15F,5F,0.5F);
    }
 else     if (MathUtil.floatEquals(portalSpeed.value(),5F))     portalSpeed.startAnimation(5F,15F,0.5F);
  }
  portalRenderer.update((int)portalSpeed.value());
  for (  AnimatedFloat animation : animationList)   animation.update(0.05F);
  int wheel=Mouse.getDWheel();
  if (wheel != 0) {
    if (currentObject != null && (currentObject == KnowledgeRegistrations.HELP || prevMouseX >= width >> 1)) {
      if (wheel > 0)       actionPerformed((GuiButton)buttonList.get(3));
 else       if (wheel < 0)       actionPerformed((GuiButton)buttonList.get(4));
    }
 else     offsetY.set(offsetY.value() + (wheel > 0 ? 80 : -80));
  }
  if (!MathUtil.floatEquals(prevDragOffsetY,0F)) {
    offsetY.set(offsetY.value() - prevDragOffsetY);
    prevDragOffsetY=0F;
  }
  if (offsetY.value() > 0)   offsetY.set(0F);
 else   if (offsetY.value() < -totalHeight + height - 32)   offsetY.set(-totalHeight + height - 32);
  if (hoverTriggerTimer != Byte.MIN_VALUE && ++hoverTriggerTimer > 12) {
    if (!compendiumFile.seenHelp())     btnHelp.forcedHover=!btnHelp.forcedHover;
 else     if (currentObject == KnowledgeRegistrations.HELP) {
      if (pageIndex == 0)       pageArrows[1].forcedHover=!pageArrows[1].forcedHover;
 else {
        hoverTriggerTimer=Byte.MIN_VALUE;
        pageArrows[1].forcedHover=false;
      }
    }
    if (hoverTriggerTimer != Byte.MIN_VALUE)     hoverTriggerTimer=0;
  }
}

Fixed version (ground truth):
@Override public void updateScreen(){
  prevOffsetY=offsetY.value();
  if (!portalSpeed.isAnimating()) {
    if (currentObject != null) {
      if (MathUtil.floatEquals(portalSpeed.value(),15F))       portalSpeed.startAnimation(15F,5F,0.5F);
    }
 else     if (MathUtil.floatEquals(portalSpeed.value(),5F))     portalSpeed.startAnimation(5F,15F,0.5F);
  }
  portalRenderer.update((int)portalSpeed.value());
  for (  AnimatedFloat animation : animationList)   animation.update(0.05F);
  int wheel=Mouse.getDWheel();
  if (wheel != 0) {
    if (currentObject != null && (currentObject == KnowledgeRegistrations.HELP || prevMouseX >= width >> 1)) {
      if (wheel > 0)       actionPerformed((GuiButton)buttonList.get(3));
 else       if (wheel < 0)       actionPerformed((GuiButton)buttonList.get(4));
    }
 else     offsetY.set(offsetY.value() + (wheel > 0 ? 80 : -80));
  }
  if (!MathUtil.floatEquals(prevDragOffsetY,0F)) {
    offsetY.set(offsetY.value() - prevDragOffsetY);
    prevDragOffsetY=0F;
  }
  if (offsetY.value() > 0)   offsetY.set(0F);
 else   if (offsetY.value() < -totalHeight + height - 32)   offsetY.set(-totalHeight + height - 32);
}
Program: 34577
Project: 34577
Buggy source:
@Override protected void actionPerformed(GuiButton button){
  hasClickedButton=true;
  if (!(button.enabled && button.visible))   return;
  if (button.id == 0 && !offsetY.isAnimating()) {
    mc.displayGuiScreen(new GuiAchievementsCustom(this,mc.thePlayer.getStatFileWriter()));
  }
 else   if (button.id == 1)   showObject(KnowledgeRegistrations.HELP);
 else   if (button.id == 2 && !offsetY.isAnimating()) {
    if (currentObject != null)     showObject(null);
 else {
      mc.displayGuiScreen((GuiScreen)null);
      mc.setIngameFocus();
    }
  }
 else   if (button.id == 3)   pageIndex=(byte)Math.max(0,pageIndex - 1);
 else   if (button.id == 4)   pageIndex=(byte)Math.min(currentObjectPages.size() - 1,pageIndex + 1);
 else   if (button.id == 5) {
    if (++KnowledgeFragmentText.smoothRenderingMode > 2)     KnowledgeFragmentText.smoothRenderingMode=0;
    for (    IConfigElement element : ConfigHandler.getGuiConfigElements()) {
      if (element.getName().equals("String_Node_Str") && element.isProperty()) {
        element.set(KnowledgeFragmentText.smoothRenderingMode);
        break;
      }
    }
    HardcoreEnderExpansion.proxy.loadConfiguration();
  }
  if (button.id == 3 || button.id == 4)   updatePurchaseElements();
}

Fixed version (ground truth):
@Override protected void actionPerformed(GuiButton button){
  hasClickedButton=true;
  if (!(button.enabled && button.visible))   return;
  if (button.id == 0 && !offsetY.isAnimating()) {
    mc.displayGuiScreen(new GuiAchievementsCustom(this,mc.thePlayer.getStatFileWriter()));
  }
 else   if (button.id == 1)   showObject(KnowledgeRegistrations.HELP);
 else   if (button.id == 2 && !offsetY.isAnimating()) {
    if (currentObject != null)     showObject(null);
 else {
      mc.displayGuiScreen((GuiScreen)null);
      mc.setIngameFocus();
    }
  }
 else   if (button.id == 3)   pageIndex=(byte)Math.max(0,pageIndex - 1);
 else   if (button.id == 4)   pageIndex=(byte)Math.min(currentObjectPages.size() - 1,pageIndex + 1);
 else   if (button.id == 5) {
  }
  if (button.id == 3 || button.id == 4)   updatePurchaseElements();
}
Program: 34579
Project: 34579
Buggy source:
private void renderPaper(int x,int y,int mouseX,int mouseY){
  GL11.glDisable(GL11.GL_DEPTH_TEST);
  pageArrows[0].xPosition=x - (guiPageTexWidth * 3 / 10) - 10;
  pageArrows[1].xPosition=x + (guiPageTexWidth * 3 / 10) - 10;
  GL11.glColor4f(1F,1F,1F,1F);
  RenderHelper.disableStandardItemLighting();
  mc.getTextureManager().bindTexture(texPage);
  drawTexturedModalRect(x - (guiPageTexWidth >> 1),y - (guiPageTexHeight >> 1),0,0,guiPageTexWidth,guiPageTexHeight);
  if (compendiumFile.hasDiscoveredObject(currentObject)) {
    x=x - (guiPageTexWidth >> 1) + guiPageLeft;
    y=y - (guiPageTexHeight >> 1) + guiPageTop;
    for (    Entry<KnowledgeFragment,Boolean> entry : currentObjectPages.get(pageIndex).entrySet()) {
      entry.getKey().onRender(this,x,y,mouseX,mouseY,entry.getValue());
      y+=8 + entry.getKey().getHeight(this,entry.getValue());
    }
    for (int a=0; a < 2; a++)     pageArrows[a].visible=true;
    pageArrows[0].visible=pageIndex > 0;
    pageArrows[1].visible=pageIndex < currentObjectPages.size() - 1;
    x=x + (guiPageTexWidth >> 1) - guiPageLeft;
  }
  for (  PurchaseDisplayElement element : purchaseElements)   element.render(this,mouseX,mouseY,x);
  if (!currentObject.isBuyable() && !compendiumFile.hasDiscoveredObject(currentObject)) {
    RenderHelper.disableStandardItemLighting();
    String msg=I18n.format("String_Node_Str");
    mc.fontRenderer.drawString(msg,x - (mc.fontRenderer.getStringWidth(msg) >> 1),y - 7,0x404040);
  }
  GL11.glEnable(GL11.GL_DEPTH_TEST);
}

Fixed version (ground truth):
private void renderPaper(int x,int y,int mouseX,int mouseY){
  GL11.glDisable(GL11.GL_DEPTH_TEST);
  pageArrows[0].xPosition=x - (guiPageTexWidth * 3 / 10) - 10;
  pageArrows[1].xPosition=x + (guiPageTexWidth * 3 / 10) - 10;
  GL11.glColor4f(1F,1F,1F,1F);
  RenderHelper.disableStandardItemLighting();
  mc.getTextureManager().bindTexture(texPage);
  drawTexturedModalRect(x - (guiPageTexWidth >> 1),y - (guiPageTexHeight >> 1),0,0,guiPageTexWidth,guiPageTexHeight);
  if (compendiumFile.isDiscovered(currentObject)) {
    x=x - (guiPageTexWidth >> 1) + guiPageLeft;
    y=y - (guiPageTexHeight >> 1) + guiPageTop;
    for (    Entry<KnowledgeFragment,Boolean> entry : currentObjectPages.get(pageIndex).entrySet()) {
      entry.getKey().onRender(this,x,y,mouseX,mouseY,entry.getValue());
      y+=8 + entry.getKey().getHeight(this,entry.getValue());
    }
    for (int a=0; a < 2; a++)     pageArrows[a].visible=true;
    pageArrows[0].visible=pageIndex > 0;
    pageArrows[1].visible=pageIndex < currentObjectPages.size() - 1;
    x=x + (guiPageTexWidth >> 1) - guiPageLeft;
  }
  for (  PurchaseDisplayElement element : purchaseElements)   element.render(this,mouseX,mouseY,x);
  if (!compendiumFile.isDiscovered(currentObject)) {
    RenderHelper.disableStandardItemLighting();
    String msg=I18n.format("String_Node_Str");
    mc.fontRenderer.drawString(msg,x - (mc.fontRenderer.getStringWidth(msg) >> 1),y - 7,0x404040);
  }
  GL11.glEnable(GL11.GL_DEPTH_TEST);
}
Program: 34580
Project: 34580
Buggy source:
private void renderScreenPost(int mouseX,int mouseY,float partialTickTime){
  mc.getTextureManager().bindTexture(texBack);
  GuiButton button=(GuiButton)buttonList.get(5);
  drawTexturedModalRect(button.xPosition,button.yPosition,KnowledgeFragmentText.smoothRenderingMode > 0 ? 56 : 77,29,20,20);
  if (mouseX >= button.xPosition && mouseX <= button.xPosition + button.width && mouseY > button.yPosition && mouseY < button.yPosition + button.height) {
    StringBuilder build=new StringBuilder(110);
    build.append(I18n.format("String_Node_Str")).append('\n');
    build.append(EnumChatFormatting.GRAY).append(I18n.format("String_Node_Str")).append('\n');
    build.append(EnumChatFormatting.GRAY).append(I18n.format("String_Node_Str")).append('\n');
    build.append(EnumChatFormatting.DARK_GREEN).append(I18n.format("String_Node_Str")).append("String_Node_Str");
    build.append(KnowledgeFragmentText.smoothRenderingMode == 0 ? I18n.format("String_Node_Str") : String.valueOf(KnowledgeFragmentText.smoothRenderingMode));
    GuiItemRenderHelper.setupTooltip(mouseX,mouseY - 24,build.toString());
  }
  GuiItemRenderHelper.drawTooltip(this,fontRendererObj);
}

Fixed version (ground truth):
private void renderScreenPost(int mouseX,int mouseY,float partialTickTime){
}
Program: 34581
Project: 34581
Buggy source:
public static <T extends IObjectHolder<?>>KnowledgeObject<T> fromObject(ItemStack is){
  if (!KnowledgeUtils.isItemStackViable(is))   return null;
  return (KnowledgeObject<T>)allObjects.valueCollection().stream().filter(knowledgeObj -> knowledgeObj.holder.checkEquality(is)).findFirst().orElse(null);
}

Fixed version (ground truth):
public static final <T extends IObjectHolder<?>>KnowledgeObject<T> fromObject(ItemStack is){
  if (!KnowledgeUtils.isItemStackViable(is))   return null;
  return (KnowledgeObject<T>)getAllObjects().stream().filter(knowledgeObj -> knowledgeObj.holder.checkEquality(is)).findFirst().orElse(null);
}
Program: 34582
Project: 34582
Buggy source:
public static <T extends IObjectHolder<?>>KnowledgeObject<T> fromID(int id){
  return (KnowledgeObject<T>)allObjects.get(id);
}

Fixed version (ground truth):
public static final <T extends IObjectHolder<?>>KnowledgeObject<T> fromID(int id){
  return (KnowledgeObject<T>)allObjects.get(id);
}
Program: 34583
Project: 34583
Buggy source:
@SideOnly(Side.CLIENT) public CompendiumFile(NBTTagCompound nbt){
  super("String_Node_Str","String_Node_Str");
  onLoad(nbt);
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public CompendiumFile(NBTTagCompound nbt){
  super("String_Node_Str","String_Node_Str");
  onLoad(nbt);
  discoveredObjects.add(KnowledgeRegistrations.HELP);
}
Program: 34584
Project: 34584
Buggy source:
@Override public void updateScreen(){
  prevOffsetY=offsetY.value();
  if (!portalSpeed.isAnimating()) {
    if (currentObject != null) {
      if (MathUtil.floatEquals(portalSpeed.value(),15F))       portalSpeed.startAnimation(15F,5F,0.5F);
    }
 else     if (MathUtil.floatEquals(portalSpeed.value(),5F))     portalSpeed.startAnimation(5F,15F,0.5F);
  }
  portalRenderer.update((int)portalSpeed.value());
  for (  AnimatedFloat animation : animationList)   animation.update(0.05F);
  int wheel=Mouse.getDWheel();
  if (wheel != 0) {
    if (currentObject != null && (currentObject == KnowledgeRegistrations.HELP || prevMouseX >= width >> 1)) {
      if (wheel > 0)       actionPerformed((GuiButton)buttonList.get(3));
 else       if (wheel < 0)       actionPerformed((GuiButton)buttonList.get(4));
    }
 else     offsetY.set(offsetY.value() + (wheel > 0 ? 80 : -80));
  }
  if (!MathUtil.floatEquals(prevDragOffsetY,0F)) {
    offsetY.set(offsetY.value() - prevDragOffsetY);
    prevDragOffsetY=0F;
  }
  if (offsetY.value() > 0)   offsetY.set(0F);
 else   if (offsetY.value() < -totalHeight + height - 32)   offsetY.set(-totalHeight + height - 32);
}

Fixed version (ground truth):
@Override public void updateScreen(){
  prevOffsetY=offsetY.value();
  if (!portalSpeed.isAnimating()) {
    if (currentObject != null) {
      if (MathUtil.floatEquals(portalSpeed.value(),15F))       portalSpeed.startAnimation(15F,5F,0.5F);
    }
 else     if (MathUtil.floatEquals(portalSpeed.value(),5F))     portalSpeed.startAnimation(5F,15F,0.5F);
  }
  portalRenderer.update((int)portalSpeed.value());
  for (  AnimatedFloat animation : animationList)   animation.update(0.05F);
  int wheel=Mouse.getDWheel();
  if (wheel != 0) {
    if (currentObject != null && (currentObject == KnowledgeRegistrations.HELP || prevMouseX >= width >> 1)) {
      if (wheel > 0)       actionPerformed((GuiButton)buttonList.get(3));
 else       if (wheel < 0)       actionPerformed((GuiButton)buttonList.get(4));
    }
 else     offsetY.set(offsetY.value() + (wheel > 0 ? 80 : -80));
  }
  if (!MathUtil.floatEquals(prevDragOffsetY,0F)) {
    offsetY.set(offsetY.value() - prevDragOffsetY);
    prevDragOffsetY=0F;
  }
  if (offsetY.value() > 0)   offsetY.set(0F);
 else   if (offsetY.value() < -totalHeight + height - 32)   offsetY.set(totalHeight > height ? -totalHeight + height - 32F : 0F);
}
Program: 34585
Project: 34585
Buggy source:
public static void initialize(){
  TEST2.setParent(TEST1,0,4);
}

Fixed version (ground truth):
public static void initialize(){
  HELP.addFragments(new FragmentText(0).setType(KnowledgeFragmentType.VISIBLE));
  HELP.addFragments(new FragmentText(1).setType(KnowledgeFragmentType.VISIBLE));
  HELP.addFragments(new FragmentText(2).setType(KnowledgeFragmentType.VISIBLE));
  HELP.addFragments(new FragmentText(3).setType(KnowledgeFragmentType.VISIBLE));
  TEST2.setParent(TEST1,0,4);
}
Program: 34586
Project: 34586
Buggy source:
public T setType(KnowledgeFragmentType type,int price){
  if ((price == 0) ^ (type == KnowledgeFragmentType.SECRET)) {
    throw new IllegalArgumentException(price == 0 ? "String_Node_Str" : "String_Node_Str");
  }
  this.type=type;
  this.price=0;
  return (T)this;
}

Fixed version (ground truth):
public T setType(KnowledgeFragmentType type,int price){
  if ((price != 0) ^ (type == KnowledgeFragmentType.SECRET)) {
    throw new IllegalArgumentException(price == 0 ? "String_Node_Str" : "String_Node_Str");
  }
  this.type=type;
  this.price=0;
  return (T)this;
}
Program: 34587
Project: 34587
Buggy source:
@SideOnly(Side.CLIENT) private static void renderString(String str,int x,int y,int maxWidth,int normalColor,int smoothColor){
  Minecraft mc=Minecraft.getMinecraft();
  FontRenderer fontRenderer=mc.fontRenderer;
  boolean origFont=fontRenderer.getUnicodeFlag();
  fontRenderer.setUnicodeFlag(true);
  if (mc.gameSettings.guiScale == 2) {
    fontRenderer.drawSplitString(str,x,y,maxWidth,smoothColor);
  }
 else   fontRenderer.drawSplitString(str,x,y,maxWidth,normalColor);
  fontRenderer.setUnicodeFlag(origFont);
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) private static void renderString(String str,int x,int y,int maxWidth,int color){
  Minecraft mc=Minecraft.getMinecraft();
  FontRenderer fontRenderer=mc.fontRenderer;
  boolean origFont=fontRenderer.getUnicodeFlag();
  fontRenderer.setUnicodeFlag(true);
  if (mc.gameSettings.guiScale == 3) {
    float dist=0.08F;
    for (int cycle=0; cycle < 2; cycle++) {
      GL11.glTranslatef(-dist,0F,0F);
      fontRenderer.drawSplitString(str,x,y,maxWidth,color);
      GL11.glTranslatef(dist,0F,0F);
      GL11.glTranslatef(0F,-dist,0F);
      fontRenderer.drawSplitString(str,x,y,maxWidth,color);
      GL11.glTranslatef(0F,dist,0F);
      GL11.glTranslatef(dist,-dist,0F);
      fontRenderer.drawSplitString(str,x,y,maxWidth,color);
      GL11.glTranslatef(-dist,dist,0F);
      dist=-dist;
    }
  }
 else   fontRenderer.drawSplitString(str,x,y,maxWidth,color);
  fontRenderer.setUnicodeFlag(origFont);
}
Program: 34588
Project: 34588
Buggy source:
@Override @SideOnly(Side.CLIENT) public void onRender(GuiEnderCompendium gui,int x,int y,int mouseX,int mouseY,boolean isUnlocked){
  String str=getString(isUnlocked);
  renderString(str,x + 1,y,GuiEnderCompendium.guiPageWidth - 10,255 << 24,240 << 24);
  if (isUnlocked) {
    KnowledgeObject<?> obj=getHoveredObject(gui.mc.fontRenderer,mouseX,mouseY,x,y);
    if (obj != null)     GuiItemRenderHelper.setupTooltip(mouseX,mouseY,obj.getTranslatedTooltip() + "String_Node_Str" + EnumChatFormatting.DARK_PURPLE+ I18n.format("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override @SideOnly(Side.CLIENT) public void onRender(GuiEnderCompendium gui,int x,int y,int mouseX,int mouseY,boolean isUnlocked){
  String str=getString(isUnlocked);
  renderString(str,x + 1,y,GuiEnderCompendium.guiPageWidth - 10,255 << 24);
  if (isUnlocked) {
    KnowledgeObject<?> obj=getHoveredObject(gui.mc.fontRenderer,mouseX,mouseY,x,y);
    if (obj != null)     GuiItemRenderHelper.setupTooltip(mouseX,mouseY,obj.getTranslatedTooltip() + "String_Node_Str" + EnumChatFormatting.DARK_PURPLE+ I18n.format("String_Node_Str"));
  }
}
Program: 34589
Project: 34589
Buggy source:
public static boolean tryDiscover(EntityPlayer player,ItemStack is){
  return getPlayerData(player).tryDiscoverObject(KnowledgeObject.fromObject(is));
}

Fixed version (ground truth):
public static boolean tryDiscover(EntityPlayer player,ItemStack is){
  KnowledgeObject knowledgeObj=KnowledgeObject.fromObject(is);
  return knowledgeObj != null && getPlayerData(player).tryDiscoverObject(knowledgeObj);
}
Program: 34590
Project: 34590
Buggy source:
@SubscribeEvent(priority=EventPriority.LOWEST) public void onContainerOpen(PlayerOpenContainerEvent e){
  final EntityPlayer player=e.entityPlayer;
  final World world=player.worldObj;
  if (e.canInteractWith && !world.isRemote && player.openContainer != player.inventoryContainer && playerContainerTicks.update(player.getGameProfile().getId())) {
    System.out.println("String_Node_Str");
    for (    Slot slot : (List<Slot>)player.openContainer.inventorySlots) {
      if (slot.getHasStack())       tryDiscover(player,slot.getStack());
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent(priority=EventPriority.LOWEST) public void onContainerOpen(PlayerOpenContainerEvent e){
  final EntityPlayer player=e.entityPlayer;
  final World world=player.worldObj;
  if (e.canInteractWith && !world.isRemote && player.openContainer != player.inventoryContainer && playerContainerTicks.update(player.getGameProfile().getId())) {
    for (    Slot slot : (List<Slot>)player.openContainer.inventorySlots) {
      if (slot.getHasStack())       tryDiscover(player,slot.getStack());
    }
  }
}
Program: 34591
Project: 34591
Buggy source:
private void collideWithEntities(List<? extends Entity> list){
  double bodyCenterX=(dragonPartBody.boundingBox.minX + dragonPartBody.boundingBox.maxX) * 0.5D;
  double bodyCenterZ=(dragonPartBody.boundingBox.minZ + dragonPartBody.boundingBox.maxZ) * 0.5D;
  for (  Entity entity : list) {
    if (entity instanceof EntityLivingBase || entity instanceof EntityBlockFallingObsidian) {
      while (entity.ridingEntity != null)       entity=entity.ridingEntity;
      double[] vec=DragonUtil.getNormalizedVector(entity.posX - bodyCenterX,entity.posZ - bodyCenterZ);
      CollisionEvent event=new CollisionEvent(entity,vec[0] * 2D,0.2D,vec[1] * 2D);
      currentAttack.onCollisionEvent(event);
      event.collidedEntity.motionX=event.velocityX;
      event.collidedEntity.motionY=event.velocityY;
      event.collidedEntity.motionZ=event.velocityZ;
      if (entity instanceof EntityPlayerMP)       PacketPipeline.sendToPlayer((EntityPlayerMP)entity,new C06SetPlayerVelocity(event.velocityX,event.velocityY,event.velocityZ));
    }
  }
}

Fixed version (ground truth):
private void collideWithEntities(List<? extends Entity> list){
  double bodyCenterX=(dragonPartBody.boundingBox.minX + dragonPartBody.boundingBox.maxX) * 0.5D;
  double bodyCenterZ=(dragonPartBody.boundingBox.minZ + dragonPartBody.boundingBox.maxZ) * 0.5D;
  for (  Entity entity : list) {
    if (entity instanceof EntityLivingBase || entity instanceof EntityBlockFallingObsidian) {
      while (entity.ridingEntity != null)       entity=entity.ridingEntity;
      Vec vec=Vec.xz(entity.posX - bodyCenterX,entity.posZ - bodyCenterZ).normalized();
      CollisionEvent event=new CollisionEvent(entity,vec.x * 2D,0.2D,vec.z * 2D);
      currentAttack.onCollisionEvent(event);
      event.collidedEntity.motionX=event.velocityX;
      event.collidedEntity.motionY=event.velocityY;
      event.collidedEntity.motionZ=event.velocityZ;
      if (entity instanceof EntityPlayerMP)       PacketPipeline.sendToPlayer((EntityPlayerMP)entity,new C06SetPlayerVelocity(event.velocityX,event.velocityY,event.velocityZ));
    }
  }
}
Program: 34595
Project: 34595
Buggy source:
public boolean tryPurchaseFragment(KnowledgeFragment fragment){
  if (points >= fragment.getPrice() && unlockFragment(fragment)) {
    offsetPoints(-fragment.getPrice());
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean tryPurchaseFragment(EntityPlayer player,KnowledgeFragment fragment){
  if (points >= fragment.getPrice() && unlockFragment(fragment)) {
    offsetPoints(-fragment.getPrice());
    PacketPipeline.sendToPlayer(player,new C19CompendiumData(this));
    return true;
  }
 else   return false;
}
Program: 34596
Project: 34596
Buggy source:
public boolean tryDiscoverObject(KnowledgeObject<? extends IObjectHolder<?>> obj){
  if (unlockObject(obj)) {
    points+=obj.getReward();
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean tryDiscoverObject(EntityPlayer player,KnowledgeObject<? extends IObjectHolder<?>> obj){
  if (unlockObject(obj)) {
    points+=obj.getReward();
    PacketPipeline.sendToPlayer(player,new C19CompendiumData(this));
    return true;
  }
 else   return false;
}
Program: 34597
Project: 34597
Buggy source:
public boolean unlockObject(KnowledgeObject<? extends IObjectHolder<?>> obj){
  boolean added=discoveredObjects.add(obj);
  if (added)   setModified();
  return added;
}

Fixed version (ground truth):
private boolean unlockObject(KnowledgeObject<? extends IObjectHolder<?>> obj){
  boolean added=discoveredObjects.add(obj);
  if (added)   setModified();
  return added;
}
Program: 34598
Project: 34598
Buggy source:
public boolean unlockFragment(KnowledgeFragment fragment){
  if (fragment.getType() != KnowledgeFragmentType.SECRET || fragment.getType() != KnowledgeFragmentType.HINT)   return false;
  boolean added=extraFragments.add(fragment.globalID);
  if (added)   setModified();
  return added;
}

Fixed version (ground truth):
private boolean unlockFragment(KnowledgeFragment fragment){
  if (fragment.getType() != KnowledgeFragmentType.SECRET || fragment.getType() != KnowledgeFragmentType.HINT)   return false;
  boolean added=extraFragments.add(fragment.globalID);
  if (added)   setModified();
  return added;
}
Program: 34599
Project: 34599
Buggy source:
public boolean tryPurchaseObject(KnowledgeObject<? extends IObjectHolder<?>> obj){
  if (points >= obj.getPrice() && unlockObject(obj)) {
    offsetPoints(-obj.getPrice());
    return true;
  }
 else   return false;
}

Fixed version (ground truth):
public boolean tryPurchaseObject(EntityPlayer player,KnowledgeObject<? extends IObjectHolder<?>> obj){
  if (points >= obj.getPrice() && unlockObject(obj)) {
    offsetPoints(-obj.getPrice());
    PacketPipeline.sendToPlayer(player,new C19CompendiumData(this));
    return true;
  }
 else   return false;
}