Program: 57917
Project: 57917
Buggy source:
public boolean checkEntity(Entity entity,Plot plot){
  if (plot == null || plot.owner == null || plot.getFlags().isEmpty() && plot.getArea().DEFAULT_FLAGS.isEmpty()) {
    return false;
  }
switch (entity.getType()) {
case PLAYER:
    return false;
case SMALL_FIREBALL:
case FIREBALL:
case DROPPED_ITEM:
case EGG:
case THROWN_EXP_BOTTLE:
case SPLASH_POTION:
case LINGERING_POTION:
case SNOWBALL:
case ENDER_PEARL:
case ARROW:
case TIPPED_ARROW:
case SPECTRAL_ARROW:
case SHULKER_BULLET:
case DRAGON_FIREBALL:
case PRIMED_TNT:
case FALLING_BLOCK:
case ENDER_CRYSTAL:
case COMPLEX_PART:
case FISHING_HOOK:
case ENDER_SIGNAL:
case EXPERIENCE_ORB:
case LEASH_HITCH:
case FIREWORK:
case WEATHER:
case AREA_EFFECT_CLOUD:
case LIGHTNING:
case WITHER_SKULL:
case UNKNOWN:
  return checkEntity(plot,Flags.ENTITY_CAP);
case ITEM_FRAME:
case PAINTING:
case ARMOR_STAND:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MISC_CAP);
case MINECART:
case MINECART_CHEST:
case MINECART_COMMAND:
case MINECART_FURNACE:
case MINECART_HOPPER:
case MINECART_MOB_SPAWNER:
case MINECART_TNT:
case BOAT:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.VEHICLE_CAP);
case RABBIT:
case SHEEP:
case MUSHROOM_COW:
case OCELOT:
case PIG:
case SQUID:
case VILLAGER:
case IRON_GOLEM:
case WOLF:
case CHICKEN:
case COW:
case SNOWMAN:
case BAT:
case HORSE:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.ANIMAL_CAP);
case BLAZE:
case CAVE_SPIDER:
case CREEPER:
case ENDERMAN:
case ENDERMITE:
case ENDER_DRAGON:
case GHAST:
case GIANT:
case GUARDIAN:
case MAGMA_CUBE:
case PIG_ZOMBIE:
case SILVERFISH:
case SKELETON:
case SLIME:
case SPIDER:
case WITCH:
case WITHER:
case ZOMBIE:
case SHULKER:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.HOSTILE_CAP);
default :
if (entity instanceof LivingEntity) {
if (entity instanceof Animals) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.ANIMAL_CAP);
}
 else if (entity instanceof Monster) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.HOSTILE_CAP);
}
 else {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP);
}
}
 else if (entity instanceof Vehicle) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.VEHICLE_CAP);
}
 else if (entity instanceof Hanging) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MISC_CAP);
}
return checkEntity(plot,Flags.ENTITY_CAP);
}
}

Fixed version (ground truth):
public boolean checkEntity(Entity entity,Plot plot){
  if (plot == null || !plot.hasOwner() || plot.getFlags().isEmpty() && plot.getArea().DEFAULT_FLAGS.isEmpty()) {
    return false;
  }
switch (entity.getType()) {
case PLAYER:
    return false;
case SMALL_FIREBALL:
case FIREBALL:
case DROPPED_ITEM:
case EGG:
case THROWN_EXP_BOTTLE:
case SPLASH_POTION:
case LINGERING_POTION:
case SNOWBALL:
case ENDER_PEARL:
case ARROW:
case TIPPED_ARROW:
case SPECTRAL_ARROW:
case SHULKER_BULLET:
case DRAGON_FIREBALL:
case PRIMED_TNT:
case FALLING_BLOCK:
case ENDER_CRYSTAL:
case COMPLEX_PART:
case FISHING_HOOK:
case ENDER_SIGNAL:
case EXPERIENCE_ORB:
case LEASH_HITCH:
case FIREWORK:
case WEATHER:
case AREA_EFFECT_CLOUD:
case LIGHTNING:
case WITHER_SKULL:
case UNKNOWN:
  return checkEntity(plot,Flags.ENTITY_CAP);
case ITEM_FRAME:
case PAINTING:
case ARMOR_STAND:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MISC_CAP);
case MINECART:
case MINECART_CHEST:
case MINECART_COMMAND:
case MINECART_FURNACE:
case MINECART_HOPPER:
case MINECART_MOB_SPAWNER:
case MINECART_TNT:
case BOAT:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.VEHICLE_CAP);
case RABBIT:
case SHEEP:
case MUSHROOM_COW:
case OCELOT:
case PIG:
case SQUID:
case VILLAGER:
case IRON_GOLEM:
case WOLF:
case CHICKEN:
case COW:
case SNOWMAN:
case BAT:
case HORSE:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.ANIMAL_CAP);
case BLAZE:
case CAVE_SPIDER:
case CREEPER:
case ENDERMAN:
case ENDERMITE:
case ENDER_DRAGON:
case GHAST:
case GIANT:
case GUARDIAN:
case MAGMA_CUBE:
case PIG_ZOMBIE:
case SILVERFISH:
case SKELETON:
case SLIME:
case SPIDER:
case WITCH:
case WITHER:
case ZOMBIE:
case SHULKER:
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.HOSTILE_CAP);
default :
if (entity instanceof LivingEntity) {
if (entity instanceof Animals) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.ANIMAL_CAP);
}
 else if (entity instanceof Monster) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP,Flags.HOSTILE_CAP);
}
 else {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MOB_CAP);
}
}
if (entity instanceof Vehicle) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.VEHICLE_CAP);
}
if (entity instanceof Hanging) {
return checkEntity(plot,Flags.ENTITY_CAP,Flags.MISC_CAP);
}
return checkEntity(plot,Flags.ENTITY_CAP);
}
}