nus-yam/ex-repair huggingface dataset:
Program: 174463
Project: 174463
Buggy source:
@GetMapping public String join(@PathVariable String openid){
  if (joinService.submitted(openid)) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@GetMapping public String join(@PathVariable String openid){
  Optional<ApplicationForm> applicationForm=joinService.queryForm(openid);
  if (applicationForm.isPresent() && applicationForm.get().getName() != null) {
    return "String_Node_Str";
  }
  return "String_Node_Str";
}
Program: 174464
Project: 174464
Buggy source:
@PostMapping("String_Node_Str") public String onMessageReceived(@RequestBody String data){
  EventMessage eventMessage=XMLConverUtil.convertToObject(EventMessage.class,data);
  if (eventMessage.getEvent() != null && eventMessage.getEvent().equals("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  if (eventMessage.getContent().contains("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
 else   if (eventMessage.getContent().contains("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
}

Fixed version (ground truth):
@PostMapping("String_Node_Str") public String onMessageReceived(@RequestBody String data){
  EventMessage eventMessage=XMLConverUtil.convertToObject(EventMessage.class,data);
  if (eventMessage.getEvent() != null && eventMessage.getEvent().equals("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  if (eventMessage.getContent().contains("String_Node_Str")) {
    String openid=eventMessage.getFromUserName();
    wechatService.saveOpenid(openid);
    XMLNewsMessage.Article t=new XMLNewsMessage.Article();
    t.setDescription("String_Node_Str");
    t.setPicurl("String_Node_Str");
    t.setTitle("String_Node_Str");
    t.setUrl("String_Node_Str" + eventMessage.getFromUserName());
    XMLNewsMessage xmlNewsMessage=new XMLNewsMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),Collections.singletonList(t));
    return xmlNewsMessage.toXML();
  }
 else   if (eventMessage.getContent().contains("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
}
Program: 174465
Project: 174465
Buggy source:
@Override public void submit(ApplicationForm applicationForm){
  applicationFormDAO.addForm(applicationForm);
}

Fixed version (ground truth):
@Override public void submit(ApplicationForm applicationForm){
  applicationFormDAO.updateForm(applicationForm);
}
Program: 174466
Project: 174466
Buggy source:
public WechatServiceImpl(@Value("String_Node_Str") String token){
  this.token=token;
}

Fixed version (ground truth):
@Autowired public WechatServiceImpl(ApplicationFormDAO applicationFormDAO,@Value("String_Node_Str") String token){
  this.applicationFormDAO=applicationFormDAO;
  this.token=token;
}
Program: 174467
Project: 174467
Buggy source:
@PostMapping("String_Node_Str") public String onMessageReceived(@RequestBody String data){
  EventMessage eventMessage=XMLConverUtil.convertToObject(EventMessage.class,data);
  if (eventMessage.getEvent().equals("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  if (eventMessage.getContent().contains("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
 else   if (eventMessage.getContent().contains("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
}

Fixed version (ground truth):
@PostMapping("String_Node_Str") public String onMessageReceived(@RequestBody String data){
  EventMessage eventMessage=XMLConverUtil.convertToObject(EventMessage.class,data);
  if (eventMessage.getEvent() != null && eventMessage.getEvent().equals("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  if (eventMessage.getContent().contains("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
 else   if (eventMessage.getContent().contains("String_Node_Str")) {
    return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
  }
  return new XMLTextMessage(eventMessage.getFromUserName(),eventMessage.getToUserName(),"String_Node_Str").toXML();
}
Program: 174468
Project: 174468
Buggy source:
@Override public void saveOpenid(String openid){
  ApplicationForm applicationForm=new ApplicationForm();
  applicationForm.setOpenid(openid);
  applicationFormDAO.addForm(applicationForm);
}

Fixed version (ground truth):
@Override public void saveOpenid(String openid){
  if (!applicationFormDAO.queryByOpenid(openid).isPresent()) {
    ApplicationForm applicationForm=new ApplicationForm();
    applicationForm.setOpenid(openid);
    applicationFormDAO.addForm(applicationForm);
  }
}
Program: 174469
Project: 174469
Buggy source:
private void renderHeldItem(EntityRuby entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((flag ? -1 : 1) / 16.0F,0.125F,-0.5F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}

Fixed version (ground truth):
private void renderHeldItem(EntityRuby entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
    boolean flag=handSide == EnumHandSide.LEFT;
    GlStateManager.translate((float)(flag ? -1 : 1) / 16F,0.125F,-0.5F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
    GlStateManager.popMatrix();
  }
}
Program: 174470
Project: 174470
Buggy source:
public void doRenderLayer(EntityRuby entitylivingbaseIn,float limbSwing,float limbSwingAmount,float partialTicks,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  boolean flag=entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT;
  ItemStack mainHand=flag ? entitylivingbaseIn.getHeldItemOffhand() : entitylivingbaseIn.getHeldItemMainhand();
  ItemStack offHand=flag ? entitylivingbaseIn.getHeldItemMainhand() : entitylivingbaseIn.getHeldItemOffhand();
  if (!mainHand.isEmpty() || !offHand.isEmpty()) {
    GlStateManager.pushMatrix();
    this.renderHeldItem(entitylivingbaseIn,mainHand,ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND,EnumHandSide.RIGHT);
    this.renderHeldItem(entitylivingbaseIn,offHand,ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND,EnumHandSide.LEFT);
    GlStateManager.popMatrix();
  }
}

Fixed version (ground truth):
public void doRenderLayer(EntityRuby entitylivingbaseIn,float limbSwing,float limbSwingAmount,float partialTicks,float ageInTicks,float netHeadYaw,float headPitch,float scale){
  boolean flag=entitylivingbaseIn.getPrimaryHand() == EnumHandSide.LEFT;
  ItemStack mainHand=flag ? entitylivingbaseIn.getHeldItemOffhand() : entitylivingbaseIn.getHeldItemMainhand();
  ItemStack offHand=flag ? entitylivingbaseIn.getHeldItemMainhand() : entitylivingbaseIn.getHeldItemOffhand();
  if (!mainHand.isEmpty() || !offHand.isEmpty()) {
    GlStateManager.pushMatrix();
    this.renderHeldItem(entitylivingbaseIn,mainHand,ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND,EnumHandSide.RIGHT);
    this.renderHeldItem(entitylivingbaseIn,offHand,ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND,EnumHandSide.LEFT);
    GlStateManager.popMatrix();
  }
}
Program: 174472
Project: 174472
Buggy source:
public void onInventoryChanged(IInventory inventory){
  ItemStack firstItem=this.gemStorage.getStackInSlot(0);
  this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND,firstItem);
}

Fixed version (ground truth):
public void onInventoryChanged(IInventory inventory){
  ItemStack firstItem=this.gemStorage.getStackInSlot(0);
  this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,firstItem);
}
Program: 174473
Project: 174473
Buggy source:
public RenderAquamarine(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelAquamarine(),0.25F);
  this.addLayer(new LayerAquamarineItem(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}

Fixed version (ground truth):
public RenderAquamarine(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelAquamarine(),0.25F);
  this.addLayer(new LayerAquamarineItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerHair(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}
Program: 174474
Project: 174474
Buggy source:
public RenderBismuth(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelBismuth(),0.25F);
  this.addLayer(new LayerBismuthItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerNoDyeOverlay(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}

Fixed version (ground truth):
public RenderBismuth(){
  super(Minecraft.getMinecraft().getRenderManager(),new ModelBismuth(),0.25F);
  this.addLayer(new LayerBismuthItem(this));
  this.addLayer(new LayerSkin(this));
  this.addLayer(new LayerUniform(this));
  this.addLayer(new LayerNoDyeOverlay(this));
  this.addLayer(new LayerVisor(this));
  this.addLayer(new LayerInsignia(this));
  this.addLayer(new LayerGemPlacement(this));
  if (KAGIC.isBirthday()) {
    this.addLayer(new LayerBirthdayHat(this));
  }
 else   if (KAGIC.isHalloween()) {
    this.addLayer(new LayerWitchHat(this));
  }
 else   if (KAGIC.isChristmas()) {
    this.addLayer(new LayerSantaHat(this));
  }
}
Program: 174475
Project: 174475
Buggy source:
private void renderHeldItem(EntityLivingBase entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    GlStateManager.pushMatrix();
    if (entity.isSneaking()) {
      GlStateManager.translate(0.0F,0.2F,0.0F);
    }
    this.setSide(handSide);
    GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
    GlStateManager.rotate(90.0F,0.0F,1.0F,0.0F);
    GlStateManager.rotate(210.0F,0.0F,0.0F,1.0F);
    boolean lefty=handSide == EnumHandSide.LEFT;
    GlStateManager.translate(0.725F,-0.7,lefty ? .5F : 0.0F);
    Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,lefty);
    GlStateManager.popMatrix();
  }
}

Fixed version (ground truth):
private void renderHeldItem(EntityLivingBase entity,ItemStack stack,ItemCameraTransforms.TransformType camera,EnumHandSide handSide){
  if (!stack.isEmpty()) {
    if (stack.getItem() instanceof ItemEnchantedBook) {
      GlStateManager.pushMatrix();
      if (entity.isSneaking()) {
        GlStateManager.translate(0.0F,0.2F,0.0F);
      }
      this.setSide(handSide);
      GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
      GlStateManager.rotate(90.0F,0.0F,1.0F,0.0F);
      GlStateManager.rotate(210.0F,0.0F,0.0F,1.0F);
      boolean lefty=handSide == EnumHandSide.LEFT;
      GlStateManager.translate(0.725F,-0.7,lefty ? .5F : 0.0F);
      Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,lefty);
      GlStateManager.popMatrix();
    }
 else {
      GlStateManager.pushMatrix();
      if (entity.isSneaking()) {
        GlStateManager.translate(0.0F,0.2F,0.0F);
      }
      this.setSide(handSide);
      GlStateManager.rotate(-90.0F,1.0F,0.0F,0.0F);
      GlStateManager.rotate(180.0F,0.0F,1.0F,0.0F);
      boolean flag=handSide == EnumHandSide.LEFT;
      GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F,0.125F,-0.7F);
      Minecraft.getMinecraft().getItemRenderer().renderItemSide(entity,stack,camera,flag);
      GlStateManager.popMatrix();
    }
  }
}
Program: 174476
Project: 174476
Buggy source:
@Override public boolean spokenTo(EntityPlayer player,String message){
  player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
  return false;
}

Fixed version (ground truth):
@Override public boolean spokenTo(EntityPlayer player,String message){
  return false;
}
Program: 174477
Project: 174477
Buggy source:
public boolean shouldExecute(){
  if (this.gem.killsPlayers) {
    List<EntityLivingBase> list=this.gem.world.<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class,this.gem.getEntityBoundingBox().grow(24.0D,8.0D,24.0D));
    double distance=Double.MAX_VALUE;
    for (    EntityLivingBase possibleTarget : list) {
      boolean canFight=false;
      if (this.gem != possibleTarget) {
        if (possibleTarget instanceof EntityGem) {
          canFight=!this.gem.isOwnedBySamePeople(((EntityGem)possibleTarget)) && ((EntityGem)possibleTarget).isTamed();
        }
 else         if (possibleTarget instanceof EntityPlayer) {
          canFight=!this.gem.isOwnedBy(possibleTarget);
        }
        if (canFight) {
          double newDistance=this.gem.getDistanceSq(possibleTarget);
          if (newDistance <= distance) {
            distance=newDistance;
            this.target=possibleTarget;
          }
        }
      }
    }
    return this.target != null;
  }
  return false;
}

Fixed version (ground truth):
public boolean shouldExecute(){
  if (this.gem.killsPlayers) {
    List<EntityLivingBase> list=this.gem.world.<EntityLivingBase>getEntitiesWithinAABB(EntityLivingBase.class,this.gem.getEntityBoundingBox().grow(24.0D,8.0D,24.0D));
    double distance=Double.MAX_VALUE;
    for (    EntityLivingBase possibleTarget : list) {
      boolean canFight=false;
      if (this.gem != possibleTarget) {
        if (possibleTarget instanceof EntityGem) {
          canFight=!this.gem.isOwnedBySamePeople(((EntityGem)possibleTarget)) && ((EntityGem)possibleTarget).isTamed();
        }
 else         if (possibleTarget instanceof EntityPlayer) {
          canFight=!this.gem.isOwnedBy(possibleTarget);
        }
        canFight=canFight && this.gem != possibleTarget;
        if (canFight) {
          double newDistance=this.gem.getDistanceSq(possibleTarget);
          if (newDistance <= distance) {
            distance=newDistance;
            this.target=possibleTarget;
          }
        }
      }
    }
    return this.target != null;
  }
  return false;
}
Program: 174478
Project: 174478
Buggy source:
public EntityBismuth(World worldIn){
  super(worldIn);
  this.nativeColor=10;
  this.isImmuneToFire=true;
  this.initGemStorage();
  this.setSize(0.9F,2.3F);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BACK_OF_HEAD);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BACK);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.CHEST);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BELLY);
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(1,new EntityAIFollowDiamond(this,1.0D));
  this.tasks.addTask(1,new EntityAICommandGems(this,0.6D));
  this.tasks.addTask(2,new EntityAIRestrictOpenDoor(this));
  this.tasks.addTask(3,new EntityAIMoveTowardsTarget(this,0.414D,32.0F));
  this.tasks.addTask(3,new EntityAIAttackMelee(this,1.0d,true));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityPlayer.class,16.0F));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityMob.class,16.0F));
  this.tasks.addTask(5,new EntityAIStandGuard(this,0.6D));
  this.tasks.addTask(6,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIHurtByTarget(this,false,new Class[0]));
  this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(200.0D);
  this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(8.0D);
  this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D);
  this.droppedGemItem=ModItems.BISMUTH_GEM;
  this.droppedCrackedGemItem=ModItems.CRACKED_BISMUTH_GEM;
}

Fixed version (ground truth):
public EntityBismuth(World worldIn){
  super(worldIn);
  this.nativeColor=7;
  this.isImmuneToFire=true;
  this.initGemStorage();
  this.setSize(0.9F,2.3F);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BACK_OF_HEAD);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BACK);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.CHEST);
  this.setCutPlacement(GemCuts.BISMUTH,GemPlacements.BELLY);
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(1,new EntityAIFollowDiamond(this,1.0D));
  this.tasks.addTask(1,new EntityAICommandGems(this,0.6D));
  this.tasks.addTask(2,new EntityAIRestrictOpenDoor(this));
  this.tasks.addTask(3,new EntityAIMoveTowardsTarget(this,0.414D,32.0F));
  this.tasks.addTask(3,new EntityAIAttackMelee(this,1.0d,true));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityPlayer.class,16.0F));
  this.tasks.addTask(4,new EntityAIWatchClosest(this,EntityMob.class,16.0F));
  this.tasks.addTask(5,new EntityAIStandGuard(this,0.6D));
  this.tasks.addTask(6,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIHurtByTarget(this,false,new Class[0]));
  this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(200.0D);
  this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(8.0D);
  this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.4D);
  this.droppedGemItem=ModItems.BISMUTH_GEM;
  this.droppedCrackedGemItem=ModItems.CRACKED_BISMUTH_GEM;
}
Program: 174479
Project: 174479
Buggy source:
/** 
 * Methods related to combat.                            
 */
public boolean attackEntityFrom(DamageSource source,float amount){
  if (!this.world.isRemote) {
    if (source.getTrueSource() instanceof EntityLivingBase && !this.isOwner((EntityLivingBase)source.getTrueSource())) {
      if (source.isMagicDamage()) {
        this.setAnger(this.getAnger() + 4 + (int)(amount / 2));
      }
 else {
        this.setAnger(this.getAnger() + 1 + (int)(amount / 4));
      }
    }
 else     if (source.isProjectile()) {
      this.setAnger(this.getAnger() + 2 + (int)(amount / 3));
    }
    if (this.isDefective()) {
      this.entityDropItem(this.getHeldItem(EnumHand.MAIN_HAND),0.0F);
      this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,ItemStack.EMPTY);
    }
  }
  return super.attackEntityFrom(source,amount);
}

Fixed version (ground truth):
/** 
 * Methods related to combat.                            
 */
public boolean attackEntityFrom(DamageSource source,float amount){
  if (!this.world.isRemote) {
    if (source.getTrueSource() instanceof EntityLivingBase && !this.isOwner((EntityLivingBase)source.getTrueSource())) {
      if (source.isMagicDamage()) {
        this.setAnger(this.getAnger() + 4 + (int)(amount / 2));
      }
 else {
        this.setAnger(this.getAnger() + 1 + (int)(amount / 4));
      }
    }
 else     if (source.isProjectile()) {
      this.setAnger(this.getAnger() + 2 + (int)(amount / 3));
    }
    if (this.isDefective() && this.ticksExisted < 20) {
      this.entityDropItem(this.getHeldItem(EnumHand.MAIN_HAND),0.0F);
      this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,ItemStack.EMPTY);
    }
  }
  return super.attackEntityFrom(source,amount);
}
Program: 174480
Project: 174480
Buggy source:
public void fall(float distance,float damageMultiplier){
  if (this.isDefective()) {
    this.entityDropItem(this.getHeldItem(EnumHand.MAIN_HAND),0.0F);
    this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,ItemStack.EMPTY);
  }
  super.fall(distance,damageMultiplier);
}

Fixed version (ground truth):
public void fall(float distance,float damageMultiplier){
  if (this.isDefective() && this.ticksExisted < 20) {
    this.entityDropItem(this.getHeldItem(EnumHand.MAIN_HAND),0.0F);
    this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,ItemStack.EMPTY);
  }
  super.fall(distance,damageMultiplier);
}
Program: 174481
Project: 174481
Buggy source:
public void jump(){
  if (this.isDefective() && !this.world.isRemote) {
    this.entityDropItem(this.getHeldItem(EnumHand.MAIN_HAND),0.0F);
    this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,ItemStack.EMPTY);
  }
  super.jump();
}

Fixed version (ground truth):
public void jump(){
  if (this.isDefective() && !this.world.isRemote && this.ticksExisted < 20) {
    this.entityDropItem(this.getHeldItem(EnumHand.MAIN_HAND),0.0F);
    this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,ItemStack.EMPTY);
  }
  super.jump();
}
Program: 174482
Project: 174482
Buggy source:
@Override public void itemDataToGemData(int data){
  this.setSpecial(data);
  this.setCustomNameTag(new TextComponentTranslation("String_Node_Str" + this.getSpecial() + "String_Node_Str").getUnformattedComponentText());
  this.setHairColor(this.getSkinColor());
  this.setSkinColor(this.generateSkinColor());
  this.setGemColor(this.generateGemColor());
  if (data == 16) {
    this.setCustomNameTag(new TextComponentTranslation("String_Node_Str").getUnformattedComponentText());
    this.setHairColor(0xF9D5BD);
    this.setUniformColor(1);
    this.nativeColor=1;
    this.setInsigniaColor(1);
  }
 else {
    this.setUniformColor(data);
    this.nativeColor=data;
    this.setInsigniaColor(data);
  }
}

Fixed version (ground truth):
@Override public void itemDataToGemData(int data){
  this.setSpecial(data);
  if (data == 16) {
    this.setCustomNameTag(new TextComponentTranslation("String_Node_Str").getUnformattedComponentText());
    this.setHairColor(0xF9D5BD);
    this.setSkinColor(this.generateSkinColor());
    this.setGemColor(this.generateGemColor());
    this.setUniformColor(1);
    this.nativeColor=1;
    this.setInsigniaColor(1);
  }
 else {
    this.setCustomNameTag(new TextComponentTranslation("String_Node_Str" + this.getSpecial() + "String_Node_Str").getUnformattedComponentText());
    this.setHairColor(data == 11 ? 0xB9F5FC : this.getSkinColor());
    this.setSkinColor(this.generateSkinColor());
    this.setGemColor(this.generateGemColor());
    this.setUniformColor(data);
    this.nativeColor=data;
    this.setInsigniaColor(data);
  }
}
Program: 174483
Project: 174483
Buggy source:
/** 
 * Methods related to rendering.                         
 */
@Override protected int generateSkinColor(){
  int colorIndex=this.getSpecial();
  int colorValue=0;
  if (this.getSpecial() < 16) {
    EnumDyeColor color=EnumDyeColor.values()[colorIndex];
    try {
      colorValue=ReflectionHelper.getPrivateValue(EnumDyeColor.class,color,"String_Node_Str","String_Node_Str","String_Node_Str");
    }
 catch (    Exception e) {
    }
  }
 else {
    colorValue=0xFF8D32;
  }
  return colorValue;
}

Fixed version (ground truth):
/** 
 * Methods related to rendering.                         
 */
@Override protected int generateSkinColor(){
  int colorIndex=this.getSpecial();
  int colorValue=0;
  if (this.getSpecial() == 11) {
    colorValue=0x7298EB;
  }
 else   if (this.getSpecial() < 16) {
    EnumDyeColor color=EnumDyeColor.values()[colorIndex];
    try {
      colorValue=ReflectionHelper.getPrivateValue(EnumDyeColor.class,color,"String_Node_Str","String_Node_Str","String_Node_Str");
    }
 catch (    Exception e) {
    }
  }
 else {
    colorValue=0xFF8D32;
  }
  return colorValue;
}
Program: 174484
Project: 174484
Buggy source:
@Override protected int generateGemColor(){
switch (this.getSpecial()) {
case 0:
    return 0xFFFFFF;
case 1:
  return 0xCB7226;
case 2:
return 0xAE48D4;
case 3:
return 0x215493;
case 4:
return 0xFEFE4C;
case 5:
return 0x469300;
case 6:
return 0xE8759B;
case 7:
return 0x939393;
case 8:
return 0x8F8F8F;
case 9:
return 0x6699B3;
case 10:
return 0x7B3BAE;
case 11:
return 0x3B54BA;
case 12:
return 0x4E341B;
case 13:
return 0x4C6519;
case 14:
return 0x963030;
case 15:
return 0x333333;
}
return 0xDE7565;
}

Fixed version (ground truth):
@Override protected int generateGemColor(){
switch (this.getSpecial()) {
case 0:
    return 0xFFFFFF;
case 4:
  return 0xFEFE4C;
case 6:
return 0xE8759B;
case 10:
return 0x7B3BAE;
case 11:
return 0x3B54BA;
case 13:
return 0x4C6519;
case 15:
return 0x333333;
}
return 0xDE7565;
}
Program: 174485
Project: 174485
Buggy source:
@Override public boolean spokenTo(EntityPlayer player,String message){
  player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
  return false;
}

Fixed version (ground truth):
@Override public boolean spokenTo(EntityPlayer player,String message){
  return false;
}
Program: 174486
Project: 174486
Buggy source:
public boolean apply(EntityLiving input){
  return input != null && !(input instanceof EntityShardFusion);
}

Fixed version (ground truth):
public boolean apply(EntityLivingBase input){
  return input != null && !(input instanceof EntityShardFusion);
}
Program: 174487
Project: 174487
Buggy source:
public EntityShardFusion(World world){
  super(world);
  this.isImmuneToFire=true;
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(2,new EntityAIMoveTowardsTarget(this,0.414D,32.0F));
  this.tasks.addTask(3,new EntityAIMoveTowardsRestriction(this,1.0D));
  this.tasks.addTask(5,new EntityAIStandGuard(this,0.6D));
  this.tasks.addTask(6,new EntityAIWatchClosest(this,EntityPlayer.class,16.0F));
  this.tasks.addTask(6,new EntityAIWatchClosest(this,EntityMob.class,16.0F));
  this.tasks.addTask(7,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIDiamondHurtByTarget(this));
  this.targetTasks.addTask(2,new EntityAIDiamondHurtTarget(this));
  this.targetTasks.addTask(3,new EntityAIHurtByTarget(this,false,new Class[0]));
  this.targetTasks.addTask(4,new EntityAINearestAttackableTarget<EntityLiving>(this,EntityLiving.class,10,true,false,new Predicate<EntityLiving>(){
    public boolean apply(    EntityLiving input){
      return input != null && !(input instanceof EntityShardFusion);
    }
  }
));
}

Fixed version (ground truth):
public EntityShardFusion(World world){
  super(world);
  this.isImmuneToFire=true;
  this.stayAI=new EntityAIStay(this);
  this.tasks.addTask(2,new EntityAIMoveTowardsTarget(this,0.414D,32.0F));
  this.tasks.addTask(3,new EntityAIMoveTowardsRestriction(this,1.0D));
  this.tasks.addTask(5,new EntityAIStandGuard(this,0.6D));
  this.tasks.addTask(6,new EntityAIWatchClosest(this,EntityPlayer.class,16.0F));
  this.tasks.addTask(6,new EntityAIWatchClosest(this,EntityMob.class,16.0F));
  this.tasks.addTask(7,new EntityAILookIdle(this));
  this.targetTasks.addTask(1,new EntityAIDiamondHurtByTarget(this));
  this.targetTasks.addTask(2,new EntityAIDiamondHurtTarget(this));
  this.targetTasks.addTask(3,new EntityAIHurtByTarget(this,false,new Class[0]));
  this.targetTasks.addTask(4,new EntityAINearestAttackableTarget<EntityLivingBase>(this,EntityLivingBase.class,10,true,false,new Predicate<EntityLivingBase>(){
    public boolean apply(    EntityLivingBase input){
      return input != null && !(input instanceof EntityShardFusion);
    }
  }
));
}
Program: 174488
Project: 174488
Buggy source:
@Override public void updateTask(){
  this.gem.getNavigator().tryMoveToXYZ(this.posX,this.posY,this.posZ,this.movementSpeed);
  if (this.gem.getDistanceSq(this.posX,this.posY,this.posZ) < 8 && !this.placed) {
    this.gem.breakBlock(new BlockPos(this.posX,this.posY,this.posZ));
    this.placed=true;
  }
}

Fixed version (ground truth):
@Override public void updateTask(){
  this.gem.getNavigator().tryMoveToXYZ(this.posX,this.posY,this.posZ,this.movementSpeed);
  if (this.gem.getDistanceSq(this.posX,this.posY,this.posZ) < 8) {
    this.placed=this.gem.breakBlock(new BlockPos(this.posX,this.posY,this.posZ));
  }
}
Program: 174489
Project: 174489
Buggy source:
@Override public boolean shouldContinueExecuting(){
  return !this.gem.getNavigator().noPath() && !this.gem.isDefective();
}

Fixed version (ground truth):
@Override public boolean shouldContinueExecuting(){
  return !this.gem.getNavigator().noPath() && !this.gem.isDefective() && !this.placed&& !this.gem.world.isAirBlock(new BlockPos(this.posX,this.posY,this.posZ));
}
Program: 174490
Project: 174490
Buggy source:
@Override public boolean shouldExecute(){
  boolean canExecute=false;
  List<EntityPearl> list=this.gem.world.<EntityPearl>getEntitiesWithinAABB(EntityPearl.class,this.gem.getEntityBoundingBox().grow(8.0D,4.0D,8.0D));
  for (  EntityPearl entity : list) {
    if (entity.isOwnedBySamePeople(this.gem)) {
      canExecute=this.gem.getHeldItemMainhand().getItem() instanceof ItemPickaxe;
      break;
    }
  }
  if (canExecute) {
    if (this.delay > 0) {
      --this.delay;
      return false;
    }
 else {
      this.delay=this.gem.getRNG().nextInt(20);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean shouldExecute(){
  boolean canExecute=false;
  List<EntityPearl> list=this.gem.world.<EntityPearl>getEntitiesWithinAABB(EntityPearl.class,this.gem.getEntityBoundingBox().grow(8.0D,4.0D,8.0D));
  for (  EntityPearl entity : list) {
    if (entity.isOwnedBySamePeople(this.gem)) {
      canExecute=this.gem.getHeldItemMainhand().getItem() instanceof ItemPickaxe;
      break;
    }
  }
  if (canExecute) {
    if (this.delay > 0) {
      --this.delay;
      return false;
    }
 else {
      this.delay=this.gem.getRNG().nextInt(20);
      boolean found=false;
      for (int x=-this.searchRadius; x <= this.searchRadius && !found; ++x) {
        for (int y=-2; y <= 2 && !found; ++y) {
          for (int z=-this.searchRadius; z <= this.searchRadius && !found; ++z) {
            BlockPos tempPos=this.gem.getPosition().add(new BlockPos(x,y,z));
            Block block=this.gem.world.getBlockState(tempPos).getBlock();
            if (block instanceof BlockOre) {
              boolean canBeSeen=false;
              for (int ox=-1; ox <= 1 && !canBeSeen; ++ox) {
                if (this.gem.world.isAirBlock(tempPos.add(ox,0,0))) {
                  canBeSeen=true;
                }
              }
              for (int oy=-1; oy <= 1 && !canBeSeen; ++oy) {
                if (this.gem.world.isAirBlock(tempPos.add(0,oy,0))) {
                  canBeSeen=true;
                }
              }
              for (int oz=-1; oz <= 1 && !canBeSeen; ++oz) {
                if (this.gem.world.isAirBlock(tempPos.add(0,0,oz))) {
                  canBeSeen=true;
                }
              }
              if (canBeSeen) {
                this.posX=tempPos.getX();
                this.posY=tempPos.getY();
                this.posZ=tempPos.getZ();
                found=true;
                break;
              }
            }
          }
        }
      }
      return true;
    }
  }
  return false;
}
Program: 174491
Project: 174491
Buggy source:
@Override public void startExecuting(){
  if (!this.gem.isDefective()) {
    boolean found=false;
    for (int x=-this.searchRadius; x <= this.searchRadius && !found; ++x) {
      for (int y=-2; y <= 2 && !found; ++y) {
        for (int z=-this.searchRadius; z <= this.searchRadius && !found; ++z) {
          BlockPos tempPos=this.gem.getPosition().add(new BlockPos(x,y,z));
          Block block=this.gem.world.getBlockState(tempPos).getBlock();
          if (block instanceof BlockOre) {
            boolean canBeSeen=false;
            for (int ox=-1; ox <= 1 && !canBeSeen; ++ox) {
              if (this.gem.world.isAirBlock(tempPos.add(ox,0,0))) {
                canBeSeen=true;
              }
            }
            for (int oy=-1; oy <= 1 && !canBeSeen; ++oy) {
              if (this.gem.world.isAirBlock(tempPos.add(0,oy,0))) {
                canBeSeen=true;
              }
            }
            for (int oz=-1; oz <= 1 && !canBeSeen; ++oz) {
              if (this.gem.world.isAirBlock(tempPos.add(0,0,oz))) {
                canBeSeen=true;
              }
            }
            if (canBeSeen) {
              this.posX=tempPos.getX();
              this.posY=tempPos.getY();
              this.posZ=tempPos.getZ();
              found=true;
              break;
            }
          }
        }
      }
    }
    if (found) {
      this.gem.getNavigator().tryMoveToXYZ(this.posX,this.posY,this.posZ,this.movementSpeed);
    }
  }
}

Fixed version (ground truth):
@Override public void startExecuting(){
  if (!this.gem.isDefective()) {
    this.gem.getNavigator().tryMoveToXYZ(this.posX,this.posY,this.posZ,this.movementSpeed);
  }
}
Program: 174492
Project: 174492
Buggy source:
@Override public void itemDataToGemData(int data){
  this.dataManager.set(COLOR,data);
  this.setUniformColor(data);
  this.nativeColor=data;
  this.setSkinColor(this.generateSkinColor());
  this.setHairStyle(this.generateHairStyle());
  this.setHairColor(this.generateHairColor());
  this.setGemColor(this.generateGemColor());
  this.setCustomNameTag(new TextComponentTranslation(String.format("String_Node_Str",data)).getUnformattedComponentText());
  if (data == 16) {
    this.setGemPlacement(GemPlacements.BACK_OF_HEAD.id);
    this.setGemCut(GemCuts.TEARDROP.id);
    this.setSpecial(1);
  }
 else {
    this.setSpecial(0);
  }
}

Fixed version (ground truth):
@Override public void itemDataToGemData(int data){
  this.dataManager.set(COLOR,data);
  this.setSkinColor(this.generateSkinColor());
  this.setHairStyle(this.generateHairStyle());
  this.setHairColor(this.generateHairColor());
  this.setGemColor(this.generateGemColor());
  this.setCustomNameTag(new TextComponentTranslation(String.format("String_Node_Str",data)).getUnformattedComponentText());
  if (data > 15) {
    this.setUniformColor(3);
    this.nativeColor=3;
    this.setSpecial(1);
  }
 else {
    this.setUniformColor(data);
    this.nativeColor=data;
    this.setSpecial(0);
  }
}
Program: 174493
Project: 174493
Buggy source:
public void readEntityFromNBT(NBTTagCompound compound){
  this.dataManager.set(COLOR,compound.getInteger("String_Node_Str"));
  if (compound.hasKey("String_Node_Str")) {
    this.setSpecial(compound.getBoolean("String_Node_Str") ? 1 : 0);
    this.setGemPlacement(GemPlacements.BACK_OF_HEAD.id);
    this.setGemCut(GemCuts.TEARDROP.id);
  }
  super.readEntityFromNBT(compound);
}

Fixed version (ground truth):
public void readEntityFromNBT(NBTTagCompound compound){
  this.dataManager.set(COLOR,compound.getInteger("String_Node_Str"));
  if (compound.hasKey("String_Node_Str")) {
    this.setSpecial(compound.getBoolean("String_Node_Str") ? 1 : 0);
    this.setGemPlacement(GemPlacements.BACK_OF_HEAD.id);
    this.setGemCut(GemCuts.TEARDROP.id);
    if (this.getUniformColor() > 15) {
      this.setUniformColor(3);
      this.nativeColor=3;
      this.setSpecial(1);
    }
  }
  super.readEntityFromNBT(compound);
}
Program: 174496
Project: 174496
Buggy source:
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    BlockPos nextPos=gem.getPosition().add(this.direction[0],-1,this.direction[1]);
    gem.lookAt(nextPos.add(this.direction[0],-1,this.direction[1]));
    boolean placed=false;
    for (int i=this.width / 2 * -1; i < Math.max(1,this.width / 2); ++i) {
      BlockPos placePos=nextPos.add(this.direction[1] * i,0,this.direction[0] * i);
      if (!gem.world.getBlockState(placePos).getBlock().isTopSolid(gem.world.getBlockState(placePos))) {
        placed=gem.placeBlock(this.bridgeBlock,placePos);
        if (placed) {
          this.placeStack.shrink(1);
          if (this.placeStack.isEmpty()) {
            this.getBlock(gem);
          }
        }
      }
    }
    gem.tryToMoveTo(nextPos.up());
    this.stillBuilding=placed;
    this.lastBlockPlace=0;
  }
  ++this.lastBlockPlace;
}

Fixed version (ground truth):
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    BlockPos nextPos=gem.getPosition().add(this.direction[0],-1,this.direction[1]);
    gem.lookAt(nextPos.add(this.direction[0],-1,this.direction[1]));
    boolean placed=false;
    for (int i=this.width / 2 * -1; i < Math.max(1,this.width / 2); ++i) {
      BlockPos placePos=nextPos.add(this.direction[1] * i,0,this.direction[0] * i);
      if (!gem.world.getBlockState(placePos).getBlock().isTopSolid(gem.world.getBlockState(placePos))) {
        placed=gem.placeBlock(this.bridgeBlock,placePos);
        if (placed) {
          this.placeStack.shrink(1);
          if (this.placeStack.isEmpty()) {
            placed=this.getBlock(gem) && placed;
            if (!placed) {
              break;
            }
          }
        }
      }
    }
    gem.tryToMoveTo(nextPos.up());
    this.stillBuilding=placed;
    this.lastBlockPlace=0;
  }
  ++this.lastBlockPlace;
}
Program: 174497
Project: 174497
Buggy source:
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    BlockPos nextPos=gem.getPosition().add(this.direction[0],0,this.direction[1]);
    gem.lookAt(nextPos.add(this.direction[0],-1,this.direction[1]));
    boolean placed=false;
    for (int i=this.width / 2 * -1; i < Math.max(1,this.width / 2); ++i) {
      BlockPos placePos=nextPos.add(this.direction[1] * i,-2,this.direction[0] * i);
      if (!gem.world.getBlockState(placePos).getBlock().isTopSolid(gem.world.getBlockState(placePos))) {
        placed=gem.placeBlock(this.bridgeBlock,placePos);
        if (placed) {
          this.placeStack.shrink(1);
          if (this.placeStack.isEmpty()) {
            this.getBlock(gem);
          }
        }
      }
    }
    gem.tryToMoveTo(nextPos.down());
    this.stillBuilding=placed;
    this.lastBlockPlace=0;
  }
  ++this.lastBlockPlace;
}

Fixed version (ground truth):
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    BlockPos nextPos=gem.getPosition().add(this.direction[0],0,this.direction[1]);
    gem.lookAt(nextPos.add(this.direction[0],-1,this.direction[1]));
    boolean placed=false;
    for (int i=this.width / 2 * -1; i < Math.max(1,this.width / 2); ++i) {
      BlockPos placePos=nextPos.add(this.direction[1] * i,-2,this.direction[0] * i);
      if (!gem.world.getBlockState(placePos).getBlock().isTopSolid(gem.world.getBlockState(placePos))) {
        placed=gem.placeBlock(this.bridgeBlock,placePos);
        if (placed) {
          this.placeStack.shrink(1);
          if (this.placeStack.isEmpty()) {
            placed=this.getBlock(gem) && placed;
            if (!placed) {
              break;
            }
          }
        }
      }
    }
    gem.tryToMoveTo(nextPos.down());
    this.stillBuilding=placed;
    this.lastBlockPlace=0;
  }
  ++this.lastBlockPlace;
}
Program: 174498
Project: 174498
Buggy source:
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    BlockPos nextPos=gem.getPosition().add(this.direction[0],0,this.direction[1]);
    gem.lookAt(nextPos.add(this.direction[0],1,this.direction[1]));
    boolean placed=false;
    for (int i=this.width / 2 * -1; i < Math.max(1,this.width / 2); ++i) {
      BlockPos placePos=nextPos.add(this.direction[1] * i,0,this.direction[0] * i);
      if (!gem.world.getBlockState(placePos).getBlock().isTopSolid(gem.world.getBlockState(placePos))) {
        placed=gem.placeBlock(this.bridgeBlock,placePos);
        if (placed) {
          this.placeStack.shrink(1);
          if (this.placeStack.isEmpty()) {
            this.getBlock(gem);
          }
        }
      }
    }
    gem.tryToMoveTo(nextPos.up());
    this.stillBuilding=placed;
    this.lastBlockPlace=0;
  }
  ++this.lastBlockPlace;
}

Fixed version (ground truth):
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    BlockPos nextPos=gem.getPosition().add(this.direction[0],0,this.direction[1]);
    gem.lookAt(nextPos.add(this.direction[0],1,this.direction[1]));
    boolean placed=false;
    for (int i=this.width / 2 * -1; i < Math.max(1,this.width / 2); ++i) {
      BlockPos placePos=nextPos.add(this.direction[1] * i,0,this.direction[0] * i);
      if (!gem.world.getBlockState(placePos).getBlock().isTopSolid(gem.world.getBlockState(placePos))) {
        placed=gem.placeBlock(this.bridgeBlock,placePos);
        if (placed) {
          this.placeStack.shrink(1);
          if (this.placeStack.isEmpty()) {
            placed=this.getBlock(gem) && placed;
            if (!placed) {
              break;
            }
          }
        }
      }
    }
    gem.tryToMoveTo(nextPos.up());
    this.stillBuilding=placed;
    this.lastBlockPlace=0;
  }
  ++this.lastBlockPlace;
}
Program: 174499
Project: 174499
Buggy source:
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    if (this.offset < this.height) {
      boolean placed=false;
      BlockPos nextPos=gem.getPosition().add(this.direction[0],0,this.direction[1]);
      gem.lookAt(nextPos.add(this.direction[0],4,this.direction[1]));
      placed=gem.placeBlock(this.bridgeBlock,nextPos.up(this.offset));
      if (placed) {
        gem.setPosition(nextPos.getX(),nextPos.getY() + 1,nextPos.getZ());
        this.placeStack.shrink(1);
        if (this.placeStack.isEmpty()) {
          this.getBlock(gem);
        }
      }
      this.stillBuilding=placed;
      this.lastBlockPlace=0;
    }
  }
  ++this.lastBlockPlace;
}

Fixed version (ground truth):
@Override public void run(EntityBismuth gem){
  if (this.lastBlockPlace > 20) {
    if (this.offset < this.height) {
      boolean placed=false;
      BlockPos nextPos=gem.getPosition().add(this.direction[0],0,this.direction[1]);
      gem.lookAt(nextPos.add(this.direction[0],4,this.direction[1]));
      placed=gem.placeBlock(this.bridgeBlock,nextPos.up(this.offset));
      if (placed) {
        gem.setPosition(nextPos.getX(),nextPos.getY() + 1,nextPos.getZ());
        this.placeStack.shrink(1);
        if (this.placeStack.isEmpty()) {
          placed=this.getBlock(gem) && placed;
        }
      }
      this.stillBuilding=placed;
      this.lastBlockPlace=0;
    }
  }
  ++this.lastBlockPlace;
}
Program: 174501
Project: 174501
Buggy source:
@Override public boolean proceed(EntityGem gem){
  return this.liquidLocation != null && gem.getHeldItem(EnumHand.MAIN_HAND).getItem() == Items.BUCKET;
}

Fixed version (ground truth):
@Override public boolean proceed(EntityGem gem){
  return this.liquidLocation != null && gem.getHeldItem(EnumHand.MAIN_HAND).getItem() == Items.BUCKET && gem.isSoldier;
}
Program: 174502
Project: 174502
Buggy source:
public KillOtherEntities(){
  this.TRIGGER_VERBS=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  this.TRIGGER_NOUNS=new ArrayList<String>();
  this.canBeStopped=true;
  this.killsOnEnd=true;
  this.can(RunWith.TARGETTING);
  this.task(true);
}

Fixed version (ground truth):
public KillOtherEntities(){
  this.TRIGGER_VERBS=new ArrayList<String>(Arrays.asList(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}));
  this.TRIGGER_NOUNS=new ArrayList<String>();
  this.canBeStopped=true;
  this.killsOnEnd=true;
  this.can(RunWith.TARGETTING);
  this.task(true);
}
Program: 174503
Project: 174503
Buggy source:
@Override public boolean proceed(EntityGem gem){
  return this.otherCow != null && this.otherCow.getGrowingAge() == 0 && gem.getHeldItem(EnumHand.MAIN_HAND).getItem() == Items.BUCKET;
}

Fixed version (ground truth):
@Override public boolean proceed(EntityGem gem){
  return this.otherCow != null && this.otherCow.getGrowingAge() == 0 && gem.getHeldItem(EnumHand.MAIN_HAND).getItem() == Items.BUCKET && gem.isSoldier;
}
Program: 174507
Project: 174507
Buggy source:
public void injectGemSeed(World worldIn,BlockPos pos){
  if (!(worldIn.getBlockState(pos.up()).getBlock() instanceof BlockIncubator)) {
    Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
  }
 else   if (!(worldIn.getBlockState(pos.down()).getBlock() instanceof BlockGemDrill)) {
    Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
  }
 else   if (this.isEquipped) {
    int newPosY=this.calcDistance(worldIn,pos);
    if (newPosY > 5) {
      worldIn.setBlockState(new BlockPos(pos.getX(),newPosY,pos.getZ()),ModBlocks.GEM_SEED.getDefaultState());
      worldIn.setBlockState(pos,ModBlocks.INJECTOR.getDefaultState().withProperty(FACING,worldIn.getBlockState(pos).getValue(FACING)));
      worldIn.playSound(pos.getX(),pos.getY(),pos.getZ(),SoundEvents.BLOCK_PISTON_EXTEND,SoundCategory.NEUTRAL,1.0F,1.0F,true);
      worldIn.playSound(null,pos,ModSounds.BLOCK_INJECTOR_FIRE,SoundCategory.BLOCKS,512.0F,1.0F);
      Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",false,pos.getX(),newPosY,pos.getZ());
      Injector.awardNearbyPlayers(worldIn,pos);
    }
 else {
      Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
    }
  }
 else {
    Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
  }
}

Fixed version (ground truth):
public void injectGemSeed(World worldIn,BlockPos pos){
  if (!(worldIn.getBlockState(pos.up()).getBlock() instanceof BlockIncubator)) {
    Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
  }
 else   if (!(worldIn.getBlockState(pos.down()).getBlock() instanceof BlockGemDrill)) {
    Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
  }
 else   if (this.isEquipped) {
    int newPosY=this.calcDistance(worldIn,pos);
    if (newPosY > 5) {
      worldIn.setBlockState(new BlockPos(pos.getX(),newPosY,pos.getZ()),ModBlocks.GEM_SEED.getDefaultState());
      worldIn.setBlockState(pos,ModBlocks.INJECTOR.getDefaultState().withProperty(FACING,worldIn.getBlockState(pos).getValue(FACING)));
      worldIn.playSound(pos.getX(),pos.getY(),pos.getZ(),SoundEvents.BLOCK_PISTON_EXTEND,SoundCategory.NEUTRAL,1.0F,1.0F,true);
      worldIn.playSound(null,pos,ModSounds.BLOCK_INJECTOR_FIRE,SoundCategory.BLOCKS,1000.0F,1.0F);
      Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",false,pos.getX(),newPosY,pos.getZ());
      Injector.awardNearbyPlayers(worldIn,pos);
    }
 else {
      Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
    }
  }
 else {
    Injector.tellNearbyPlayers(worldIn,pos,"String_Node_Str",true);
  }
}