nus-yam/ex-repair huggingface dataset:
Program: 101837
Project: 101837
Buggy source:
public boolean checkAscension(Player player,double y1,double y2){
  int max=ASCENSION_COUNT_MAX;
  if (player.hasPotionEffect(PotionEffectType.JUMP)) {
    max+=12;
  }
  Block block=player.getLocation().getBlock();
  if (!isMovingExempt(player) && !Utilities.isInWater(player) && !Utilities.isOnLadder(player)&& !player.isInsideVehicle()) {
    String name=player.getName();
    if (y1 < y2) {
      if (!block.getRelative(BlockFace.NORTH).isLiquid() && !block.getRelative(BlockFace.SOUTH).isLiquid() && !block.getRelative(BlockFace.EAST).isLiquid()&& !block.getRelative(BlockFace.WEST).isLiquid()) {
        increment(player,ascensionCount,max);
        if (ascensionCount.get(name) >= max) {
          return true;
        }
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkAscension(Player player,double y1,double y2){
  int max=ASCENSION_COUNT_MAX;
  if (player.hasPotionEffect(PotionEffectType.JUMP)) {
    max+=12;
  }
  Block block=player.getLocation().getBlock();
  if (!isMovingExempt(player) && !Utilities.isInWater(player) && !Utilities.isOnClimbableBlock(player)&& !player.isInsideVehicle()) {
    String name=player.getName();
    if (y1 < y2) {
      if (!block.getRelative(BlockFace.NORTH).isLiquid() && !block.getRelative(BlockFace.SOUTH).isLiquid() && !block.getRelative(BlockFace.EAST).isLiquid()&& !block.getRelative(BlockFace.WEST).isLiquid()) {
        increment(player,ascensionCount,max);
        if (ascensionCount.get(name) >= max) {
          return true;
        }
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}
Program: 101838
Project: 101838
Buggy source:
public boolean checkSpider(Player player,double y){
  if (y <= LADDER_Y_MAX && y >= LADDER_Y_MIN && !Utilities.isOnLadder(player)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean checkSpider(Player player,double y){
  if (y <= LADDER_Y_MAX && y >= LADDER_Y_MIN && !Utilities.isOnClimbableBlock(player)) {
    return true;
  }
  return false;
}
Program: 101839
Project: 101839
Buggy source:
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& !Utilities.isInWater(player)) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player) && !Utilities.isOnVine(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& !Utilities.isInWater(player)) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}
Program: 101841
Project: 101841
Buggy source:
@EventHandler public void onPlayerInteract(PlayerInteractEvent event){
  Player player=event.getPlayer();
  Block playerClick=player.getTargetBlock(null,5);
  PlayerInventory inv=player.getInventory();
  if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
    Material m=inv.getItemInHand().getType();
    if (m == Material.BOW) {
      backend.logBowWindUp(player);
    }
 else     if (Utilities.isFood(m)) {
      backend.logEatingStart(player);
    }
  }
  if (event.getClickedBlock() != null) {
    Distance distance=new Distance(player.getLocation(),event.getClickedBlock().getLocation());
    backend.checkLongReachBlock(player,distance.getXDifference(),distance.getYDifference(),distance.getZDifference());
  }
  Block block=event.getClickedBlock();
  if (block != null) {
    if (checkManager.willCheck(player,CheckType.VISUAL)) {
      if (backend.checkInteraction(player,block,playerClick)) {
        event.setCancelled(true);
        log("String_Node_Str",player,CheckType.VISUAL);
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerInteract(PlayerInteractEvent event){
  Player player=event.getPlayer();
  Block playerClick=player.getTargetBlock(null,5);
  PlayerInventory inv=player.getInventory();
  if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
    Material m=inv.getItemInHand().getType();
    if (m == Material.BOW) {
      backend.logBowWindUp(player);
    }
 else     if (Utilities.isFood(m)) {
      backend.logEatingStart(player);
    }
  }
  if (event.getClickedBlock() != null) {
    Distance distance=new Distance(player.getLocation(),event.getClickedBlock().getLocation());
    backend.checkLongReachBlock(player,distance.getXDifference(),distance.getYDifference(),distance.getZDifference());
  }
  Block block=event.getClickedBlock();
  if (block != null) {
    if (checkManager.willCheck(player,CheckType.VISUAL)) {
      if (backend.checkInteraction(player,block,playerClick)) {
        event.setCancelled(true);
        log("String_Node_Str",player,CheckType.VISUAL);
      }
 else {
        backend.logInteraction(player);
      }
    }
  }
}
Program: 101842
Project: 101842
Buggy source:
public boolean checkInteraction(Player player,Block targetBlock,Block playerClick){
  int strikes=0;
  double x=targetBlock.getX() - playerClick.getX() * ((targetBlock.getX() - playerClick.getX() * 1) < 0 ? -1 : 1);
  double y=targetBlock.getY() - playerClick.getY() * ((targetBlock.getY() - playerClick.getY() * 1) < 0 ? -1 : 1);
  double z=targetBlock.getZ() - playerClick.getZ() * ((targetBlock.getZ() - playerClick.getZ() * 1) < 0 ? -1 : 1);
  if (x >= VISUALS_MAXOFFSET)   strikes++;
  if (y >= VISUALS_MAXOFFSET)   strikes++;
  if (z >= VISUALS_MAXOFFSET)   strikes++;
  return strikes > 0;
}

Fixed version (ground truth):
public boolean checkInteraction(Player player,Block targetBlock,Block playerClick){
  if (isInteracting(player) && !Utilities.isInteractable(targetBlock.getType()))   return false;
  int strikes=0;
  double x=targetBlock.getX() - playerClick.getX() * ((targetBlock.getX() - playerClick.getX() * 1) < 0 ? -1 : 1);
  double y=targetBlock.getY() - playerClick.getY() * ((targetBlock.getY() - playerClick.getY() * 1) < 0 ? -1 : 1);
  double z=targetBlock.getZ() - playerClick.getZ() * ((targetBlock.getZ() - playerClick.getZ() * 1) < 0 ? -1 : 1);
  if (x >= VISUALS_MAXOFFSET)   strikes++;
  if (y >= VISUALS_MAXOFFSET)   strikes++;
  if (z >= VISUALS_MAXOFFSET)   strikes++;
  return strikes > 0;
}
Program: 101843
Project: 101843
Buggy source:
@EventHandler public void onPlayerInteract(PlayerInteractEvent event){
  Player player=event.getPlayer();
  Block playerClick=player.getTargetBlock(null,5);
  PlayerInventory inv=player.getInventory();
  if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
    Material m=inv.getItemInHand().getType();
    if (m == Material.BOW) {
      backend.logBowWindUp(player);
    }
 else     if (Utilities.isFood(m)) {
      backend.logEatingStart(player);
    }
  }
  if (event.getClickedBlock() != null) {
    Distance distance=new Distance(player.getLocation(),event.getClickedBlock().getLocation());
    backend.checkLongReachBlock(player,distance.getXDifference(),distance.getYDifference(),distance.getZDifference());
  }
  Block block=event.getClickedBlock();
  if (block != null) {
    if (checkManager.willCheck(player,CheckType.VISUAL)) {
      if (backend.checkVisuals(player,block,playerClick)) {
        event.setCancelled(true);
        log("String_Node_Str",player,CheckType.VISUAL);
      }
 else {
        backend.logInteraction(player);
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerInteract(PlayerInteractEvent event){
  Player player=event.getPlayer();
  Block playerClick=player.getTargetBlock(null,5);
  PlayerInventory inv=player.getInventory();
  if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
    Material m=inv.getItemInHand().getType();
    if (m == Material.BOW) {
      backend.logBowWindUp(player);
    }
 else     if (Utilities.isFood(m)) {
      backend.logEatingStart(player);
    }
  }
  if (event.getClickedBlock() != null) {
    Distance distance=new Distance(player.getLocation(),event.getClickedBlock().getLocation());
    backend.checkLongReachBlock(player,distance.getXDifference(),distance.getYDifference(),distance.getZDifference());
  }
  Block block=event.getClickedBlock();
  if (block != null) {
    if (checkManager.willCheck(player,CheckType.VISUAL) && !Utilities.isPressurePlate(block.getType())) {
      if (backend.checkVisuals(player,block,playerClick)) {
        event.setCancelled(true);
        log("String_Node_Str",player,CheckType.VISUAL);
      }
 else {
        backend.logInteraction(player);
      }
    }
  }
}
Program: 101844
Project: 101844
Buggy source:
@Override public void onDisable(){
  Map<String,Integer> map=manager.getPlayerManager().getLevels();
  Iterator<String> set=map.keySet().iterator();
  while (set.hasNext()) {
    String player=set.next();
    config.saveLevel(player,map.get(player));
  }
  config.saveLevels();
  getServer().getScheduler().cancelAllTasks();
}

Fixed version (ground truth):
@Override public void onDisable(){
  AnticheatManager.close();
  Map<String,Integer> map=manager.getPlayerManager().getLevels();
  Iterator<String> set=map.keySet().iterator();
  while (set.hasNext()) {
    String player=set.next();
    config.saveLevel(player,map.get(player));
  }
  config.saveLevels();
  getServer().getScheduler().cancelAllTasks();
}
Program: 101846
Project: 101846
Buggy source:
public void checkAscension(Player player,double y1,double y2){
  if (y1 < y2) {
    isAscending.add(player.getName());
  }
 else {
    isAscending.remove(player.getName());
  }
}

Fixed version (ground truth):
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player)) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}
Program: 101847
Project: 101847
Buggy source:
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player) && player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER && !Utilities.isOnLadder(player)) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player) && player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER && !Utilities.isOnLadder(player) && !player.isInsideVehicle()) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}
Program: 101848
Project: 101848
Buggy source:
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}
Program: 101850
Project: 101850
Buggy source:
public boolean checkYSpeed(Player player,double y){
  if (player.getVehicle() == null && y > Y_SPEED_MAX && !isVelocity(player)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean checkYSpeed(Player player,double y){
  if (!player.isInsideVehicle() && y > Y_SPEED_MAX && !isVelocity(player)) {
    return true;
  }
  return false;
}
Program: 101851
Project: 101851
Buggy source:
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player) && player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER && !Utilities.isOnLadder(player) && !player.isInsideVehicle()) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkAscension(Player player,double y1,double y2){
  Block block=player.getLocation().getBlock();
  if (!isMovingExempt(player) && !Utilities.isInWater(player) && !Utilities.isOnLadder(player)&& !player.isInsideVehicle()) {
    String name=player.getName();
    if (y1 < y2) {
      if (!block.getRelative(BlockFace.NORTH).isLiquid() && !block.getRelative(BlockFace.SOUTH).isLiquid() && !block.getRelative(BlockFace.EAST).isLiquid()&& !block.getRelative(BlockFace.WEST).isLiquid()) {
        increment(player,ascensionCount,ASCENSION_COUNT_MAX);
        if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
          return true;
        }
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}
Program: 101852
Project: 101852
Buggy source:
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && !player.isInsideVehicle() && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& !Utilities.isInWater(player)) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}
Program: 101854
Project: 101854
Buggy source:
@EventHandler(ignoreCancelled=true) public void checkSpeed(PlayerMoveEvent event){
  Player player=event.getPlayer();
  Location from=event.getFrom();
  Location to=event.getTo();
  Distance distance=new Distance(from,to);
  double x=distance.getXDifference();
  double y=distance.getYDifference();
  double z=distance.getZDifference();
  if (checkManager.willCheck(player,CheckType.WATER_WALK) && backend.checkWaterWalk(player,x,z)) {
    event.setTo(from);
    log("String_Node_Str",player,CheckType.WATER_WALK);
  }
  if (checkManager.willCheck(player,CheckType.SNEAK) && backend.checkSneak(player,x,z)) {
    event.setTo(from);
    player.setSneaking(false);
    log("String_Node_Str",player,CheckType.SNEAK);
  }
  if (checkManager.willCheck(player,CheckType.SPIDER) && backend.checkSpider(player,y)) {
    event.setTo(from);
    log("String_Node_Str",player,CheckType.SPIDER);
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOW,ignoreCancelled=true) public void checkSpeed(PlayerMoveEvent event){
  Player player=event.getPlayer();
  Location from=event.getFrom();
  Location to=event.getTo();
  if (event.getTo() != event.getFrom()) {
    Distance distance=new Distance(from,to);
    double x=distance.getXDifference();
    double y=distance.getYDifference();
    double z=distance.getZDifference();
    if (checkManager.willCheck(player,CheckType.WATER_WALK) && backend.checkWaterWalk(player,x,z)) {
      event.setTo(from);
      log("String_Node_Str",player,CheckType.WATER_WALK);
    }
    if (checkManager.willCheck(player,CheckType.SNEAK) && backend.checkSneak(player,x,z)) {
      event.setTo(from);
      player.setSneaking(false);
      log("String_Node_Str",player,CheckType.SNEAK);
    }
    if (checkManager.willCheck(player,CheckType.SPIDER) && backend.checkSpider(player,y)) {
      event.setTo(from);
      log("String_Node_Str",player,CheckType.SPIDER);
    }
  }
}
Program: 101855
Project: 101855
Buggy source:
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player)) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player) && !Utilities.isSubmersed(player) && !Utilities.isOnLadder(player)) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}
Program: 101856
Project: 101856
Buggy source:
public boolean checkSpider(Player player,double y){
  if (y <= LADDER_Y_MAX && y >= LADDER_Y_MIN && player.getLocation().getBlock().getType() != Material.VINE && player.getLocation().getBlock().getType() != Material.LADDER) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean checkSpider(Player player,double y){
  if (y <= LADDER_Y_MAX && y >= LADDER_Y_MIN && !Utilities.isOnLadder(player)) {
    return true;
  }
  return false;
}
Program: 101858
Project: 101858
Buggy source:
@Override public void run(){
  if (map.get(player.getName()) == obj) {
    map.remove(player.getName());
  }
}

Fixed version (ground truth):
@Override public void run(){
  map.remove(player.getName());
}
Program: 101859
Project: 101859
Buggy source:
public void logChat(Player player){
  String name=player.getName();
  if (chatLevel.get(name) == null) {
    logEvent(chatLevel,player,1,CHAT_MIN);
  }
 else {
    int amount=chatLevel.get(name) + 1;
    chatLevel.put(name,amount);
    checkChatLevel(player,amount);
  }
}

Fixed version (ground truth):
public void logChat(Player player){
  String name=player.getName();
  if (chatLevel.get(name) == null) {
    logEventNoCheck(chatLevel,player,1,CHAT_MIN);
  }
 else {
    int amount=chatLevel.get(name) + 1;
    chatLevel.put(name,amount);
    checkChatLevel(player,amount);
  }
}
Program: 101860
Project: 101860
Buggy source:
public AnticheatManager(Anticheat instance){
  plugin=instance;
  LOGGER=plugin.getAnticheatLogger();
  FILE_LOGGER=LOGGER;
  configuration=new Configuration(this);
  xrayTracker=new XRayTracker();
  playerManager=new PlayerManager(this);
  checkManager=new CheckManager(this);
  backend=new Backend(this);
  try {
    File file=new File(plugin.getDataFolder() + "String_Node_Str");
    if (!file.exists()) {
      file.mkdir();
    }
    handler=new FileHandler(plugin.getDataFolder() + "String_Node_Str",true);
    handler.setFormatter(new FileFormatter());
    handler.setLevel(Level.INFO);
  }
 catch (  IOException ex) {
    LOGGER.log(Level.SEVERE,null,ex);
  }
catch (  SecurityException ex) {
    LOGGER.log(Level.SEVERE,null,ex);
  }
  FILE_LOGGER.setUseParentHandlers(false);
  FILE_LOGGER.addHandler(handler);
  LOGGER.setUseParentHandlers(false);
  Handler chandler=new ConsoleHandler();
  chandler.setFormatter(new ConsoleFormatter());
  LOGGER.addHandler(chandler);
}

Fixed version (ground truth):
public AnticheatManager(Anticheat instance){
  plugin=instance;
  LOGGER=Logger.getLogger("String_Node_Str");
  FILE_LOGGER=Logger.getLogger("String_Node_Str");
  configuration=new Configuration(this);
  xrayTracker=new XRayTracker();
  playerManager=new PlayerManager(this);
  checkManager=new CheckManager(this);
  backend=new Backend(this);
  try {
    File file=new File(plugin.getDataFolder() + "String_Node_Str");
    if (!file.exists()) {
      file.mkdir();
    }
    fileHandler=new FileHandler(plugin.getDataFolder() + "String_Node_Str",true);
    fileHandler.setFormatter(new FileFormatter());
  }
 catch (  Exception ex) {
    LOGGER.log(Level.SEVERE,null,ex);
  }
  FILE_LOGGER.setUseParentHandlers(false);
  FILE_LOGGER.addHandler(fileHandler);
}
Program: 101861
Project: 101861
Buggy source:
public static void close(){
  handler.close();
}

Fixed version (ground truth):
public static void close(){
  fileHandler.close();
  consoleHandler.close();
}
Program: 101862
Project: 101862
Buggy source:
@Override public String format(LogRecord record){
  StringBuilder output=new StringBuilder().append("String_Node_Str").append(record.getLevel()).append('|').append(format.format(new Date(record.getMillis()))).append("String_Node_Str").append(record.getMessage()).append(' ').append(lineSep);
  return output.toString();
}

Fixed version (ground truth):
@Override public String format(LogRecord record){
  if (record.getMessage().startsWith("String_Node_Str")) {
    StringBuilder output=new StringBuilder().append("String_Node_Str").append(record.getLevel()).append('|').append(format.format(new Date(record.getMillis()))).append("String_Node_Str").append(record.getMessage()).append(' ').append(lineSep);
    return output.toString();
  }
 else {
    return "String_Node_Str";
  }
}
Program: 101863
Project: 101863
Buggy source:
public void log(String message){
  if (getConfiguration().logConsole()) {
    LOGGER.info(ChatColor.stripColor(message));
  }
  if (getConfiguration().getFileLogLevel() == LOG_LEVEL_HIGH) {
    fileLog(ChatColor.stripColor(message));
  }
}

Fixed version (ground truth):
public void log(String message){
  if (getConfiguration().logConsole()) {
    LOGGER.info("String_Node_Str" + ChatColor.stripColor(message));
  }
  if (getConfiguration().getFileLogLevel() == LOG_LEVEL_HIGH) {
    fileLog(ChatColor.stripColor(message));
  }
}
Program: 101864
Project: 101864
Buggy source:
@Override public void run(){
  map.remove(player);
}

Fixed version (ground truth):
@Override public void run(){
  if (map.get(player.getName()) == obj) {
    map.remove(player.getName());
  }
}
Program: 101865
Project: 101865
Buggy source:
public boolean justAnimated(Player player){
  return animated.contains(player.getName());
}

Fixed version (ground truth):
public boolean justAnimated(Player player){
  return animated.containsKey(player.getName());
}
Program: 101866
Project: 101866
Buggy source:
@SuppressWarnings("String_Node_Str") private void logEvent(@SuppressWarnings("String_Node_Str") final Map map,final Player player,final Object obj,long time){
  map.put(player,obj);
  micromanage.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(micromanage.getPlugin(),new Runnable(){
    @Override public void run(){
      map.remove(player);
    }
  }
,time);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void logEvent(@SuppressWarnings("String_Node_Str") final Map map,final Player player,final Object obj,long time){
  map.put(player.getName(),obj);
  micromanage.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(micromanage.getPlugin(),new Runnable(){
    @Override public void run(){
      if (map.get(player.getName()) == obj) {
        map.remove(player.getName());
      }
    }
  }
,time);
}
Program: 101867
Project: 101867
Buggy source:
public void logAnimation(final Player player){
  logEvent(animated,player,ANIMATION_MIN);
  increment(player,blockPunches,BLOCK_PUNCH_MIN);
}

Fixed version (ground truth):
public void logAnimation(final Player player){
  logEvent(animated,player,player.getLocation(),ANIMATION_MIN);
  increment(player,blockPunches,BLOCK_PUNCH_MIN);
}
Program: 101869
Project: 101869
Buggy source:
@EventHandler public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  Player player=event.getPlayer();
  if (checkManager.willCheck(player,CheckType.SPAM)) {
    backend.logChat(player);
    if (backend.checkSpam(player,event.getMessage())) {
      event.setCancelled(true);
      player.sendMessage(ChatColor.RED + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  Player player=event.getPlayer();
  if (checkManager.willCheck(player,CheckType.SPAM) && config.commandSpam()) {
    backend.logChat(player);
    if (backend.checkSpam(player,event.getMessage())) {
      event.setCancelled(true);
      player.sendMessage(ChatColor.RED + "String_Node_Str");
    }
  }
}
Program: 101870
Project: 101870
Buggy source:
@EventHandler(ignoreCancelled=true) public void onPlayerChat(PlayerChatEvent event){
  Player player=event.getPlayer();
  if (checkManager.willCheck(player,CheckType.SPAM)) {
    backend.logChat(player);
    if (backend.checkSpam(player,event.getMessage())) {
      event.setCancelled(true);
      player.sendMessage(ChatColor.RED + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@EventHandler(ignoreCancelled=true) public void onPlayerChat(PlayerChatEvent event){
  Player player=event.getPlayer();
  if (checkManager.willCheck(player,CheckType.SPAM) && config.chatSpam()) {
    backend.logChat(player);
    if (backend.checkSpam(player,event.getMessage())) {
      event.setCancelled(true);
      player.sendMessage(ChatColor.RED + "String_Node_Str");
    }
  }
}
Program: 101871
Project: 101871
Buggy source:
@EventHandler public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  Player player=event.getPlayer();
  if (checkManager.willCheck(player,CheckType.SPAM)) {
    backend.logChat(player);
  }
}

Fixed version (ground truth):
@EventHandler public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event){
  Player player=event.getPlayer();
  if (checkManager.willCheck(player,CheckType.SPAM)) {
    backend.logChat(player);
    if (backend.checkSpam(player,event.getMessage())) {
      event.setCancelled(true);
      player.sendMessage(ChatColor.RED + "String_Node_Str");
    }
  }
}
Program: 101872
Project: 101872
Buggy source:
public boolean isMovingExempt(Player player){
  return movingExempt.contains(player.getName()) || player.isFlying();
}

Fixed version (ground truth):
public boolean isMovingExempt(Player player){
  return movingExempt.contains(player.getName()) || player.isFlying() || isVelocity(player);
}
Program: 101873
Project: 101873
Buggy source:
public boolean isSpeedExempt(Player player){
  return movingExempt.contains(player.getName());
}

Fixed version (ground truth):
public boolean isSpeedExempt(Player player){
  return movingExempt.contains(player.getName()) || isVelocity(player);
}
Program: 101874
Project: 101874
Buggy source:
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player) && !Utilities.isSubmersed(player) && !Utilities.isOnLadder(player)) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkAscension(Player player,double y1,double y2){
  if (!isMovingExempt(player) && player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER && !Utilities.isOnLadder(player)) {
    String name=player.getName();
    if (y1 < y2) {
      increment(player,ascensionCount,ASCENSION_COUNT_MAX);
      if (ascensionCount.get(name) >= ASCENSION_COUNT_MAX) {
        return true;
      }
    }
 else {
      ascensionCount.put(name,0);
    }
  }
  return false;
}
Program: 101875
Project: 101875
Buggy source:
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& !Utilities.isSubmersed(player)) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && Utilities.cantStandAt(player.getLocation().getBlock())&& player.getLocation().getBlock().getType() != Material.WATER && player.getLocation().getBlock().getType() != Material.STATIONARY_WATER) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}
Program: 101876
Project: 101876
Buggy source:
public static boolean isUsingMcMMOAbility(Player player){
  boolean b=false;
  if (player.getServer().getPluginManager().getPlugin("String_Node_Str") != null) {
    if (mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.TREE_FELLER) || mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.SUPER_BREAKER) || mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.BERSERK)) {
      b=true;
    }
  }
  return b;
}

Fixed version (ground truth):
public static boolean isUsingMcMMOAbility(Player player){
  boolean b=false;
  if (player.getServer().getPluginManager().getPlugin("String_Node_Str") != null) {
    if (mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.TREE_FELLER) || mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.SUPER_BREAKER) || mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.BERSERK)|| mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.GIGA_DRILL_BREAKER)|| mcMMO.p.getPlayerProfile(player).getAbilityMode(AbilityType.BLAST_MINING)) {
      b=true;
    }
  }
  return b;
}
Program: 101877
Project: 101877
Buggy source:
@Override public void run(){
  map.remove(player.getName());
}

Fixed version (ground truth):
@Override public void run(){
  if (map.get(player.getName()) == obj) {
    map.remove(player.getName());
  }
 else {
  }
}
Program: 101878
Project: 101878
Buggy source:
@SuppressWarnings("String_Node_Str") private void logEvent(@SuppressWarnings("String_Node_Str") final Map map,final Player player,final Object obj,long time){
  map.put(player.getName(),obj);
  micromanage.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(micromanage.getPlugin(),new Runnable(){
    @Override public void run(){
      if (map.get(player.getName()) == obj) {
        map.remove(player.getName());
      }
    }
  }
,time);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void logEvent(@SuppressWarnings("String_Node_Str") final Map map,final Player player,final Object obj,long time){
  map.put(player.getName(),obj);
  micromanage.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(micromanage.getPlugin(),new Runnable(){
    @Override public void run(){
      if (map.get(player.getName()) == obj) {
        map.remove(player.getName());
      }
 else {
      }
    }
  }
,time);
}
Program: 101879
Project: 101879
Buggy source:
public void logChat(Player player){
  String name=player.getName();
  if (chatLevel.get(name) == null) {
    logEventNoCheck(chatLevel,player,1,CHAT_MIN);
  }
 else {
    int amount=chatLevel.get(name) + 1;
    chatLevel.put(name,amount);
    checkChatLevel(player,amount);
  }
}

Fixed version (ground truth):
public void logChat(Player player){
  String name=player.getName();
  if (chatLevel.get(name) == null) {
    logEvent(chatLevel,player,1,CHAT_MIN);
  }
 else {
    int amount=chatLevel.get(name) + 1;
    logEvent(chatLevel,player,amount,CHAT_MIN);
    checkChatLevel(player,amount);
  }
}
Program: 101881
Project: 101881
Buggy source:
public void fileLog(String message){
  FILE_LOGGER.log(Level.WARNING,message);
}

Fixed version (ground truth):
public void fileLog(String message){
  FILE_LOGGER.warning(message);
}
Program: 101882
Project: 101882
Buggy source:
public void log(String message){
  if (getConfiguration().logConsole()) {
    LOGGER.log(Level.WARNING,"String_Node_Str".concat(message));
  }
  if (getConfiguration().getFileLogLevel() == LOG_LEVEL_HIGH) {
    fileLog(message);
  }
}

Fixed version (ground truth):
public void log(String message){
  if (getConfiguration().logConsole()) {
    LOGGER.warning(message);
  }
  if (getConfiguration().getFileLogLevel() == LOG_LEVEL_HIGH) {
    fileLog(message);
  }
}
Program: 101883
Project: 101883
Buggy source:
public AnticheatManager(Anticheat instance){
  plugin=instance;
  configuration=new Configuration(this);
  xrayTracker=new XRayTracker();
  playerManager=new PlayerManager(this);
  checkManager=new CheckManager(this);
  backend=new Backend(this);
  try {
    File file=new File(plugin.getDataFolder() + "String_Node_Str");
    if (!file.exists()) {
      file.mkdir();
    }
    handler=new FileHandler(plugin.getDataFolder() + "String_Node_Str",true);
  }
 catch (  IOException ex) {
    LOGGER.log(Level.SEVERE,null,ex);
  }
catch (  SecurityException ex) {
    LOGGER.log(Level.SEVERE,null,ex);
  }
  handler.setFormatter(new SimpleFormatter());
  FILE_LOGGER.setUseParentHandlers(false);
  FILE_LOGGER.addHandler(handler);
}

Fixed version (ground truth):
public AnticheatManager(Anticheat instance){
  plugin=instance;
  LOGGER=plugin.getAnticheatLogger();
  FILE_LOGGER=LOGGER;
  configuration=new Configuration(this);
  xrayTracker=new XRayTracker();
  playerManager=new PlayerManager(this);
  checkManager=new CheckManager(this);
  backend=new Backend(this);
  try {
    File file=new File(plugin.getDataFolder() + "String_Node_Str");
    if (!file.exists()) {
      file.mkdir();
    }
    handler=new FileHandler(plugin.getDataFolder() + "String_Node_Str",true);
    handler.setFormatter(new FileFormatter());
  }
 catch (  IOException ex) {
    LOGGER.log(Level.SEVERE,null,ex);
  }
catch (  SecurityException ex) {
    LOGGER.log(Level.SEVERE,null,ex);
  }
  FILE_LOGGER.setUseParentHandlers(false);
  FILE_LOGGER.addHandler(handler);
  LOGGER.setUseParentHandlers(false);
  Handler chandler=new ConsoleHandler();
  chandler.setFormatter(new ConsoleFormatter());
  LOGGER.addHandler(chandler);
}
Program: 101886
Project: 101886
Buggy source:
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && !Utilities.canStand(player.getLocation().getBlock())) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean checkFlight(Player player,Distance distance){
  if (distance.getYDifference() > 400) {
    return false;
  }
  double y1=distance.fromY();
  double y2=distance.toY();
  Block block=player.getLocation().getBlock().getRelative(BlockFace.DOWN);
  if (y1 == y2 && !isMovingExempt(player) && player.getVehicle() == null && player.getFallDistance() == 0 && !Utilities.isOnLilyPad(player)) {
    String name=player.getName();
    if (Utilities.cantStandAt(block) && !Utilities.isOnLilyPad(player) && !Utilities.canStand(player.getLocation().getBlock())&& !Utilities.isSubmersed(player)) {
      int violation=1;
      if (!flightViolation.containsKey(name)) {
        flightViolation.put(name,violation);
      }
 else {
        violation=flightViolation.get(name) + 1;
        flightViolation.put(name,violation);
      }
      if (violation >= FLIGHT_LIMIT) {
        flightViolation.put(name,1);
        return true;
      }
      if (flightViolation.containsKey(name) && flightViolation.get(name) > 0) {
        for (int i=FLY_LOOP; i > 0; i--) {
          Location newLocation=new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() - i,player.getLocation().getZ());
          Block lower=newLocation.getBlock();
          if (lower.getTypeId() == 0) {
            player.teleport(newLocation);
            break;
          }
        }
      }
    }
  }
  return false;
}
Program: 101887
Project: 101887
Buggy source:
public boolean checkXZSpeed(Player player,double x,double z){
  if (!isSpeedExempt(player) && player.getVehicle() == null) {
    if (player.isFlying()) {
      return x > XZ_SPEED_MAX_FLY || z > XZ_SPEED_MAX_FLY;
    }
    if (!player.isSprinting()) {
      return x > XZ_SPEED_MAX || z > XZ_SPEED_MAX;
    }
 else {
      return x > XZ_SPEED_MAX_SPRINT || z > XZ_SPEED_MAX_SPRINT;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean checkXZSpeed(Player player,double x,double z){
  if (!isSpeedExempt(player) && player.getVehicle() == null) {
    if (player.isFlying()) {
      return x > XZ_SPEED_MAX_FLY || z > XZ_SPEED_MAX_FLY;
    }
    if (!player.isSprinting()) {
      return x > XZ_SPEED_MAX || z > XZ_SPEED_MAX;
    }
 else     if (player.hasPotionEffect(PotionEffectType.SPEED)) {
      return x > XZ_SPEED_MAX_POTION || z > XZ_SPEED_MAX_POTION;
    }
 else {
      return x > XZ_SPEED_MAX_SPRINT || z > XZ_SPEED_MAX_SPRINT;
    }
  }
 else {
    return false;
  }
}
Program: 101889
Project: 101889
Buggy source:
public boolean checkSwing(Player player,Block block){
  return !player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !Utilities.isInstantBreak(block.getType()) && !justAnimated(player)&& !Utilities.isUsingMcMMOAbility(player);
}

Fixed version (ground truth):
public boolean checkSwing(Player player,Block block){
  return !player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !Utilities.isInstantBreak(block.getType()) && !justAnimated(player)&& !Utilities.isUsingMcMMOAbility(player)&& !(player.getInventory().getItemInHand().getType() == Material.SHEARS && block.getType() == Material.LEAVES);
}