nus-yam/ex-repair huggingface dataset:
Program: 134145
Project: 134145
Buggy source:
public void update(){
  if (System.currentTimeMillis() < fireTime + delay)   return;
  lastVelocity=thisVelocity.clone();
  thisVelocity=entity.getVelocity().clone();
  Vector diff=thisVelocity.subtract(lastVelocity);
  if (entity.isOnGround())   remove();
  if (thisVelocity.length() < lastVelocity.length()) {
    if ((diff.getX() > 1 || diff.getX() < -1) || (diff.getZ() > 1 || diff.getZ() < -1)) {
      for (      Block b : Methods.getBlocksAroundPoint(entity.getLocation(),2)) {
        if (b.getType() != Material.AIR) {
          ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity,instigator,lastVelocity,thisVelocity,diff));
          remove();
          return;
        }
      }
    }
  }
}

Fixed version (ground truth):
public void update(){
  if (System.currentTimeMillis() < fireTime + delay)   return;
  lastVelocity=thisVelocity.clone();
  thisVelocity=entity.getVelocity().clone();
  Vector diff=thisVelocity.subtract(lastVelocity);
  if (entity.isOnGround())   remove();
  if (thisVelocity.length() < lastVelocity.length()) {
    if ((diff.getX() > 1 || diff.getX() < -1) || (diff.getZ() > 1 || diff.getZ() < -1)) {
      for (      Block b : Methods.getBlocksAroundPoint(entity.getLocation(),2)) {
        if (!Methods.isTransparentToEarthbending(instigator,b)) {
          ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity,instigator,lastVelocity,thisVelocity,diff));
          remove();
          return;
        }
      }
    }
  }
}
Program: 134146
Project: 134146
Buggy source:
public HorizontalVelocityTracker(Entity e,Entity instigator,long delay){
  entity=e;
  this.instigator=instigator;
  fireTime=System.currentTimeMillis();
  this.delay=delay;
  thisVelocity=e.getVelocity();
  this.delay=delay;
  update();
  instances.put(entity,this);
}

Fixed version (ground truth):
public HorizontalVelocityTracker(Entity e,Player instigator,long delay){
  entity=e;
  this.instigator=instigator;
  fireTime=System.currentTimeMillis();
  this.delay=delay;
  thisVelocity=e.getVelocity();
  this.delay=delay;
  update();
  instances.put(entity,this);
}
Program: 134147
Project: 134147
Buggy source:
@EventHandler public void onHorizontalCollision(HorizontalVelocityChangeEvent e){
  if (e.getEntity() instanceof LivingEntity) {
    ((LivingEntity)e.getEntity()).damage(e.getDifference().length() * 2,e.getInstigator());
  }
}

Fixed version (ground truth):
@EventHandler public void onHorizontalCollision(HorizontalVelocityChangeEvent e){
  if (e.getEntity() instanceof LivingEntity) {
    Methods.damageEntity(e.getInstigator(),e.getEntity(),e.getDifference().length() * 2);
  }
}
Program: 134148
Project: 134148
Buggy source:
public Entity getInstigator(){
  return instigator;
}

Fixed version (ground truth):
public Player getInstigator(){
  return instigator;
}
Program: 134149
Project: 134149
Buggy source:
public HorizontalVelocityChangeEvent(Entity entity,Entity instigator,Vector from,Vector to,Vector difference){
  this.entity=entity;
  this.instigator=instigator;
  this.from=from;
  this.to=to;
  this.difference=difference;
}

Fixed version (ground truth):
public HorizontalVelocityChangeEvent(Entity entity,Player instigator,Vector from,Vector to,Vector difference){
  this.entity=entity;
  this.instigator=instigator;
  this.from=from;
  this.to=to;
  this.difference=difference;
}
Program: 134150
Project: 134150
Buggy source:
public void update(){
  if (System.currentTimeMillis() < fireTime + delay)   return;
  lastVelocity=thisVelocity.clone();
  thisVelocity=entity.getVelocity().clone();
  Vector diff=thisVelocity.subtract(lastVelocity);
  if (entity.isOnGround())   remove();
  if ((diff.getX() > 1 || diff.getX() < -1) || (diff.getZ() > 1 || diff.getZ() < -1)) {
    ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity,instigator,lastVelocity,thisVelocity,diff));
    remove();
    return;
  }
}

Fixed version (ground truth):
public void update(){
  if (System.currentTimeMillis() < fireTime + delay)   return;
  lastVelocity=thisVelocity.clone();
  thisVelocity=entity.getVelocity().clone();
  Vector diff=thisVelocity.subtract(lastVelocity);
  if (entity.isOnGround())   remove();
  if (thisVelocity.length() < lastVelocity.length()) {
    if ((diff.getX() > 1 || diff.getX() < -1) || (diff.getZ() > 1 || diff.getZ() < -1)) {
      for (      Block b : Methods.getBlocksAroundPoint(entity.getLocation(),2)) {
        if (b.getType() != Material.AIR) {
          ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity,instigator,lastVelocity,thisVelocity,diff));
          remove();
          return;
        }
      }
    }
  }
}
Program: 134151
Project: 134151
Buggy source:
private static EarthSmash flyingInSmashCheck(Player player){
  if (!ALLOW_FLIGHT)   return null;
  for (  EarthSmash smash : instances) {
    if (smash.state == State.LIFTED)     if (smash.loc.clone().add(0,2,0).distanceSquared(player.getLocation()) <= Math.pow(FLIGHT_DETECTION_RADIUS,2))     return smash;
  }
  return null;
}

Fixed version (ground truth):
private static EarthSmash flyingInSmashCheck(Player player){
  if (!ALLOW_FLIGHT)   return null;
  for (  EarthSmash smash : instances) {
    if (smash.state == State.LIFTED) {
      if (smash.loc.getWorld().equals(player.getWorld()) && smash.loc.clone().add(0,2,0).distanceSquared(player.getLocation()) <= Math.pow(FLIGHT_DETECTION_RADIUS,2)) {
        return smash;
      }
    }
  }
  return null;
}
Program: 134152
Project: 134152
Buggy source:
@Override public void run(){
  for (  Player player : Bukkit.getOnlinePlayers()) {
    ChiPassive.handlePassive();
    Smokescreen.removeFromHashMap(player);
    WarriorStance.progressAll();
    AcrobatStance.progressAll();
  }
}

Fixed version (ground truth):
@Override public void run(){
  ChiPassive.handlePassive();
  WarriorStance.progressAll();
  AcrobatStance.progressAll();
  for (  Player player : Bukkit.getOnlinePlayers()) {
    Smokescreen.removeFromHashMap(player);
  }
}
Program: 134153
Project: 134153
Buggy source:
public FireBurst(Player player){
  BendingPlayer bPlayer=Methods.getBendingPlayer(player.getName());
  if (bPlayer.isOnCooldown("String_Node_Str"))   return;
  if (instances.containsKey(player))   return;
  starttime=System.currentTimeMillis();
  if (Methods.isDay(player.getWorld())) {
    chargetime/=ProjectKorra.plugin.getConfig().getDouble("String_Node_Str");
  }
  if (AvatarState.isAvatarState(player))   chargetime=0;
  if (BendingManager.events.get(player.getWorld()).equalsIgnoreCase("String_Node_Str"))   chargetime=0;
  this.player=player;
  instances.put(player,this);
}

Fixed version (ground truth):
public FireBurst(Player player){
  BendingPlayer bPlayer=Methods.getBendingPlayer(player.getName());
  if (bPlayer.isOnCooldown("String_Node_Str"))   return;
  if (instances.containsKey(player))   return;
  starttime=System.currentTimeMillis();
  if (Methods.isDay(player.getWorld())) {
    chargetime/=ProjectKorra.plugin.getConfig().getDouble("String_Node_Str");
  }
  if (AvatarState.isAvatarState(player))   chargetime=0;
  if (BendingManager.events.containsKey(player.getWorld())) {
    if (BendingManager.events.get(player.getWorld()).equalsIgnoreCase("String_Node_Str"))     chargetime=0;
  }
  this.player=player;
  instances.put(player,this);
}
Program: 134154
Project: 134154
Buggy source:
public Lightning(Player player){
  this.player=player;
  bplayer=Methods.getBendingPlayer(player.getName());
  charged=false;
  hitWater=false;
  hitIce=false;
  time=System.currentTimeMillis();
  range=Methods.getFirebendingDayAugment(RANGE,player.getWorld());
  subArcChance=Methods.getFirebendingDayAugment(SUB_ARC_CHANCE,player.getWorld());
  damage=Methods.getFirebendingDayAugment(DAMAGE,player.getWorld());
  chainArcs=Methods.getFirebendingDayAugment(MAX_CHAIN_ARCS,player.getWorld());
  chainArcChance=Methods.getFirebendingDayAugment(CHAIN_ARC_CHANCE,player.getWorld());
  chainRange=Methods.getFirebendingDayAugment(CHAIN_ARC_RANGE,player.getWorld());
  waterRange=Methods.getFirebendingDayAugment(WATER_ARC_RANGE,player.getWorld());
  stunChance=Methods.getFirebendingDayAugment(STUN_CHANCE,player.getWorld());
  stunDuration=Methods.getFirebendingDayAugment(STUN_DURATION,player.getWorld());
  chargeTime=CHARGETIME;
  cooldown=COOLDOWN;
  if (AvatarState.isAvatarState(player)) {
    chargeTime=0;
    cooldown=0;
    damage=AvatarState.getValue(damage);
    chainArcs=AvatarState.getValue(chainArcs);
    chainArcChance=AvatarState.getValue(chainArcChance);
    chainRange=AvatarState.getValue(chainRange);
    stunChance=AvatarState.getValue(stunChance);
  }
 else   if (BendingManager.events.get(player.getWorld()).equalsIgnoreCase("String_Node_Str")) {
    chargeTime=0;
    cooldown=0;
  }
  instances.add(this);
}

Fixed version (ground truth):
public Lightning(Player player){
  this.player=player;
  bplayer=Methods.getBendingPlayer(player.getName());
  charged=false;
  hitWater=false;
  hitIce=false;
  time=System.currentTimeMillis();
  range=Methods.getFirebendingDayAugment(RANGE,player.getWorld());
  subArcChance=Methods.getFirebendingDayAugment(SUB_ARC_CHANCE,player.getWorld());
  damage=Methods.getFirebendingDayAugment(DAMAGE,player.getWorld());
  chainArcs=Methods.getFirebendingDayAugment(MAX_CHAIN_ARCS,player.getWorld());
  chainArcChance=Methods.getFirebendingDayAugment(CHAIN_ARC_CHANCE,player.getWorld());
  chainRange=Methods.getFirebendingDayAugment(CHAIN_ARC_RANGE,player.getWorld());
  waterRange=Methods.getFirebendingDayAugment(WATER_ARC_RANGE,player.getWorld());
  stunChance=Methods.getFirebendingDayAugment(STUN_CHANCE,player.getWorld());
  stunDuration=Methods.getFirebendingDayAugment(STUN_DURATION,player.getWorld());
  chargeTime=CHARGETIME;
  cooldown=COOLDOWN;
  if (AvatarState.isAvatarState(player)) {
    chargeTime=0;
    cooldown=0;
    damage=AvatarState.getValue(damage);
    chainArcs=AvatarState.getValue(chainArcs);
    chainArcChance=AvatarState.getValue(chainArcChance);
    chainRange=AvatarState.getValue(chainRange);
    stunChance=AvatarState.getValue(stunChance);
  }
 else   if (BendingManager.events.containsKey(player.getWorld())) {
    if (BendingManager.events.get(player.getWorld()).equalsIgnoreCase("String_Node_Str")) {
      chargeTime=0;
      cooldown=0;
    }
  }
  instances.add(this);
}
Program: 134155
Project: 134155
Buggy source:
public static boolean isLavabendable(Block block,Player player){
  byte full=0x0;
  if (TempBlock.isTempBlock(block)) {
    TempBlock tblock=TempBlock.instances.get(block);
    if (tblock == null || !LavaFlow.totalBlocks.contains(tblock))     return false;
  }
  if ((block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) && block.getData() == full)   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isLavabendable(Block block,Player player){
  byte full=0x0;
  if (TempBlock.isTempBlock(block)) {
    TempBlock tblock=TempBlock.instances.get(block);
    if (tblock == null || !LavaFlow.TEMP_LAVA_BLOCKS.contains(tblock))     return false;
  }
  if ((block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) && block.getData() == full)   return true;
  return false;
}
Program: 134156
Project: 134156
Buggy source:
public Extraction(Player player){
  BendingPlayer bPlayer=Methods.getBendingPlayer(player.getName());
  if (bPlayer.isOnCooldown("String_Node_Str"))   return;
  Block block=player.getTargetBlock(null,5);
  if (block == null) {
    return;
  }
  if (!Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation())) {
    if (Methods.canMetalbend(player) && Methods.canBend(player.getName(),"String_Node_Str")) {
switch (block.getType()) {
case IRON_ORE:
        block.setType(Material.STONE);
      player.getWorld().dropItem(player.getLocation(),new ItemStack(Material.IRON_INGOT,getAmount()));
    break;
case GOLD_ORE:
  block.setType(Material.STONE);
player.getWorld().dropItem(player.getLocation(),new ItemStack(Material.GOLD_INGOT,getAmount()));
break;
case QUARTZ_ORE:
block.setType(Material.NETHERRACK);
player.getWorld().dropItem(player.getLocation(),new ItemStack(Material.QUARTZ,getAmount()));
break;
default :
break;
}
Methods.playMetalbendingSound(block.getLocation());
bPlayer.addCooldown("String_Node_Str",cooldown);
}
}
}

Fixed version (ground truth):
public Extraction(Player player){
  BendingPlayer bPlayer=Methods.getBendingPlayer(player.getName());
  if (bPlayer.isOnCooldown("String_Node_Str"))   return;
  Block block=player.getTargetBlock(null,5);
  if (block == null) {
    return;
  }
  if (!Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation())) {
    if (Methods.canMetalbend(player) && Methods.canBend(player.getName(),"String_Node_Str")) {
      Material type=null;
switch (block.getType()) {
case IRON_ORE:
        block.setType(Material.STONE);
      player.getWorld().dropItem(player.getLocation(),new ItemStack(Material.IRON_INGOT,getAmount()));
    type=Material.STONE;
  break;
case GOLD_ORE:
block.setType(Material.STONE);
player.getWorld().dropItem(player.getLocation(),new ItemStack(Material.GOLD_INGOT,getAmount()));
type=Material.STONE;
break;
case QUARTZ_ORE:
block.setType(Material.NETHERRACK);
player.getWorld().dropItem(player.getLocation(),new ItemStack(Material.QUARTZ,getAmount()));
type=Material.NETHERRACK;
break;
default :
break;
}
if (type != null) {
if (Methods.movedearth.containsKey(block)) {
Methods.movedearth.remove(block);
}
}
Methods.playMetalbendingSound(block.getLocation());
bPlayer.addCooldown("String_Node_Str",cooldown);
}
}
}
Program: 134158
Project: 134158
Buggy source:
public AbilityModuleManager(final ProjectKorra plugin){
  AbilityModuleManager.plugin=plugin;
  final File path=new File(plugin.getDataFolder().toString() + "String_Node_Str");
  if (!path.exists()) {
    path.mkdir();
  }
  loader=new AbilityLoader<AbilityModule>(plugin,path,new Object[]{});
  abilities=new HashSet<String>();
  waterbendingabilities=new ArrayList<String>();
  airbendingabilities=new ArrayList<String>();
  earthbendingabilities=new ArrayList<String>();
  firebendingabilities=new ArrayList<String>();
  chiabilities=new ArrayList<String>();
  shiftabilities=new HashSet<String>();
  descriptions=new HashMap<String,String>();
  authors=new HashMap<String,String>();
  harmlessabilities=new HashSet<String>();
  explodeabilities=new HashSet<String>();
  igniteabilities=new HashSet<String>();
  metalbendingabilities=new HashSet<String>();
  earthsubabilities=new HashSet<String>();
  subabilities=new HashSet<String>();
  ability=loader.load(AbilityModule.class);
  disabledStockAbilities=new HashSet<String>();
  fill();
}

Fixed version (ground truth):
public AbilityModuleManager(final ProjectKorra plugin){
  AbilityModuleManager.plugin=plugin;
  final File path=new File(plugin.getDataFolder().toString() + "String_Node_Str");
  if (!path.exists()) {
    path.mkdir();
  }
  loader=new AbilityLoader<AbilityModule>(plugin,path,new Object[]{});
  abilities=new HashSet<String>();
  waterbendingabilities=new ArrayList<String>();
  airbendingabilities=new ArrayList<String>();
  earthbendingabilities=new ArrayList<String>();
  firebendingabilities=new ArrayList<String>();
  chiabilities=new ArrayList<String>();
  shiftabilities=new HashSet<String>();
  descriptions=new HashMap<String,String>();
  authors=new HashMap<String,String>();
  harmlessabilities=new HashSet<String>();
  explodeabilities=new HashSet<String>();
  igniteabilities=new HashSet<String>();
  metalbendingabilities=new HashSet<String>();
  earthsubabilities=new HashSet<String>();
  subabilities=new HashSet<String>();
  ability=loader.load(AbilityModule.class);
  disabledStockAbilities=new HashSet<String>();
  lightningabilities=new HashSet<String>();
  combustionabilities=new HashSet<String>();
  flightabilities=new HashSet<String>();
  spiritualprojectionabilities=new HashSet<String>();
  metalabilities=new HashSet<String>();
  sandabilities=new HashSet<String>();
  lavaabilities=new HashSet<String>();
  healingabilities=new HashSet<String>();
  plantabilities=new HashSet<String>();
  iceabilities=new HashSet<String>();
  bloodabilities=new HashSet<String>();
  fill();
}
Program: 134160
Project: 134160
Buggy source:
public static boolean isMetalbendingAbility(String ability){
  if (AbilityModuleManager.metalbendingabilities.contains(ability))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isMetalbendingAbility(String ability){
  return AbilityModuleManager.metalabilities.contains(ability);
}
Program: 134162
Project: 134162
Buggy source:
public static boolean hasPermission(Player player,String ability){
  if (player.hasPermission("String_Node_Str" + ability))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean hasPermission(Player player,String ability){
  if (player.hasPermission("String_Node_Str" + ability) && canBind(player.getName(),ability))   return true;
  return false;
}
Program: 134165
Project: 134165
Buggy source:
public boolean progress(){
  if (player.isDead() || !player.isOnline()) {
    instances.remove(id);
    return false;
  }
  if (Methods.isRegionProtectedFromBuild(player,"String_Node_Str",location)) {
    instances.remove(id);
    return false;
  }
  speedfactor=speed * (ProjectKorra.time_step / 1000.);
  ticks++;
  if (ticks > maxticks) {
    instances.remove(id);
    return false;
  }
  Block block=location.getBlock();
  for (  Block testblock : Methods.getBlocksAroundPoint(location,affectingradius)) {
    if (testblock.getType() == Material.FIRE) {
      testblock.setType(Material.AIR);
      testblock.getWorld().playEffect(testblock.getLocation(),Effect.EXTINGUISH,0);
    }
    if (((block.getType() == Material.LEVER) || (block.getType() == Material.STONE_BUTTON)) && !affectedlevers.contains(block)) {
      affectedlevers.add(block);
    }
  }
  if ((Methods.isSolid(block) || block.isLiquid()) && !affectedlevers.contains(block)) {
    if (block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) {
      if (block.getData() == full) {
        block.setType(Material.OBSIDIAN);
      }
 else {
        block.setType(Material.COBBLESTONE);
      }
    }
    instances.remove(id);
    return false;
  }
  if (location.distance(origin) > range) {
    instances.remove(id);
    return false;
  }
  for (  Entity entity : Methods.getEntitiesAroundPoint(location,affectingradius)) {
    affect(entity);
  }
  advanceLocation();
  return true;
}

Fixed version (ground truth):
public boolean progress(){
  if (player.isDead() || !player.isOnline()) {
    instances.remove(id);
    return false;
  }
  if (Methods.isRegionProtectedFromBuild(player,"String_Node_Str",location)) {
    instances.remove(id);
    return false;
  }
  speedfactor=speed * (ProjectKorra.time_step / 1000.);
  ticks++;
  if (ticks > maxticks) {
    instances.remove(id);
    return false;
  }
  Block block=location.getBlock();
  for (  Block testblock : Methods.getBlocksAroundPoint(location,affectingradius)) {
    if (testblock.getType() == Material.FIRE) {
      testblock.setType(Material.AIR);
      testblock.getWorld().playEffect(testblock.getLocation(),Effect.EXTINGUISH,0);
    }
    if (((block.getType() == Material.LEVER) || (block.getType() == Material.STONE_BUTTON)) && !affectedlevers.contains(block)) {
      affectedlevers.add(block);
    }
  }
  if ((Methods.isSolid(block) || block.isLiquid()) && !affectedlevers.contains(block)) {
    if (block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA) {
      if (block.getData() == full) {
        block.setType(Material.OBSIDIAN);
      }
 else {
        block.setType(Material.COBBLESTONE);
      }
    }
    instances.remove(id);
    return false;
  }
  double dist=location.distance(origin);
  if (Double.isNaN(dist) || dist > range) {
    instances.remove(id);
    return false;
  }
  for (  Entity entity : Methods.getEntitiesAroundPoint(location,affectingradius)) {
    affect(entity);
  }
  advanceLocation();
  return true;
}
Program: 134169
Project: 134169
Buggy source:
@Override public void onDisable(){
  Methods.stopBending();
  DBConnection.sql.close();
}

Fixed version (ground truth):
@Override public void onDisable(){
  Methods.stopBending();
  if (DBConnection.isOpen == false)   return;
  DBConnection.sql.close();
}
Program: 134170
Project: 134170
Buggy source:
@Override public Connection open(){
  try {
    Class.forName("String_Node_Str");
    String url="String_Node_Str" + this.host + "String_Node_Str"+ this.port+ "String_Node_Str"+ this.database;
    this.connection=DriverManager.getConnection(url,this.user,this.pass);
    this.printInfo("String_Node_Str");
    return this.connection;
  }
 catch (  ClassNotFoundException e) {
    this.printErr("String_Node_Str",true);
    return null;
  }
catch (  SQLException e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
@Override public Connection open(){
  try {
    Class.forName("String_Node_Str");
    String url="String_Node_Str" + this.host + "String_Node_Str"+ this.port+ "String_Node_Str"+ this.database;
    this.connection=DriverManager.getConnection(url,this.user,this.pass);
    this.printInfo("String_Node_Str");
    return this.connection;
  }
 catch (  ClassNotFoundException e) {
    this.printErr("String_Node_Str",true);
    return null;
  }
catch (  SQLException e) {
    e.printStackTrace();
    this.printErr("String_Node_Str",true);
    return null;
  }
}
Program: 134172
Project: 134172
Buggy source:
public void electrocute(LivingEntity lent){
  lent.getWorld().playSound(lent.getLocation(),Sound.CREEPER_HISS,1,0);
  player.getWorld().playSound(player.getLocation(),Sound.CREEPER_HISS,1,0);
  Methods.damageEntity(player,lent,damage);
  if (Math.random() < stunChance) {
    final Location lentLoc=lent.getLocation();
    final LivingEntity flent=lent;
    new BukkitRunnable(){
      int count=0;
      public void run(){
        Location tempLoc=lentLoc.clone();
        Vector tempVel=flent.getVelocity();
        tempVel.setY(Math.min(0,tempVel.getY()));
        tempLoc.setY(flent.getLocation().getY());
        flent.teleport(tempLoc);
        flent.setVelocity(tempVel);
        count++;
        if (count > stunDuration)         cancel();
      }
    }
.runTaskTimer(ProjectKorra.plugin,0,1);
  }
}

Fixed version (ground truth):
public void electrocute(LivingEntity lent){
  lent.getWorld().playSound(lent.getLocation(),Sound.CREEPER_HISS,1,0);
  player.getWorld().playSound(player.getLocation(),Sound.CREEPER_HISS,1,0);
  Methods.damageEntity(player,lent,damage);
  if (Math.random() < stunChance) {
    final Location lentLoc=lent.getLocation();
    final LivingEntity flent=lent;
    new BukkitRunnable(){
      int count=0;
      public void run(){
        if (flent.isDead() || (flent instanceof Player && !((Player)flent).isOnline())) {
          cancel();
          return;
        }
        Location tempLoc=lentLoc.clone();
        Vector tempVel=flent.getVelocity();
        tempVel.setY(Math.min(0,tempVel.getY()));
        tempLoc.setY(flent.getLocation().getY());
        flent.teleport(tempLoc);
        flent.setVelocity(tempVel);
        count++;
        if (count > stunDuration)         cancel();
      }
    }
.runTaskTimer(ProjectKorra.plugin,0,1);
  }
}
Program: 134173
Project: 134173
Buggy source:
public static boolean isTransparent(Player player,Block block){
  if (!Arrays.asList(Methods.transparentToEarthbending).contains(block.getTypeId())) {
    if (isWater(block.getLocation()))     return true;
 else     if (isIce(block.getLocation()))     return ARC_ON_ICE;
  }
  return !Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation());
}

Fixed version (ground truth):
public static boolean isTransparent(Player player,Block block){
  if (Arrays.asList(Methods.transparentToEarthbending).contains(block.getTypeId())) {
    if (Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation()))     return false;
 else     if (isIce(block.getLocation()))     return ARC_ON_ICE;
    return true;
  }
  return false;
}
Program: 134174
Project: 134174
Buggy source:
public void removeWithTasks(){
  for (  BukkitRunnable task : tasks)   task.cancel();
  remove();
}

Fixed version (ground truth):
public void removeWithTasks(){
  for (int i=0; i < tasks.size(); i++) {
    tasks.get(i).cancel();
    i--;
  }
  remove();
}
Program: 134175
Project: 134175
Buggy source:
public Lightning(Player player){
  this.player=player;
  bplayer=Methods.getBendingPlayer(player.getName());
  charged=false;
  hitWater=false;
  hitIce=false;
  time=System.currentTimeMillis();
  range=Methods.getFirebendingDayAugment(RANGE,player.getWorld());
  subArcChance=Methods.getFirebendingDayAugment(SUB_ARC_CHANCE,player.getWorld());
  damage=Methods.getFirebendingDayAugment(DAMAGE,player.getWorld());
  chainArcs=Methods.getFirebendingDayAugment(MAX_CHAIN_ARCS,player.getWorld());
  chainArcChance=Methods.getFirebendingDayAugment(CHAIN_ARC_CHANCE,player.getWorld());
  chainRange=Methods.getFirebendingDayAugment(CHAIN_ARC_RANGE,player.getWorld());
  waterRange=Methods.getFirebendingDayAugment(WATER_ARC_RANGE,player.getWorld());
  stunChance=Methods.getFirebendingDayAugment(STUN_CHANCE,player.getWorld());
  stunDuration=Methods.getFirebendingDayAugment(STUN_DURATION,player.getWorld());
  chargeTime=CHARGETIME;
  cooldown=COOLDOWN;
  if (AvatarState.isAvatarState(player)) {
    range=AvatarState.getValue(range);
    chargeTime=0;
    cooldown=0;
    subArcChance=AvatarState.getValue(subArcChance);
    damage=AvatarState.getValue(damage);
    chainArcs=AvatarState.getValue(chainArcs);
    chainArcChance=AvatarState.getValue(chainArcChance);
    chainRange=AvatarState.getValue(chainRange);
    waterRange=AvatarState.getValue(waterRange);
    stunChance=AvatarState.getValue(stunChance);
    stunDuration=AvatarState.getValue(stunDuration);
  }
 else   if (BendingManager.events.get(player.getWorld()).equalsIgnoreCase("String_Node_Str")) {
    chargeTime=0;
    cooldown=0;
  }
  instances.add(this);
}

Fixed version (ground truth):
public Lightning(Player player){
  this.player=player;
  bplayer=Methods.getBendingPlayer(player.getName());
  charged=false;
  hitWater=false;
  hitIce=false;
  time=System.currentTimeMillis();
  range=Methods.getFirebendingDayAugment(RANGE,player.getWorld());
  subArcChance=Methods.getFirebendingDayAugment(SUB_ARC_CHANCE,player.getWorld());
  damage=Methods.getFirebendingDayAugment(DAMAGE,player.getWorld());
  chainArcs=Methods.getFirebendingDayAugment(MAX_CHAIN_ARCS,player.getWorld());
  chainArcChance=Methods.getFirebendingDayAugment(CHAIN_ARC_CHANCE,player.getWorld());
  chainRange=Methods.getFirebendingDayAugment(CHAIN_ARC_RANGE,player.getWorld());
  waterRange=Methods.getFirebendingDayAugment(WATER_ARC_RANGE,player.getWorld());
  stunChance=Methods.getFirebendingDayAugment(STUN_CHANCE,player.getWorld());
  stunDuration=Methods.getFirebendingDayAugment(STUN_DURATION,player.getWorld());
  chargeTime=CHARGETIME;
  cooldown=COOLDOWN;
  if (AvatarState.isAvatarState(player)) {
    chargeTime=0;
    cooldown=0;
    damage=AvatarState.getValue(damage);
    chainArcs=AvatarState.getValue(chainArcs);
    chainArcChance=AvatarState.getValue(chainArcChance);
    chainRange=AvatarState.getValue(chainRange);
    stunChance=AvatarState.getValue(stunChance);
  }
 else   if (BendingManager.events.get(player.getWorld()).equalsIgnoreCase("String_Node_Str")) {
    chargeTime=0;
    cooldown=0;
  }
  instances.add(this);
}
Program: 134179
Project: 134179
Buggy source:
/** 
 * Gets the Element color from the Ability name specified.
 * @param ability The ability name<p>
 * @return {@link #getChiColor()} <br />{@link #getAirColor()} <br />{@link #getWaterColor()} <br />{@link #getEarthColor()} <br />{@link #getFireColor()} <br />else  {@link #getAvatarColor()}</p>
 */
public static ChatColor getAbilityColor(String ability){
  if (AbilityModuleManager.chiabilities.contains(ability))   return getChiColor();
  if (AbilityModuleManager.airbendingabilities.contains(ability))   return getAirColor();
  if (AbilityModuleManager.waterbendingabilities.contains(ability))   return getWaterColor();
  if (AbilityModuleManager.earthbendingabilities.contains(ability))   return getEarthColor();
  if (AbilityModuleManager.firebendingabilities.contains(ability))   return getFireColor();
 else   return getAvatarColor();
}

Fixed version (ground truth):
/** 
 * Gets the Element color from the Ability name specified.
 * @param ability The ability name<p>
 * @return {@link #getChiColor()} <br />{@link #getAirColor()} <br />{@link #getWaterColor()} <br />{@link #getEarthColor()} <br />{@link #getFireColor()} <br />else  {@link #getAvatarColor()}</p>
 */
public static ChatColor getAbilityColor(String ability){
  if (AbilityModuleManager.chiabilities.contains(ability))   return getChiColor();
  if (AbilityModuleManager.airbendingabilities.contains(ability)) {
    if (AbilityModuleManager.subabilities.contains(ability))     return getSubBendingColor(Element.Air);
    return getAirColor();
  }
  if (AbilityModuleManager.waterbendingabilities.contains(ability)) {
    if (AbilityModuleManager.subabilities.contains(ability))     return getSubBendingColor(Element.Water);
    return getWaterColor();
  }
  if (AbilityModuleManager.earthbendingabilities.contains(ability)) {
    if (AbilityModuleManager.subabilities.contains(ability))     return getSubBendingColor(Element.Earth);
    return getEarthColor();
  }
  if (AbilityModuleManager.firebendingabilities.contains(ability)) {
    if (AbilityModuleManager.subabilities.contains(ability))     return getSubBendingColor(Element.Fire);
    return getFireColor();
  }
 else   return getAvatarColor();
}
Program: 134180
Project: 134180
Buggy source:
public static boolean hasPermission(Player player,String ability){
  if (player.hasPermission("String_Node_Str" + ability))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean hasPermission(Player player,String ability){
  if (player.hasPermission("String_Node_Str" + ability) && Methods.canBend(player.getName(),ability))   return true;
  return false;
}
Program: 134181
Project: 134181
Buggy source:
private void freeze(){
  if (!Methods.canIcebend(player))   return;
  clearWave();
  double freezeradius=radius;
  if (freezeradius > maxfreezeradius) {
    freezeradius=maxfreezeradius;
  }
  for (  Block block : Methods.getBlocksAroundPoint(frozenlocation,freezeradius)) {
    if (Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation()) || Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation()))     continue;
    if (TempBlock.isTempBlock(block))     continue;
    if (block.getType() == Material.AIR || block.getType() == Material.SNOW) {
      new TempBlock(block,Material.ICE,(byte)0);
      frozenblocks.put(block,block);
    }
    if (Methods.isWater(block)) {
      FreezeMelt.freeze(player,block);
    }
    if (Methods.isPlant(block) && block.getType() != Material.LEAVES) {
      block.breakNaturally();
      new TempBlock(block,Material.ICE,(byte)0);
      frozenblocks.put(block,block);
    }
    for (    Block sound : frozenblocks.keySet()) {
      if (Methods.rand.nextInt(4) == 0) {
        Methods.playWaterbendingSound(sound.getLocation());
      }
    }
  }
}

Fixed version (ground truth):
private void freeze(){
  clearWave();
  if (!Methods.canIcebend(player))   return;
  double freezeradius=radius;
  if (freezeradius > maxfreezeradius) {
    freezeradius=maxfreezeradius;
  }
  for (  Block block : Methods.getBlocksAroundPoint(frozenlocation,freezeradius)) {
    if (Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation()) || Methods.isRegionProtectedFromBuild(player,"String_Node_Str",block.getLocation()))     continue;
    if (TempBlock.isTempBlock(block))     continue;
    if (block.getType() == Material.AIR || block.getType() == Material.SNOW) {
      new TempBlock(block,Material.ICE,(byte)0);
      frozenblocks.put(block,block);
    }
    if (Methods.isWater(block)) {
      FreezeMelt.freeze(player,block);
    }
    if (Methods.isPlant(block) && block.getType() != Material.LEAVES) {
      block.breakNaturally();
      new TempBlock(block,Material.ICE,(byte)0);
      frozenblocks.put(block,block);
    }
    for (    Block sound : frozenblocks.keySet()) {
      if (Methods.rand.nextInt(4) == 0) {
        Methods.playWaterbendingSound(sound.getLocation());
      }
    }
  }
}
Program: 134182
Project: 134182
Buggy source:
public static Entity getTargetedEntity(Player player,double range,List<Entity> avoid){
  double longestr=range + 1;
  Entity target=null;
  Location origin=player.getEyeLocation();
  Vector direction=player.getEyeLocation().getDirection().normalize();
  for (  Entity entity : origin.getWorld().getEntities()) {
    if (avoid.contains(entity))     continue;
    if (entity.getLocation().distance(origin) < longestr && getDistanceFromLine(direction,origin,entity.getLocation()) < 2 && (entity instanceof LivingEntity) && entity.getEntityId() != player.getEntityId() && entity.getLocation().distance(origin.clone().add(direction)) < entity.getLocation().distance(origin.clone().add(direction.clone().multiply(-1)))) {
      target=entity;
      longestr=entity.getLocation().distance(origin);
    }
  }
  if (target != null) {
    List<Block> blklist=new ArrayList();
    blklist=Methods.getBlocksAlongLine(player.getLocation(),target.getLocation(),player.getWorld());
    for (    Block isair : blklist) {
      if (Methods.isObstructed(origin,target.getLocation())) {
        target=null;
        break;
      }
    }
  }
  return target;
}

Fixed version (ground truth):
public static Entity getTargetedEntity(Player player,double range,List<Entity> avoid){
  double longestr=range + 1;
  Entity target=null;
  Location origin=player.getEyeLocation();
  Vector direction=player.getEyeLocation().getDirection().normalize();
  for (  Entity entity : origin.getWorld().getEntities()) {
    if (avoid.contains(entity))     continue;
    if (entity.getLocation().distance(origin) < longestr && getDistanceFromLine(direction,origin,entity.getLocation()) < 2 && (entity instanceof LivingEntity) && entity.getEntityId() != player.getEntityId() && entity.getLocation().distance(origin.clone().add(direction)) < entity.getLocation().distance(origin.clone().add(direction.clone().multiply(-1)))) {
      target=entity;
      longestr=entity.getLocation().distance(origin);
    }
  }
  if (target != null) {
    List<Block> blklist=new ArrayList<Block>();
    blklist=Methods.getBlocksAlongLine(player.getLocation(),target.getLocation(),player.getWorld());
    for (    Block isair : blklist) {
      if (Methods.isObstructed(origin,target.getLocation())) {
        target=null;
        break;
      }
    }
  }
  return target;
}
Program: 134183
Project: 134183
Buggy source:
/** 
 * Deserializes the configuration file "bendingPlayers.yml" of the old BendingPlugin and creates a converted.yml ready for conversion.
 * @throws IOException If the "bendingPlayers.yml" file is not found
 */
public static void deserializeFile(){
  File readFile=new File("String_Node_Str","String_Node_Str");
  File writeFile=new File("String_Node_Str","String_Node_Str");
  if (readFile.exists()) {
    try {
      DataInputStream input=new DataInputStream(new FileInputStream(readFile));
      BufferedReader reader=new BufferedReader(new InputStreamReader(input));
      DataOutputStream output=new DataOutputStream(new FileOutputStream(writeFile));
      BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(output));
      String line;
      while ((line=reader.readLine()) != null) {
        if (!line.trim().contains("String_Node_Str")) {
          writer.write(line + "String_Node_Str");
        }
      }
      reader.close();
      input.close();
      writer.close();
      output.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Deserializes the configuration file "bendingPlayers.yml" of the old BendingPlugin and creates a converted.yml ready for conversion.
 * @throws IOException If the "bendingPlayers.yml" file is not found
 */
public static void deserializeFile(){
  File readFile=new File("String_Node_Str","String_Node_Str");
  File writeFile=new File("String_Node_Str","String_Node_Str");
  if (readFile.exists()) {
    try (DataInputStream input=new DataInputStream(new FileInputStream(readFile));BufferedReader reader=new BufferedReader(new InputStreamReader(input));DataOutputStream output=new DataOutputStream(new FileOutputStream(writeFile));BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(output))){
      String line;
      while ((line=reader.readLine()) != null) {
        if (!line.trim().contains("String_Node_Str")) {
          writer.write(line + "String_Node_Str");
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 134184
Project: 134184
Buggy source:
public static void writeToDebug(String message){
  try {
    File dataFolder=plugin.getDataFolder();
    if (!dataFolder.exists()) {
      dataFolder.mkdir();
    }
    File saveTo=new File(plugin.getDataFolder(),"String_Node_Str");
    if (!saveTo.exists()) {
      saveTo.createNewFile();
    }
    FileWriter fw=new FileWriter(saveTo,true);
    PrintWriter pw=new PrintWriter(fw);
    pw.println(message);
    pw.flush();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void writeToDebug(String message){
  try {
    File dataFolder=plugin.getDataFolder();
    if (!dataFolder.exists()) {
      dataFolder.mkdir();
    }
    File saveTo=new File(plugin.getDataFolder(),"String_Node_Str");
    if (!saveTo.exists()) {
      saveTo.createNewFile();
    }
    FileWriter fw=new FileWriter(saveTo,true);
    PrintWriter pw=new PrintWriter(fw);
    pw.println(message);
    pw.flush();
    pw.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 134187
Project: 134187
Buggy source:
public static void progressAll(){
  for (  Player player : instances.keySet())   instances.get(player).progress();
  for (  TempBlock block : frozenblocks.keySet()) {
    Player player=frozenblocks.get(block);
    if (block.getBlock().getType() != Material.ICE) {
      frozenblocks.remove(block);
      continue;
    }
    if (block.getBlock().getWorld() != player.getWorld()) {
      thaw(block);
      continue;
    }
    if (block.getLocation().distance(player.getLocation()) > instances.get(player).range || !Methods.canBend(player.getName(),"String_Node_Str")) {
      thaw(block);
    }
  }
}

Fixed version (ground truth):
public static void progressAll(){
  for (  Player player : instances.keySet())   instances.get(player).progress();
  for (  TempBlock block : frozenblocks.keySet()) {
    Player player=frozenblocks.get(block);
    if (block.getBlock().getType() != Material.ICE) {
      frozenblocks.remove(block);
      continue;
    }
    if (block.getBlock().getWorld() != player.getWorld()) {
      thaw(block);
      continue;
    }
    if (block.getLocation().distance(player.getLocation()) > RANGE || !Methods.canBend(player.getName(),"String_Node_Str")) {
      thaw(block);
    }
  }
}
Program: 134188
Project: 134188
Buggy source:
public Lightning(Player player){
  this.player=player;
  bplayer=Methods.getBendingPlayer(player.getName());
  charged=false;
  hitWater=false;
  hitIce=false;
  time=System.currentTimeMillis();
  range=Methods.getFirebendingDayAugment(RANGE,player.getWorld());
  subArcChance=Methods.getFirebendingDayAugment(SUB_ARC_CHANCE,player.getWorld());
  damage=Methods.getFirebendingDayAugment(DAMAGE,player.getWorld());
  chainArcs=Methods.getFirebendingDayAugment(MAX_CHAIN_ARCS,player.getWorld());
  chainArcChance=Methods.getFirebendingDayAugment(CHAIN_ARC_CHANCE,player.getWorld());
  chainRange=Methods.getFirebendingDayAugment(CHAIN_ARC_RANGE,player.getWorld());
  waterRange=Methods.getFirebendingDayAugment(WATER_ARC_RANGE,player.getWorld());
  stunChance=Methods.getFirebendingDayAugment(STUN_CHANCE,player.getWorld());
  stunDuration=Methods.getFirebendingDayAugment(STUN_DURATION,player.getWorld());
  chargeTime=CHARGETIME;
  cooldown=COOLDOWN;
  if (AvatarState.isAvatarState(player)) {
    range=AvatarState.getValue(range);
    chargeTime=0;
    cooldown=0;
    subArcChance=AvatarState.getValue(subArcChance);
    damage=AvatarState.getValue(damage);
    chainArcs=AvatarState.getValue(chainArcs);
    chainArcChance=AvatarState.getValue(chainArcChance);
    chainRange=AvatarState.getValue(chainRange);
    waterRange=AvatarState.getValue(waterRange);
    stunChance=AvatarState.getValue(stunChance);
    stunDuration=AvatarState.getValue(stunDuration);
  }
 else   if (RPGMethods.isSozinsComet(player.getWorld())) {
    chargeTime=0;
    cooldown=0;
  }
  instances.add(this);
}

Fixed version (ground truth):
public Lightning(Player player){
  this.player=player;
  bplayer=Methods.getBendingPlayer(player.getName());
  charged=false;
  hitWater=false;
  hitIce=false;
  time=System.currentTimeMillis();
  range=Methods.getFirebendingDayAugment(RANGE,player.getWorld());
  subArcChance=Methods.getFirebendingDayAugment(SUB_ARC_CHANCE,player.getWorld());
  damage=Methods.getFirebendingDayAugment(DAMAGE,player.getWorld());
  chainArcs=Methods.getFirebendingDayAugment(MAX_CHAIN_ARCS,player.getWorld());
  chainArcChance=Methods.getFirebendingDayAugment(CHAIN_ARC_CHANCE,player.getWorld());
  chainRange=Methods.getFirebendingDayAugment(CHAIN_ARC_RANGE,player.getWorld());
  waterRange=Methods.getFirebendingDayAugment(WATER_ARC_RANGE,player.getWorld());
  stunChance=Methods.getFirebendingDayAugment(STUN_CHANCE,player.getWorld());
  stunDuration=Methods.getFirebendingDayAugment(STUN_DURATION,player.getWorld());
  chargeTime=CHARGETIME;
  cooldown=COOLDOWN;
  if (AvatarState.isAvatarState(player)) {
    range=AvatarState.getValue(range);
    chargeTime=0;
    cooldown=0;
    subArcChance=AvatarState.getValue(subArcChance);
    damage=AvatarState.getValue(damage);
    chainArcs=AvatarState.getValue(chainArcs);
    chainArcChance=AvatarState.getValue(chainArcChance);
    chainRange=AvatarState.getValue(chainRange);
    waterRange=AvatarState.getValue(waterRange);
    stunChance=AvatarState.getValue(stunChance);
    stunDuration=AvatarState.getValue(stunDuration);
  }
  instances.add(this);
}
Program: 134190
Project: 134190
Buggy source:
public static void bindPreset(Player player,String name){
  BendingPlayer bPlayer=Methods.getBendingPlayer(player.getName());
  if (bPlayer == null)   return;
  if (!presets.containsKey(player.getUniqueId()))   return;
  for (  Preset preset : presets.get(player.getUniqueId())) {
    if (preset.name.equalsIgnoreCase(name)) {
      bPlayer.setAbilities(preset.abilities);
    }
  }
}

Fixed version (ground truth):
public static void bindPreset(Player player,String name){
  BendingPlayer bPlayer=Methods.getBendingPlayer(player.getName());
  if (bPlayer == null)   return;
  if (!presets.containsKey(player.getUniqueId()))   return;
  for (  Preset preset : presets.get(player.getUniqueId())) {
    if (preset.name.equalsIgnoreCase(name)) {
      bPlayer.setAbilities((HashMap<Integer,String>)preset.abilities.clone());
    }
  }
}
Program: 134192
Project: 134192
Buggy source:
public static boolean isControlled(Player player){
  for (  Player p : instances.keySet()) {
    if (instances.get(p).getTarget().getEntityId() == player.getEntityId()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isControlled(Player player){
  for (  Player p : instances.keySet()) {
    if (instances.get(p).getTarget() != null && instances.get(p).getTarget().getEntityId() == player.getEntityId()) {
      return true;
    }
  }
  return false;
}
Program: 134195
Project: 134195
Buggy source:
private void remove(){
  instances.remove(player);
}

Fixed version (ground truth):
private void remove(){
  instances.remove(player);
  player.setFlying(false);
  player.setAllowFlight(false);
  player.setSprinting(false);
}
Program: 134197
Project: 134197
Buggy source:
private void throwIce(){
  if (!prepared)   return;
  LivingEntity target=(LivingEntity)Methods.getTargetedEntity(player,range,new ArrayList<Entity>());
  if (target == null) {
    destination=Methods.getTargetedLocation(player,range,Methods.transparentToEarthbending);
  }
 else {
    destination=target.getEyeLocation();
  }
  location=sourceblock.getLocation();
  if (destination.distance(location) < 1)   return;
  firstdestination=location.clone();
  if (destination.getY() - location.getY() > 2) {
    firstdestination.setY(destination.getY() - 1);
  }
 else {
    firstdestination.add(0,2,0);
  }
  destination=Methods.getPointOnLine(firstdestination,destination,range);
  progressing=true;
  settingup=true;
  prepared=false;
  sourceblock.setType(Material.AIR);
  source=new TempBlock(sourceblock,Material.PACKED_ICE,data);
}

Fixed version (ground truth):
private void throwIce(){
  if (!prepared)   return;
  LivingEntity target=(LivingEntity)Methods.getTargetedEntity(player,range,new ArrayList<Entity>());
  if (target == null) {
    destination=Methods.getTargetedLocation(player,range,Methods.transparentToEarthbending);
  }
 else {
    destination=target.getEyeLocation();
  }
  location=sourceblock.getLocation();
  if (destination.distance(location) < 1)   return;
  firstdestination=location.clone();
  if (destination.getY() - location.getY() > 2) {
    firstdestination.setY(destination.getY() - 1);
  }
 else {
    firstdestination.add(0,2,0);
  }
  destination=Methods.getPointOnLine(firstdestination,destination,range);
  progressing=true;
  settingup=true;
  prepared=false;
  new TempBlock(sourceblock,Material.AIR,(byte)0);
  source=new TempBlock(sourceblock,Material.PACKED_ICE,data);
}
Program: 134198
Project: 134198
Buggy source:
public static void revertBlock(Block block,Material defaulttype){
  if (instances.containsKey(block)) {
    instances.get(block).revertBlock();
  }
 else {
    if ((defaulttype == Material.LAVA || defaulttype == Material.STATIONARY_LAVA || defaulttype == Material.AIR) && Methods.isAdjacentToThreeOrMoreSources(block)) {
      block.setType(Material.LAVA);
      block.setData((byte)0x0);
    }
 else     if ((defaulttype == Material.WATER || defaulttype == Material.STATIONARY_WATER || defaulttype == Material.AIR) && Methods.isAdjacentToThreeOrMoreSources(block)) {
      block.setType(Material.WATER);
      block.setData((byte)0x0);
    }
 else {
      block.setType(defaulttype);
    }
  }
}

Fixed version (ground truth):
public static void revertBlock(Block block,Material defaulttype){
  if (instances.containsKey(block)) {
    instances.get(block).revertBlock();
  }
 else {
    if ((defaulttype == Material.LAVA || defaulttype == Material.STATIONARY_LAVA) && Methods.isAdjacentToThreeOrMoreSources(block)) {
      block.setType(Material.LAVA);
      block.setData((byte)0x0);
    }
 else     if ((defaulttype == Material.WATER || defaulttype == Material.STATIONARY_WATER) && Methods.isAdjacentToThreeOrMoreSources(block)) {
      block.setType(Material.WATER);
      block.setData((byte)0x0);
    }
 else {
      block.setType(defaulttype);
    }
  }
}
Program: 134199
Project: 134199
Buggy source:
public void startPunch(Player p){
  if (numpunches >= punches)   instances.remove(p);
  if (target instanceof LivingEntity && target != null) {
    LivingEntity lt=(LivingEntity)target;
    Methods.damageEntity(p,target,damage);
    if (target instanceof Player)     if (ChiPassive.willChiBlock((Player)target)) {
      ChiPassive.blockChi((Player)target);
    }
    if (Suffocate.isChannelingSphere((Player)target)) {
      Suffocate.remove((Player)target);
    }
    lt.setNoDamageTicks(0);
  }
  cooldowns.put(p.getName(),System.currentTimeMillis());
  swing(p);
  numpunches++;
}

Fixed version (ground truth):
public void startPunch(Player p){
  if (numpunches >= punches)   instances.remove(p);
  if (target instanceof LivingEntity && target != null) {
    LivingEntity lt=(LivingEntity)target;
    Methods.damageEntity(p,target,damage);
    if (target instanceof Player) {
      if (ChiPassive.willChiBlock((Player)target)) {
        ChiPassive.blockChi((Player)target);
      }
      if (Suffocate.isChannelingSphere((Player)target)) {
        Suffocate.remove((Player)target);
      }
    }
    lt.setNoDamageTicks(0);
  }
  cooldowns.put(p.getName(),System.currentTimeMillis());
  swing(p);
  numpunches++;
}