nus-yam/ex-repair huggingface dataset:
Program: 17653
Project: 17653
Buggy source:
private String instantiateBindings(List<Binding> bindings,String query){
  String sparql=query;
  for (int i=0; i < bindings.size(); i++) {
    sparql=sparql.replace("String_Node_Str" + pattern.getParameters().get(i).getId() + "String_Node_Str",bindings.get(i).getValue());
  }
  return sparql;
}

Fixed version (ground truth):
private String instantiateBindings(List<Binding> bindings,String query){
  String sparql=query;
  for (  Binding b : bindings) {
    sparql=sparql.replace("String_Node_Str" + b.getParameterId() + "String_Node_Str",b.getValue());
  }
  return sparql;
}
Program: 17655
Project: 17655
Buggy source:
public ItemNaturaEdible(){
  super();
  this.displayEffectsTooltip=false;
  this.displayCustomEffectsTooltip=true;
}

Fixed version (ground truth):
public ItemNaturaEdible(){
  super();
  this.displayEffectsTooltip=false;
  this.displayCustomEffectsTooltip=true;
  itemDuration=new TIntIntHashMap();
}
Program: 17656
Project: 17656
Buggy source:
protected void addShapedRecipeFirst(List<IRecipe> recipeList,ItemStack itemstack,Object... objArray){
  String var3="String_Node_Str";
  int var4=0;
  int var5=0;
  int var6=0;
  if (objArray[var4] instanceof String[]) {
    String[] var7=((String[])objArray[var4++]);
    for (    String var9 : var7) {
      ++var6;
      var5=var9.length();
      var3=var3 + var9;
    }
  }
 else {
    while (objArray[var4] instanceof String) {
      String var11=(String)objArray[var4++];
      ++var6;
      var5=var11.length();
      var3=var3 + var11;
    }
  }
  HashMap var12;
  for (var12=new HashMap(); var4 < objArray.length; var4+=2) {
    Character var13=(Character)objArray[var4];
    ItemStack var14=null;
    if (objArray[var4 + 1] instanceof Item) {
      var14=new ItemStack((Item)objArray[var4 + 1]);
    }
 else     if (objArray[var4 + 1] instanceof Block) {
      var14=new ItemStack((Block)objArray[var4 + 1],1,Short.MAX_VALUE);
    }
 else     if (objArray[var4 + 1] instanceof ItemStack) {
      var14=(ItemStack)objArray[var4 + 1];
    }
    var12.put(var13,var14);
  }
  ItemStack[] var15=new ItemStack[var5 * var6];
  for (int var16=0; var16 < var5 * var6; ++var16) {
    char var10=var3.charAt(var16);
    if (var12.containsKey(Character.valueOf(var10))) {
      var15[var16]=((ItemStack)var12.get(Character.valueOf(var10))).copy();
    }
 else {
      var15[var16]=null;
    }
  }
  ShapedRecipes var17=new ShapedRecipes(var5,var6,var15,itemstack);
  recipeList.add(0,var17);
}

Fixed version (ground truth):
protected void addShapedRecipeFirst(List<IRecipe> recipeList,ItemStack itemstack,Object... objArray){
  String var3="String_Node_Str";
  int var4=0;
  int var5=0;
  int var6=0;
  if (objArray[var4] instanceof String[]) {
    String[] var7=((String[])objArray[var4++]);
    for (    String var9 : var7) {
      ++var6;
      var5=var9.length();
      var3=var3 + var9;
    }
  }
 else {
    while (objArray[var4] instanceof String) {
      String var11=(String)objArray[var4++];
      ++var6;
      var5=var11.length();
      var3=var3 + var11;
    }
  }
  HashMap<Character,ItemStack> var12;
  for (var12=new HashMap<Character,ItemStack>(); var4 < objArray.length; var4+=2) {
    Character var13=(Character)objArray[var4];
    ItemStack var14=null;
    if (objArray[var4 + 1] instanceof Item) {
      var14=new ItemStack((Item)objArray[var4 + 1]);
    }
 else     if (objArray[var4 + 1] instanceof Block) {
      var14=new ItemStack((Block)objArray[var4 + 1],1,Short.MAX_VALUE);
    }
 else     if (objArray[var4 + 1] instanceof ItemStack) {
      var14=(ItemStack)objArray[var4 + 1];
    }
    var12.put(var13,var14);
  }
  ItemStack[] var15=new ItemStack[var5 * var6];
  for (int var16=0; var16 < var5 * var6; ++var16) {
    char var10=var3.charAt(var16);
    if (var12.containsKey(Character.valueOf(var10))) {
      var15[var16]=var12.get(Character.valueOf(var10)).copy();
    }
 else {
      var15[var16]=null;
    }
  }
  ShapedRecipes var17=new ShapedRecipes(var5,var6,var15,itemstack);
  recipeList.add(0,var17);
}
Program: 17657
Project: 17657
Buggy source:
protected void addShapelessRecipeFirst(List<IRecipe> recipeList,ItemStack par1ItemStack,Object... par2ArrayOfObj){
  ArrayList arraylist=new ArrayList();
  Object[] aobject=par2ArrayOfObj;
  int i=par2ArrayOfObj.length;
  for (int j=0; j < i; ++j) {
    Object object1=aobject[j];
    if (object1 instanceof ItemStack) {
      arraylist.add(((ItemStack)object1).copy());
    }
 else     if (object1 instanceof Item) {
      arraylist.add(new ItemStack((Item)object1));
    }
 else {
      if (!(object1 instanceof Block)) {
        throw new RuntimeException("String_Node_Str");
      }
      arraylist.add(new ItemStack((Block)object1));
    }
  }
  recipeList.add(0,new ShapelessRecipes(par1ItemStack,arraylist));
}

Fixed version (ground truth):
protected void addShapelessRecipeFirst(List<IRecipe> recipeList,ItemStack par1ItemStack,Object... par2ArrayOfObj){
  ArrayList<ItemStack> arraylist=new ArrayList<ItemStack>();
  Object[] aobject=par2ArrayOfObj;
  int i=par2ArrayOfObj.length;
  for (int j=0; j < i; ++j) {
    Object object1=aobject[j];
    if (object1 instanceof ItemStack) {
      arraylist.add(((ItemStack)object1).copy());
    }
 else     if (object1 instanceof Item) {
      arraylist.add(new ItemStack((Item)object1));
    }
 else {
      if (!(object1 instanceof Block)) {
        throw new RuntimeException("String_Node_Str");
      }
      arraylist.add(new ItemStack((Block)object1));
    }
  }
  recipeList.add(0,new ShapelessRecipes(par1ItemStack,arraylist));
}
Program: 17658
Project: 17658
Buggy source:
@Override public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,@Nullable ItemStack heldItem,EnumFacing side,float hitX,float hitY,float hitZ){
  int age=state.getValue(AGE).intValue();
  if (age == 3) {
    if (worldIn.isRemote) {
      return true;
    }
    worldIn.setBlockState(pos,this.getDefaultState().withProperty(AGE,Integer.valueOf(2)),2);
    EntityItem entityitem=new EntityItem(worldIn,playerIn.posX,playerIn.posY - 1.0D,playerIn.posZ,this.itemDrop);
    worldIn.spawnEntityInWorld(entityitem);
    if (!(playerIn instanceof FakePlayer)) {
      entityitem.onCollideWithPlayer(playerIn);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onBlockActivated(World worldIn,BlockPos pos,IBlockState state,EntityPlayer playerIn,EnumHand hand,@Nullable ItemStack heldItem,EnumFacing side,float hitX,float hitY,float hitZ){
  int age=state.getValue(AGE).intValue();
  if (age == 3) {
    if (worldIn.isRemote) {
      return true;
    }
    worldIn.setBlockState(pos,this.getDefaultState().withProperty(AGE,Integer.valueOf(2)),2);
    ItemStack itemDrop=new ItemStack(this.itemDrop.getItem(),1,this.itemDrop.getItemDamage());
    EntityItem entityitem=new EntityItem(worldIn,playerIn.posX,playerIn.posY - 1.0D,playerIn.posZ,itemDrop);
    worldIn.spawnEntityInWorld(entityitem);
    if (!(playerIn instanceof FakePlayer)) {
      entityitem.onCollideWithPlayer(playerIn);
    }
    return true;
  }
  return false;
}
Program: 17659
Project: 17659
Buggy source:
@Override public void onBlockClicked(World worldIn,BlockPos pos,EntityPlayer playerIn){
  if (worldIn.isRemote) {
    return;
  }
  int age=worldIn.getBlockState(pos).getValue(AGE).intValue();
  if (age == 3) {
    worldIn.setBlockState(pos,this.getDefaultState().withProperty(AGE,Integer.valueOf(2)),2);
    EntityItem entityitem=new EntityItem(worldIn,playerIn.posX,playerIn.posY - 1.0D,playerIn.posZ,this.itemDrop);
    worldIn.spawnEntityInWorld(entityitem);
    if (!(playerIn instanceof FakePlayer)) {
      entityitem.onCollideWithPlayer(playerIn);
    }
  }
}

Fixed version (ground truth):
@Override public void onBlockClicked(World worldIn,BlockPos pos,EntityPlayer playerIn){
  if (worldIn.isRemote) {
    return;
  }
  int age=worldIn.getBlockState(pos).getValue(AGE).intValue();
  if (age == 3) {
    worldIn.setBlockState(pos,this.getDefaultState().withProperty(AGE,Integer.valueOf(2)),2);
    ItemStack itemDrop=new ItemStack(this.itemDrop.getItem(),1,this.itemDrop.getItemDamage());
    EntityItem entityitem=new EntityItem(worldIn,playerIn.posX,playerIn.posY - 1.0D,playerIn.posZ,itemDrop);
    worldIn.spawnEntityInWorld(entityitem);
    if (!(playerIn instanceof FakePlayer)) {
      entityitem.onCollideWithPlayer(playerIn);
    }
  }
}
Program: 17661
Project: 17661
Buggy source:
public static ResourceLocation getItemLocation(Item item){
  Object o=GameData.getItemRegistry().getNameForObject(item);
  if (o == null) {
    Natura.log.error("String_Node_Str" + item.getUnlocalizedName());
    return null;
  }
  return (ResourceLocation)o;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static ResourceLocation getItemLocation(Item item){
  Object o=GameData.getItemRegistry().getNameForObject(item);
  if (o == null) {
    Natura.log.error("String_Node_Str" + item.getUnlocalizedName());
    return null;
  }
  return (ResourceLocation)o;
}
Program: 17663
Project: 17663
Buggy source:
@Subscribe public void postInit(FMLPostInitializationEvent event){
  GameRegistry.registerWorldGenerator(TreeGenerator.INSTANCE,25);
  proxy.postInit();
}

Fixed version (ground truth):
@Subscribe public void postInit(FMLPostInitializationEvent event){
  GameRegistry.registerWorldGenerator(TreeGenerator.INSTANCE,25);
  GameRegistry.registerWorldGenerator(BerryBushGenerator.INSTANCE,25);
  proxy.postInit();
}
Program: 17664
Project: 17664
Buggy source:
public boolean shouldGenerateInDim(int i){
  return !PHNatura.cloudBlacklist.contains(i);
}

Fixed version (ground truth):
public boolean shouldGenerateInDim(int dim){
  for (  int i : PHNatura.cloudBlacklist) {
    if (dim == i) {
      return false;
    }
  }
  return true;
}
Program: 17665
Project: 17665
Buggy source:
public boolean shouldGenerateSulfurInDim(int i){
  return !PHNatura.sulfurCloudBlacklist.contains(i);
}

Fixed version (ground truth):
public boolean shouldGenerateSulfurInDim(int dim){
  for (  int i : PHNatura.sulfurCloudBlacklist) {
    if (dim == i) {
      return false;
    }
  }
  return true;
}
Program: 17666
Project: 17666
Buggy source:
public boolean shouldGenerateDarkInDim(int i){
  return !PHNatura.darkCloudBlacklist.contains(i);
}

Fixed version (ground truth):
public boolean shouldGenerateDarkInDim(int dim){
  for (  int i : PHNatura.darkCloudBlacklist) {
    if (dim == i) {
      return false;
    }
  }
  return true;
}
Program: 17667
Project: 17667
Buggy source:
public NaturaBow(int damage,String type){
  super();
  this.setMaxDamage(damage);
  this.woodType=type;
  this.setCreativeTab(NaturaTab.tab);
}

Fixed version (ground truth):
public NaturaBow(int damage,String type){
  super();
  this.setMaxDamage(damage);
  this.woodType=type;
  this.setCreativeTab(NaturaTab.tab);
  this.setFull3D();
}
Program: 17668
Project: 17668
Buggy source:
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  ret.add(new ItemStack(this));
  return ret;
}

Fixed version (ground truth):
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> ret=Lists.newArrayList();
  ret.add(new ItemStack(this,1,metadata % 4));
  return ret;
}
Program: 17669
Project: 17669
Buggy source:
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  return (ArrayList<ItemStack>)Arrays.asList(new ItemStack(this));
}

Fixed version (ground truth):
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> ret=new ArrayList<ItemStack>();
  ret.add(new ItemStack(this));
  return ret;
}
Program: 17670
Project: 17670
Buggy source:
@EventHandler public void preInit(FMLPreInitializationEvent evt){
  MinecraftForge.EVENT_BUS.register(this);
  PluginController.getController().registerBuiltins();
  PHNatura.initProps(evt.getSuggestedConfigurationFile());
  NaturaTab.tab=new TabTools("String_Node_Str");
  NaturaTab.woodTab=new TabTools("String_Node_Str");
  NaturaTab.netherTab=new TabTools("String_Node_Str");
  content=new NContent();
  content.preInit();
  content.addOredictSupport();
  NaturaTab.tab.init(new ItemStack(NContent.boneBag,0));
  NaturaTab.woodTab.init(new ItemStack(NContent.floraSapling.getItem(),3));
  NaturaTab.netherTab.init(new ItemStack(NContent.floraSapling.getItem(null,9,0,0),5));
  PluginController.getController().preInit();
}

Fixed version (ground truth):
@EventHandler public void preInit(FMLPreInitializationEvent evt){
  MinecraftForge.EVENT_BUS.register(this);
  PluginController.getController().registerBuiltins();
  PHNatura.initProps(evt.getSuggestedConfigurationFile());
  NaturaTab.tab=new TabTools("String_Node_Str");
  NaturaTab.woodTab=new TabTools("String_Node_Str");
  NaturaTab.netherTab=new TabTools("String_Node_Str");
  content=new NContent();
  content.preInit();
  content.addOredictSupport();
  NaturaTab.tab.init(new ItemStack(NContent.boneBag,0));
  NaturaTab.woodTab.init(new ItemStack(NContent.floraSapling,1,3));
  NaturaTab.netherTab.init(new ItemStack(NContent.floraSapling,1,5));
  PluginController.getController().preInit();
}
Program: 17671
Project: 17671
Buggy source:
/** 
 * Returns the ID of the items to drop on destruction.
 */
@Override public Item getItemDropped(int par1,Random par2Random,int par3){
  return NContent.glowshroom.getItem(null,0,0,0);
}

Fixed version (ground truth):
/** 
 * Returns the ID of the items to drop on destruction.
 */
@Override public Item getItemDropped(int par1,Random par2Random,int par3){
  return Item.getItemFromBlock(NContent.glowshroom);
}
Program: 17672
Project: 17672
Buggy source:
/** 
 * Returns the ID of the items to drop on destruction.
 */
@Override public Item getItemDropped(int p_149650_1_,Random p_149650_2_,int p_149650_3_){
  return NContent.floraSapling.getItem();
}

Fixed version (ground truth):
/** 
 * Returns the ID of the items to drop on destruction.
 */
@Override public Item getItemDropped(int p_149650_1_,Random p_149650_2_,int p_149650_3_){
  return Item.getItemFromBlock(NContent.floraSapling);
}
Program: 17673
Project: 17673
Buggy source:
@Override public Item getItemDropped(int metadata,Random random,int fortune){
  if (metadata % 4 == 2)   return NContent.potashApple;
  return NContent.floraSapling.getItem();
}

Fixed version (ground truth):
@Override public Item getItemDropped(int metadata,Random random,int fortune){
  if (metadata % 4 == 2)   return NContent.potashApple;
  return Item.getItemFromBlock(NContent.floraSapling);
}
Program: 17674
Project: 17674
Buggy source:
@Override public Item getItemDropped(int meta,Random random,int fortune){
  if (meta % 4 == 3)   return NContent.rareSapling.getItem(null,0,0,0);
  return NContent.floraSapling.getItem();
}

Fixed version (ground truth):
@Override public Item getItemDropped(int meta,Random random,int fortune){
  if (meta % 4 == 3)   return Item.getItemFromBlock(NContent.rareSapling);
  return Item.getItemFromBlock(NContent.floraSapling);
}
Program: 17675
Project: 17675
Buggy source:
@Override public Item getItemDropped(int p_149650_1_,Random p_149650_2_,int p_149650_3_){
  return NContent.rareSapling.getItem(null,0,0,0);
}

Fixed version (ground truth):
@Override public Item getItemDropped(int p_149650_1_,Random p_149650_2_,int p_149650_3_){
  return Item.getItemFromBlock(NContent.rareSapling);
}
Program: 17676
Project: 17676
Buggy source:
@Override public void registerRenderer(){
  RenderingRegistry.registerBlockHandler(new BerryRender());
  RenderingRegistry.registerBlockHandler(new SaguaroRenderer());
  RenderingRegistry.registerBlockHandler(new CropRender());
  RenderingRegistry.registerBlockHandler(new FenceRender());
  RenderingRegistry.registerBlockHandler(new HopperRender());
  RenderingRegistry.registerBlockHandler(new LeverRender());
  MinecraftForge.EVENT_BUS.register(new NCropsTickHandler());
  RenderingRegistry.registerEntityRenderingHandler(ImpEntity.class,new ImpRender(new ImpModel(),0f));
  RenderingRegistry.registerEntityRenderingHandler(HeatscarSpider.class,new FlameSpiderRender());
  RenderingRegistry.registerEntityRenderingHandler(NitroCreeper.class,new NitroCreeperRender());
  RenderingRegistry.registerEntityRenderingHandler(FusewoodArrow.class,new FusewoodArrowRender());
  RenderingRegistry.registerEntityRenderingHandler(BabyHeatscarSpider.class,new FlameSpiderBabyRender());
  Minecraft mc=Minecraft.getMinecraft();
  try {
    GrassColorizerAlternate.setBlueGrassBiomeColorizer(TextureUtil.readImageData(mc.getResourceManager(),bluegrass));
    GrassColorizerAlternate.setOrangeGrassBiomeColorizer(TextureUtil.readImageData(mc.getResourceManager(),orangegrass));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void registerRenderer(){
  RenderingRegistry.registerBlockHandler(new BerryRender());
  RenderingRegistry.registerBlockHandler(new SaguaroRenderer());
  RenderingRegistry.registerBlockHandler(new CropRender());
  RenderingRegistry.registerBlockHandler(new FenceRender());
  RenderingRegistry.registerBlockHandler(new HopperRender());
  RenderingRegistry.registerBlockHandler(new LeverRender());
  FMLCommonHandler.instance().bus().register(new NCropsTickHandler());
  RenderingRegistry.registerEntityRenderingHandler(ImpEntity.class,new ImpRender(new ImpModel(),0f));
  RenderingRegistry.registerEntityRenderingHandler(HeatscarSpider.class,new FlameSpiderRender());
  RenderingRegistry.registerEntityRenderingHandler(NitroCreeper.class,new NitroCreeperRender());
  RenderingRegistry.registerEntityRenderingHandler(FusewoodArrow.class,new FusewoodArrowRender());
  RenderingRegistry.registerEntityRenderingHandler(BabyHeatscarSpider.class,new FlameSpiderBabyRender());
  Minecraft mc=Minecraft.getMinecraft();
  try {
    GrassColorizerAlternate.setBlueGrassBiomeColorizer(TextureUtil.readImageData(mc.getResourceManager(),bluegrass));
    GrassColorizerAlternate.setOrangeGrassBiomeColorizer(TextureUtil.readImageData(mc.getResourceManager(),orangegrass));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 17677
Project: 17677
Buggy source:
public void getSubItems(int id,CreativeTabs tab,List list){
switch (armorType) {
case 0:
    list.add(NContent.impHelmetStack.copy());
  break;
case 1:
list.add(NContent.impJerkinStack.copy());
break;
case 2:
list.add(NContent.impLeggingsStack.copy());
break;
case 3:
list.add(NContent.impBootsStack.copy());
break;
}
}

Fixed version (ground truth):
@Override public void getSubItems(Item id,CreativeTabs tab,List list){
switch (armorType) {
case 0:
    list.add(NContent.impHelmetStack.copy());
  break;
case 1:
list.add(NContent.impJerkinStack.copy());
break;
case 2:
list.add(NContent.impLeggingsStack.copy());
break;
case 3:
list.add(NContent.impBootsStack.copy());
break;
}
}
Program: 17678
Project: 17678
Buggy source:
public NLeaves(){
  super();
  this.setTickRandomly(true);
  this.setHardness(0.2F);
  this.setLightOpacity(1);
  this.setStepSound(Block.soundTypeGrass);
  this.setBlockName("String_Node_Str");
  setCreativeTab(CreativeTabs.tabDecorations);
  Blocks.fire.setFireInfo(this,30,60);
  this.setCreativeTab(NaturaTab.tab);
}

Fixed version (ground truth):
public NLeaves(){
  super();
  this.setTickRandomly(true);
  this.setHardness(0.2F);
  this.setLightOpacity(1);
  this.setStepSound(Block.soundTypeGrass);
  this.setBlockName("String_Node_Str");
  setCreativeTab(CreativeTabs.tabDecorations);
  this.setCreativeTab(NaturaTab.tab);
}
Program: 17679
Project: 17679
Buggy source:
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  return (ArrayList<ItemStack>)Arrays.asList(new ItemStack(this));
}

Fixed version (ground truth):
@Override public ArrayList<ItemStack> getDrops(World world,int x,int y,int z,int metadata,int fortune){
  ArrayList<ItemStack> i=Lists.newArrayList();
  i.add(new ItemStack(this));
  return i;
}
Program: 17680
Project: 17680
Buggy source:
public HeatSand(){
  super();
  this.setHardness(3f);
  this.setStepSound(Block.soundTypeSand);
  this.setCreativeTab(NaturaTab.tab);
  MinecraftForge.setBlockHarvestLevel(this,"String_Node_Str",0);
}

Fixed version (ground truth):
public HeatSand(){
  super();
  this.setHardness(3f);
  this.setStepSound(Block.soundTypeSand);
  this.setCreativeTab(NaturaTab.tab);
  this.setHarvestLevel("String_Node_Str",0);
}
Program: 17681
Project: 17681
Buggy source:
public boolean canConnectFenceTo(IBlockAccess par1IBlockAccess,int par2,int par3,int par4){
  Block l=par1IBlockAccess.getBlock(par2,par3,par4);
  if (l != this) {
    if (l == null)     return false;
    if (l.getMaterial().isOpaque() && l.renderAsNormalBlock())     return l.getMaterial() != Material.pumpkin;
    return (l instanceof BlockFenceGate);
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
public boolean canConnectFenceTo(IBlockAccess par1IBlockAccess,int par2,int par3,int par4){
  Block l=par1IBlockAccess.getBlock(par2,par3,par4);
  if (l != this) {
    if (l == null)     return false;
    if (l.getMaterial().isOpaque() && l.renderAsNormalBlock())     return l.getMaterial() != Material.plants;
    return (l instanceof BlockFenceGate);
  }
 else {
    return true;
  }
}
Program: 17682
Project: 17682
Buggy source:
/** 
 * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks and creates a new spawn inside its implementation.
 */
public void updateEntity(){
  boolean flag=this.furnaceBurnTime > 0;
  boolean flag1=false;
  if (this.furnaceBurnTime > 0) {
    --this.furnaceBurnTime;
  }
  if (!this.worldObj.isRemote) {
    if (this.furnaceBurnTime == 0 && this.canSmelt()) {
      this.currentItemBurnTime=this.furnaceBurnTime=getFuelTime(this.inventory[1]) * 2;
      if (this.furnaceBurnTime > 0) {
        flag1=true;
        if (this.inventory[1] != null) {
          --this.inventory[1].stackSize;
          if (this.inventory[1].stackSize == 0) {
            this.inventory[1]=this.inventory[1].getItem().getContainerItemStack(inventory[1]);
          }
        }
      }
    }
    if (this.isBurning() && this.canSmelt()) {
      ++this.furnaceCookTime;
      if (this.furnaceCookTime == 200) {
        this.furnaceCookTime=0;
        this.smeltItem();
        if (!active) {
          this.active=true;
          worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
        }
        flag1=true;
      }
    }
 else {
      this.furnaceCookTime=0;
      if (active) {
        this.active=false;
        worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
      }
    }
    if (flag != this.furnaceBurnTime > 0) {
      flag1=true;
      this.active=true;
      worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
    }
  }
  if (flag1) {
    this.onInventoryChanged();
  }
}

Fixed version (ground truth):
/** 
 * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks and creates a new spawn inside its implementation.
 */
public void updateEntity(){
  boolean flag=this.furnaceBurnTime > 0;
  boolean flag1=false;
  if (this.furnaceBurnTime > 0) {
    --this.furnaceBurnTime;
  }
  if (!this.worldObj.isRemote) {
    if (this.furnaceBurnTime == 0 && this.canSmelt()) {
      this.currentItemBurnTime=this.furnaceBurnTime=getFuelTime(this.inventory[1]) * 2;
      if (this.furnaceBurnTime > 0) {
        flag1=true;
        if (this.inventory[1] != null) {
          --this.inventory[1].stackSize;
          if (this.inventory[1].stackSize == 0) {
            this.inventory[1]=this.inventory[1].getItem().getContainerItem(inventory[1]);
          }
        }
      }
    }
    if (this.isBurning() && this.canSmelt()) {
      ++this.furnaceCookTime;
      if (this.furnaceCookTime == 200) {
        this.furnaceCookTime=0;
        this.smeltItem();
        if (!active) {
          this.active=true;
          worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
        }
        flag1=true;
      }
    }
 else {
      this.furnaceCookTime=0;
      if (active) {
        this.active=false;
        worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
      }
    }
    if (flag != this.furnaceBurnTime > 0) {
      flag1=true;
      this.active=true;
      worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
    }
  }
  if (flag1) {
    this.markDirty();
  }
}
Program: 17683
Project: 17683
Buggy source:
@Override public boolean canSustainLeaves(World world,int x,int y,int z){
  return true;
}

Fixed version (ground truth):
@Override public boolean canSustainLeaves(IBlockAccess world,int x,int y,int z){
  return true;
}
Program: 17684
Project: 17684
Buggy source:
public void onBlockHarvested(World world,int x,int y,int z,int meta,EntityPlayer player){
  if (meta % 4 == 1) {
    if (world.difficultySetting > 2)     world.createExplosion(null,x,y,z,1.75f,false);
 else     world.createExplosion(null,x,y,z,2f,false);
  }
}

Fixed version (ground truth):
public void onBlockHarvested(World world,int x,int y,int z,int meta,EntityPlayer player){
  if (meta % 4 == 1) {
    if (world.difficultySetting.getDifficultyId() > 2)     world.createExplosion(null,x,y,z,1.75f,false);
 else     world.createExplosion(null,x,y,z,2f,false);
  }
}
Program: 17685
Project: 17685
Buggy source:
@Override public boolean isWood(World world,int x,int y,int z){
  return true;
}

Fixed version (ground truth):
@Override public boolean isWood(IBlockAccess world,int x,int y,int z){
  return true;
}
Program: 17686
Project: 17686
Buggy source:
@EventHandler public void init(FMLInitializationEvent evt){
  GameRegistry.registerWorldGenerator(crops=new BaseCropWorldgen());
  GameRegistry.registerWorldGenerator(clouds=new BaseCloudWorldgen());
  GameRegistry.registerWorldGenerator(trees=new BaseTreeWorldgen());
  NaturaTab.init(content.wheatBag);
  proxy.registerRenderer();
  proxy.addNames();
  NetworkRegistry.instance().registerGuiHandler(instance,new NGuiHandler());
  GameRegistry.registerFuelHandler(content);
  if (PHNatura.overrideNether) {
    DimensionManager.unregisterProviderType(-1);
    DimensionManager.registerProviderType(-1,NetheriteWorldProvider.class,true);
  }
  MinecraftForge.EVENT_BUS.register(WorldHandler.instance);
  if (retrogen) {
    TickRegistry.registerTickHandler(new TickHandlerWorld(),Side.SERVER);
  }
  OreDictionary.registerOre("String_Node_Str",new ItemStack(NContent.thornVines));
  random.setSeed(2 ^ 16 + 2 ^ 8 + (4 * 3 * 271));
  PluginController.getController().init();
}

Fixed version (ground truth):
@EventHandler public void init(FMLInitializationEvent evt){
  GameRegistry.registerWorldGenerator(crops=new BaseCropWorldgen(),0);
  GameRegistry.registerWorldGenerator(clouds=new BaseCloudWorldgen(),0);
  GameRegistry.registerWorldGenerator(trees=new BaseTreeWorldgen(),0);
  NaturaTab.init(content.wheatBag);
  proxy.registerRenderer();
  proxy.addNames();
  NetworkRegistry.INSTANCE.registerGuiHandler(instance,new NGuiHandler());
  GameRegistry.registerFuelHandler(content);
  if (PHNatura.overrideNether) {
    DimensionManager.unregisterProviderType(-1);
    DimensionManager.registerProviderType(-1,NetheriteWorldProvider.class,true);
  }
  MinecraftForge.EVENT_BUS.register(WorldHandler.instance);
  if (retrogen) {
    MinecraftForge.EVENT_BUS.register(new TickHandlerWorld());
  }
  OreDictionary.registerOre("String_Node_Str",new ItemStack(NContent.thornVines));
  random.setSeed(2 ^ 16 + 2 ^ 8 + (4 * 3 * 271));
  PluginController.getController().init();
}
Program: 17687
Project: 17687
Buggy source:
@SubscribeEvent public void interactEvent(EntityInteractEvent event){
  if (event.target instanceof EntityCow || event.target instanceof EntitySheep) {
    ItemStack equipped=event.entityPlayer.getCurrentEquippedItem();
    EntityAnimal creature=(EntityAnimal)event.target;
    if (equipped != null && equipped.getItem() == NContent.plantItem && equipped.getItemDamage() == 0 && creature.getGrowingAge() == 0 && creature.inLove <= 0) {
      EntityPlayer player=event.entityPlayer;
      if (!player.capabilities.isCreativeMode) {
        --equipped.stackSize;
        if (equipped.stackSize <= 0) {
          player.inventory.setInventorySlotContents(player.inventory.currentItem,(ItemStack)null);
        }
      }
      creature.inLove=600;
      creature.setTarget(null);
      for (int i=0; i < 7; ++i) {
        double d0=random.nextGaussian() * 0.02D;
        double d1=random.nextGaussian() * 0.02D;
        double d2=random.nextGaussian() * 0.02D;
        creature.worldObj.spawnParticle("String_Node_Str",creature.posX + (double)(random.nextFloat() * creature.width * 2.0F) - (double)creature.width,creature.posY + 0.5D + (double)(random.nextFloat() * creature.height),creature.posZ + (double)(random.nextFloat() * creature.width * 2.0F) - (double)creature.width,d0,d1,d2);
      }
    }
  }
}

Fixed version (ground truth):
@SubscribeEvent public void interactEvent(EntityInteractEvent event){
  if (event.target instanceof EntityCow || event.target instanceof EntitySheep) {
    ItemStack equipped=event.entityPlayer.getCurrentEquippedItem();
    EntityAnimal creature=(EntityAnimal)event.target;
    if (equipped != null && equipped.getItem() == NContent.plantItem && equipped.getItemDamage() == 0 && creature.getGrowingAge() == 0 && creature.isInLove()) {
      EntityPlayer player=event.entityPlayer;
      if (!player.capabilities.isCreativeMode) {
        --equipped.stackSize;
        if (equipped.stackSize <= 0) {
          player.inventory.setInventorySlotContents(player.inventory.currentItem,(ItemStack)null);
        }
      }
      creature.func_146082_f(event.entityPlayer);
      creature.setTarget(null);
      for (int i=0; i < 7; ++i) {
        double d0=random.nextGaussian() * 0.02D;
        double d1=random.nextGaussian() * 0.02D;
        double d2=random.nextGaussian() * 0.02D;
        creature.worldObj.spawnParticle("String_Node_Str",creature.posX + (double)(random.nextFloat() * creature.width * 2.0F) - (double)creature.width,creature.posY + 0.5D + (double)(random.nextFloat() * creature.height),creature.posZ + (double)(random.nextFloat() * creature.width * 2.0F) - (double)creature.width,d0,d1,d2);
      }
    }
  }
}
Program: 17688
Project: 17688
Buggy source:
public FlowerBlock(){
  super(0);
  setCreativeTab(CreativeTabs.tabDecorations);
  this.setStepSound(soundTypeGrass);
}

Fixed version (ground truth):
public FlowerBlock(){
  super(0);
  setCreativeTab(CreativeTabs.tabDecorations);
  this.setStepSound(soundTypeGrass);
  ObfuscationReflectionHelper.setPrivateValue(BlockFlower.class,this,new IIcon[1],"String_Node_Str");
}
Program: 17689
Project: 17689
Buggy source:
@Override public Item getItemDropped(int meta,Random random,int fortune){
  if (meta % 4 == 3)   return NContent.rareSapling.getItem();
  return NContent.floraSapling.getItem();
}

Fixed version (ground truth):
@Override public Item getItemDropped(int meta,Random random,int fortune){
  if (meta % 4 == 3)   return NContent.rareSapling.getItem(null,0,0,0);
  return NContent.floraSapling.getItem();
}
Program: 17690
Project: 17690
Buggy source:
@Override public Item getItemDropped(int p_149650_1_,Random p_149650_2_,int p_149650_3_){
  return NContent.rareSapling.getItem();
}

Fixed version (ground truth):
@Override public Item getItemDropped(int p_149650_1_,Random p_149650_2_,int p_149650_3_){
  return NContent.rareSapling.getItem(null,0,0,0);
}
Program: 17692
Project: 17692
Buggy source:
public boolean generate(World world,Random random,int x,int y,int z){
  int l=random.nextInt(3) - 1;
  int i1=random.nextInt(3) - 1;
  for (int j1=0; j1 < numberOfBlocks; j1++) {
    x+=(random.nextInt(3) - 1) + l;
    z+=(random.nextInt(3) - 1) + i1;
    if (random.nextBoolean() && !flatCloud || flatCloud && random.nextInt(10) == 0) {
      y+=random.nextInt(3) - 1;
    }
    for (int xIter=x; xIter < x + random.nextInt(4) + 3 * (flatCloud ? 3 : 1); xIter++) {
      for (int yIter=y; yIter < y + random.nextInt(1) + 2; yIter++) {
        for (int zIter=z; zIter < z + random.nextInt(4) + 3 * (flatCloud ? 3 : 1); zIter++) {
          if (world.getBlock(xIter,yIter,zIter) == Blocks.air && Math.abs(xIter - x) + Math.abs(yIter - y) + Math.abs(zIter - z) < 4 * (flatCloud ? 3 : 1) + random.nextInt(2)) {
            setBlockAndMetadata(world,xIter,yIter,zIter,bID,meta);
          }
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean generate(World world,Random random,int x,int y,int z){
  int l=random.nextInt(3) - 1;
  int i1=random.nextInt(3) - 1;
  for (int j1=0; j1 < numberOfBlocks; j1++) {
    x+=(random.nextInt(3) - 1) + l;
    z+=(random.nextInt(3) - 1) + i1;
    if (random.nextBoolean() && !flatCloud || flatCloud && random.nextInt(10) == 0) {
      y+=random.nextInt(3) - 1;
    }
    for (int xIter=x; xIter < x + random.nextInt(4) + 3 * (flatCloud ? 3 : 1); xIter++) {
      for (int yIter=y; yIter < y + random.nextInt(1) + 2; yIter++) {
        for (int zIter=z; zIter < z + random.nextInt(4) + 3 * (flatCloud ? 3 : 1); zIter++) {
          if (world.getBlock(xIter,yIter,zIter) == Blocks.air && Math.abs(xIter - x) + Math.abs(yIter - y) + Math.abs(zIter - z) < 4 * (flatCloud ? 3 : 1) + random.nextInt(2)) {
            setBlockAndNotifyAdequately(world,xIter,yIter,zIter,bID,meta);
          }
        }
      }
    }
  }
  return true;
}
Program: 17695
Project: 17695
Buggy source:
@Override public boolean isFlammable(IBlockAccess world,int x,int y,int z,int metadata,ForgeDirection face){
  return true;
}

Fixed version (ground truth):
@Override public boolean isFlammable(IBlockAccess world,int x,int y,int z,ForgeDirection face){
  return true;
}
Program: 17696
Project: 17696
Buggy source:
@Override public int getFlammability(IBlockAccess world,int x,int y,int z,int metadata,ForgeDirection face){
  return 25;
}

Fixed version (ground truth):
@Override public int getFlammability(IBlockAccess world,int x,int y,int z,ForgeDirection face){
  return 25;
}
Program: 17697
Project: 17697
Buggy source:
@Override public int getFireSpreadSpeed(World world,int x,int y,int z,int metadata,ForgeDirection face){
  return 4;
}

Fixed version (ground truth):
@Override public int getFireSpreadSpeed(IBlockAccess world,int x,int y,int z,ForgeDirection face){
  return 4;
}
Program: 17698
Project: 17698
Buggy source:
@Override public int getPlantMetadata(World world,int x,int y,int z){
  int meta=world.getBlockMetadata(x,y,z);
  if (meta < 4)   return 0;
 else   return 4;
}

Fixed version (ground truth):
@Override public int getPlantMetadata(IBlockAccess world,int x,int y,int z){
  int meta=world.getBlockMetadata(x,y,z);
  if (meta < 4)   return 0;
 else   return 4;
}
Program: 17699
Project: 17699
Buggy source:
@Override public EnumPlantType getPlantType(World world,int x,int y,int z){
  return EnumPlantType.Crop;
}

Fixed version (ground truth):
@Override public EnumPlantType getPlantType(IBlockAccess world,int x,int y,int z){
  return EnumPlantType.Crop;
}
Program: 17700
Project: 17700
Buggy source:
/** 
 * Ticks the block if it's been scheduled
 */
public void updateTick(World world,int x,int y,int z,Random random){
  this.checkFlowerChange(world,x,y,z);
  int light=world.getBlockLightValue(x,y,z);
  if (light >= 8) {
    int meta=world.getBlockMetadata(x,y,z);
    if (meta != 3 && meta != 8) {
      float grow=this.getGrowthRate(world,x,y,z,meta,light);
      if (random.nextInt((int)(60.0F / grow) + 1) == 0) {
        meta++;
        world.setBlockMetadataWithNotify(x,y,z,meta,2);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Ticks the block if it's been scheduled
 */
public void updateTick(World world,int x,int y,int z,Random random){
  this.checkAndDropBlock(world,x,y,z);
  int light=world.getBlockLightValue(x,y,z);
  if (light >= 8) {
    int meta=world.getBlockMetadata(x,y,z);
    if (meta != 3 && meta != 8) {
      float grow=this.getGrowthRate(world,x,y,z,meta,light);
      if (random.nextInt((int)(60.0F / grow) + 1) == 0) {
        meta++;
        world.setBlockMetadataWithNotify(x,y,z,meta,2);
      }
    }
  }
}
Program: 17701
Project: 17701
Buggy source:
@Override public int getPlantMetadata(World world,int x,int y,int z){
  return world.getBlockMetadata(x,y,z);
}

Fixed version (ground truth):
@Override public int getPlantMetadata(IBlockAccess world,int x,int y,int z){
  return world.getBlockMetadata(x,y,z);
}
Program: 17702
Project: 17702
Buggy source:
@Override public EnumPlantType getPlantType(World world,int x,int y,int z){
  return EnumPlantType.Cave;
}

Fixed version (ground truth):
@Override public EnumPlantType getPlantType(IBlockAccess world,int x,int y,int z){
  return EnumPlantType.Cave;
}
Program: 17703
Project: 17703
Buggy source:
public void updateTick(World world,int x,int y,int z,Random random){
  this.checkFlowerChange(world,x,y,z);
  int light=world.getBlockLightValue(x,y,z);
  if (light >= 8) {
    int meta=world.getBlockMetadata(x,y,z);
    if (meta % 4 != 3) {
      float grow=this.getGrowthRate(world,x,y,z,meta,light);
      if (random.nextInt((int)(50.0F / grow) + 1) == 0) {
        meta++;
        world.setBlockMetadataWithNotify(x,y,z,meta,2);
      }
    }
  }
}

Fixed version (ground truth):
public void updateTick(World world,int x,int y,int z,Random random){
  this.checkAndDropBlock(world,x,y,z);
  int light=world.getBlockLightValue(x,y,z);
  if (light >= 8) {
    int meta=world.getBlockMetadata(x,y,z);
    if (meta % 4 != 3) {
      float grow=this.getGrowthRate(world,x,y,z,meta,light);
      if (random.nextInt((int)(50.0F / grow) + 1) == 0) {
        meta++;
        world.setBlockMetadataWithNotify(x,y,z,meta,2);
      }
    }
  }
}
Program: 17704
Project: 17704
Buggy source:
/** 
 * Returns the ID of the items to drop on destruction.
 */
public int idDropped(int par1,Random par2Random,int par3){
  return NContent.glowshroom;
}

Fixed version (ground truth):
/** 
 * Returns the ID of the items to drop on destruction.
 */
public int idDropped(int par1,Random par2Random,int par3){
  return Block.getIdFromBlock(NContent.glowshroom);
}
Program: 17705
Project: 17705
Buggy source:
@SideOnly(Side.CLIENT) public int idPicked(World par1World,int par2,int par3,int par4){
  return NContent.glowshroom;
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) public int idPicked(World par1World,int par2,int par3,int par4){
  return Block.getIdFromBlock(NContent.glowshroom);
}
Program: 17706
Project: 17706
Buggy source:
@Override public boolean isFlammable(IBlockAccess world,int x,int y,int z,int metadata,ForgeDirection face){
  return false;
}

Fixed version (ground truth):
@Override public boolean isFlammable(IBlockAccess world,int x,int y,int z,ForgeDirection face){
  return false;
}
Program: 17707
Project: 17707
Buggy source:
@Override public int getFlammability(IBlockAccess world,int x,int y,int z,int metadata,ForgeDirection face){
  return 0;
}

Fixed version (ground truth):
@Override public int getFlammability(IBlockAccess world,int x,int y,int z,ForgeDirection face){
  return 0;
}
Program: 17708
Project: 17708
Buggy source:
@Override public int getFireSpreadSpeed(World world,int x,int y,int z,int metadata,ForgeDirection face){
  return 0;
}

Fixed version (ground truth):
@Override public int getFireSpreadSpeed(IBlockAccess world,int x,int y,int z,ForgeDirection face){
  return 0;
}
Program: 17709
Project: 17709
Buggy source:
public void startMusic(int type,int startTime){
  if (noFocus)   return;
  if (isInactive)   return;
  if (isMusicReady) {
  }
 else {
    loadMusic(type,startTime);
  }
  if (isMusicReady) {
    if (audioCEO.getRingerMode() != AudioManager.RINGER_MODE_NORMAL)     return;
    musicPlayer.start();
  }
}

Fixed version (ground truth):
public void startMusic(int type,int startTime){
  if (noFocus)   return;
  if (isInactive)   return;
  if (isMusicReady) {
  }
 else {
    loadMusic(type,startTime);
  }
  if (isMusicReady) {
    if (audioCEO.getRingerMode() != AudioManager.RINGER_MODE_NORMAL)     return;
    musicPlayer.setVolume(0.01f * PreferenceManager.getDefaultSharedPreferences(host).getInt("String_Node_Str",60),0.01f * PreferenceManager.getDefaultSharedPreferences(host).getInt("String_Node_Str",60));
    musicPlayer.start();
  }
}
Program: 17710
Project: 17710
Buggy source:
public void setAdapter(ArrayList<PieChartData> alPercentage) throws Exception {
  this.alPieCharData=alPercentage;
  iDataSize=alPercentage.size();
  if (rectLegendIcon == null) {
    rectLegendIcon=new RectF[iDataSize];
    for (int i=0; i < iDataSize; i++) {
      if (rectLegendIcon[i] == null) {
        rectLegendIcon[i]=new RectF();
      }
    }
  }
  float fSum=0;
  for (int i=0; i < iDataSize; i++) {
    fSum+=alPercentage.get(i).fPercentage;
  }
  if (fSum != 100) {
    Log.e(TAG,ERROR_NOT_EQUAL_TO_100);
    iDataSize=0;
    throw new Exception(ERROR_NOT_EQUAL_TO_100);
  }
  invalidate();
}

Fixed version (ground truth):
public void setAdapter(ArrayList<PieChartData> alPercentage) throws Exception {
  this.alPieCharData=alPercentage;
  iDataSize=alPercentage.size();
  if (rectLegendIcon == null) {
    rectLegendIcon=new RectF[iDataSize];
    for (int i=0; i < iDataSize; i++) {
      if (rectLegendIcon[i] == null) {
        rectLegendIcon[i]=new RectF();
      }
    }
  }
  float fSum=0;
  for (int i=0; i < iDataSize; i++) {
    fSum+=alPercentage.get(i).fPercentage;
  }
  if (!decimalFormat.format(fSum).equals("String_Node_Str")) {
    Log.e(TAG,ERROR_NOT_EQUAL_TO_100);
    iDataSize=0;
    throw new Exception(ERROR_NOT_EQUAL_TO_100);
  }
  invalidate();
}
Program: 17711
Project: 17711
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  Log.i(TAG,"String_Node_Str");
  for (int i=0; i < iDataSize; i++) {
    if (i >= iColorListSize) {
      paintPieFill.setColor(Color.parseColor(PIE_COLORS[i % iColorListSize]));
    }
 else {
      paintPieFill.setColor(Color.parseColor(PIE_COLORS[i]));
    }
    final PieChartData tmpData=alPieCharData.get(i);
    fEndAngle=tmpData.fPercentage;
    if (bIsShowLegend) {
      canvas.drawRect(rectLegendIcon[i],paintPieFill);
      canvas.drawText(String.format("String_Node_Str",tmpData.strTitle,fEndAngle),fLegendLeft + fnGetRealPxFromDp(15),iDisplayHeight - fLegendIconSize * (6 - i) - fMargin * (6 - i),paintText);
    }
    fEndAngle=fEndAngle / 100 * DEGREE_360;
    if (iSelectedIndex == i) {
      canvas.save(Canvas.MATRIX_SAVE_FLAG);
      float fAngle=fStartAngle + fEndAngle / 2;
      double dxRadius=Math.toRadians((fAngle + DEGREE_360) % DEGREE_360);
      float fY=(float)Math.sin(dxRadius);
      float fX=(float)Math.cos(dxRadius);
      canvas.translate(fX * iShift,fY * iShift);
    }
    canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieFill);
    if (iSelectedIndex == i) {
      canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieBorder);
      canvas.restore();
    }
    fStartAngle=fStartAngle + fEndAngle;
  }
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  Log.i(TAG,"String_Node_Str");
  if (bIsShowLegend) {
    for (int i=0; i < iDataSize; i++) {
      setColor(i);
      final PieChartData tmpData=alPieCharData.get(i);
      final float fEndAngle=alPieCharData.get(i).fPercentage;
      canvas.drawRect(rectLegendIcon[i],paintPieFill);
      canvas.drawText(String.format("String_Node_Str",tmpData.strTitle,fEndAngle),fLegendLeft + fnGetRealPxFromDp(15),iDisplayHeight - fLegendIconSize * (6 - i) - fMargin * (6 - i),paintText);
    }
  }
  for (int i=0; i < iDataSize; i++) {
    final PieChartData tmpData=alPieCharData.get(i);
    final float fEndAngle=tmpData.fPercentage / 100 * DEGREE_360;
    float fStartAngle=0.0f;
    if (iSelectedIndex == i) {
      canvas.save(Canvas.MATRIX_SAVE_FLAG);
      float fAngle=fStartAngle + fEndAngle / 2;
      double dxRadius=Math.toRadians((fAngle + DEGREE_360) % DEGREE_360);
      float fY=(float)Math.sin(dxRadius);
      float fX=(float)Math.cos(dxRadius);
      canvas.translate(fX * iShift,fY * iShift);
    }
    setColor(i);
    canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieFill);
    if (iSelectedIndex == i) {
      canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieBorder);
      canvas.restore();
    }
    fStartAngle=fStartAngle + fEndAngle;
  }
}
Program: 17712
Project: 17712
Buggy source:
public void setAdapter(ArrayList<Float> alPercentage) throws Exception {
  this.alPercentage=alPercentage;
  iDataSize=alPercentage.size();
  int iSum=0;
  for (int i=0; i < iDataSize; i++) {
    iSum+=alPercentage.get(i);
  }
  if (iSum != 100) {
    Log.e(TAG,"String_Node_Str");
    iDataSize=0;
    throw new Exception();
  }
}

Fixed version (ground truth):
public void setAdapter(ArrayList<Float> alPercentage) throws Exception {
  this.alPercentage=alPercentage;
  iDataSize=alPercentage.size();
  float fSum=0;
  for (int i=0; i < iDataSize; i++) {
    fSum+=alPercentage.get(i);
  }
  if (fSum != 100) {
    Log.e(TAG,"String_Node_Str");
    iDataSize=0;
    throw new Exception();
  }
}
Program: 17713
Project: 17713
Buggy source:
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  Log.i(TAG,"String_Node_Str");
  if (bIsShowLegend) {
    for (int i=0; i < iDataSize; i++) {
      setColor(i);
      final PieChartData tmpData=alPieCharData.get(i);
      final float fEndAngle=alPieCharData.get(i).fPercentage;
      canvas.drawRect(rectLegendIcon[i],paintPieFill);
      canvas.drawText(String.format("String_Node_Str",tmpData.strTitle,fEndAngle),fLegendLeft + fnGetRealPxFromDp(15),iDisplayHeight - fLegendIconSize * (6 - i) - fMargin * (6 - i),paintText);
    }
  }
  for (int i=0; i < iDataSize; i++) {
    final PieChartData tmpData=alPieCharData.get(i);
    final float fEndAngle=tmpData.fPercentage / 100 * DEGREE_360;
    float fStartAngle=0.0f;
    if (iSelectedIndex == i) {
      canvas.save(Canvas.MATRIX_SAVE_FLAG);
      float fAngle=fStartAngle + fEndAngle / 2;
      double dxRadius=Math.toRadians((fAngle + DEGREE_360) % DEGREE_360);
      float fY=(float)Math.sin(dxRadius);
      float fX=(float)Math.cos(dxRadius);
      canvas.translate(fX * iShift,fY * iShift);
    }
    setColor(i);
    canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieFill);
    if (iSelectedIndex == i) {
      canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieBorder);
      canvas.restore();
    }
    fStartAngle=fStartAngle + fEndAngle;
  }
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  Log.i(TAG,"String_Node_Str");
  if (bIsShowLegend) {
    for (int i=0; i < iDataSize; i++) {
      setColor(i);
      final PieChartData tmpData=alPieCharData.get(i);
      final float fEndAngle=alPieCharData.get(i).fPercentage;
      canvas.drawRect(rectLegendIcon[i],paintPieFill);
      canvas.drawText(String.format("String_Node_Str",tmpData.strTitle,fEndAngle),fLegendLeft + fnGetRealPxFromDp(15),iDisplayHeight - fLegendIconSize * (6 - i) - fMargin * (6 - i),paintText);
    }
  }
  float fStartAngle=0.0f;
  for (int i=0; i < iDataSize; i++) {
    final PieChartData tmpData=alPieCharData.get(i);
    final float fEndAngle=tmpData.fPercentage / 100 * DEGREE_360;
    if (iSelectedIndex == i) {
      canvas.save(Canvas.MATRIX_SAVE_FLAG);
      float fAngle=fStartAngle + fEndAngle / 2;
      double dxRadius=Math.toRadians((fAngle + DEGREE_360) % DEGREE_360);
      float fY=(float)Math.sin(dxRadius);
      float fX=(float)Math.cos(dxRadius);
      canvas.translate(fX * iShift,fY * iShift);
    }
    setColor(i);
    canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieFill);
    if (iSelectedIndex == i) {
      canvas.drawArc(rectPie,fStartAngle,fEndAngle,true,paintPieBorder);
      canvas.restore();
    }
    fStartAngle=fStartAngle + fEndAngle;
  }
}
Program: 17714
Project: 17714
Buggy source:
public TProtocol getProtocol(TTransport transport){
  return (transport instanceof TMemoryInputTransport) ? new TBinaryProtocol((TMemoryInputTransport)transport,strictRead_,strictWrite_) : super.getProtocol(transport);
}

Fixed version (ground truth):
public TProtocol getProtocol(TTransport transport){
  return (transport instanceof TMemoryInputTransport) ? new TBinaryProtocol((TMemoryInputTransport)transport,strictRead_,strictWrite_) : new ExtendedTBinaryProtocol(transport);
}