Program: 34031
Project: 34031
Buggy source:
/** 
 * Calculates the level of an island
 * @param plugin
 * @param targetPlayer
 * @param asker
 */
public LevelCalcByChunk(final ASkyBlock plugin,final UUID targetPlayer,final Player asker,final boolean silent){
  Island island=plugin.getGrid().getIsland(targetPlayer);
  if (island != null) {
    World world=island.getCenter().getWorld();
    Set<ChunkSnapshot> chunkSnapshot=new HashSet<ChunkSnapshot>();
    for (int x=new BigDecimal((double)island.getMinProtectedX() / 16).setScale(0,BigDecimal.ROUND_DOWN).intValue(); x <= new BigDecimal((double)(island.getMinProtectedX() + island.getProtectionSize() - 1) / 16).setScale(0,BigDecimal.ROUND_UP).intValue(); x++) {
      for (int z=new BigDecimal((double)island.getMinProtectedZ() / 16).setScale(0,BigDecimal.ROUND_DOWN).intValue(); z <= new BigDecimal((double)(island.getMinProtectedZ() + island.getProtectionSize() - 1) / 16).setScale(0,BigDecimal.ROUND_UP).intValue(); z++) {
        chunkSnapshot.add(world.getChunkAt(x,z).getChunkSnapshot());
      }
    }
    final Set<ChunkSnapshot> finalChunk=chunkSnapshot;
    final int worldHeight=world.getMaxHeight();
    plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
      @SuppressWarnings("String_Node_Str") @Override public void run(){
        HashMap<MaterialData,Integer> limitCount=new HashMap<MaterialData,Integer>();
        for (        MaterialData m : Settings.blockLimits.keySet()) {
          limitCount.put(m,Settings.blockLimits.get(m));
        }
        int blockCount=0;
        int underWaterBlockCount=0;
        for (        ChunkSnapshot chunk : finalChunk) {
          for (int x=0; x < 16; x++) {
            for (int y=0; y < worldHeight; y++) {
              for (int z=0; z < 16; z++) {
                int type=chunk.getBlockTypeId(x,y,z);
                int data=chunk.getBlockData(x,y,z);
                MaterialData md=new MaterialData(type,(byte)data);
                MaterialData generic=new MaterialData(type);
                if (type != 0) {
                  if (limitCount.containsKey(md) && Settings.blockValues.containsKey(md)) {
                    int count=limitCount.get(md);
                    if (count > 0) {
                      limitCount.put(md,--count);
                      if (y < Settings.sea_level) {
                        underWaterBlockCount+=Settings.blockValues.get(md);
                      }
 else {
                        blockCount+=Settings.blockValues.get(md);
                      }
                    }
                  }
 else                   if (limitCount.containsKey(generic) && Settings.blockValues.containsKey(generic)) {
                    int count=limitCount.get(generic);
                    if (count > 0) {
                      limitCount.put(md,--count);
                      if (y < Settings.sea_level) {
                        underWaterBlockCount+=Settings.blockValues.get(generic);
                      }
 else {
                        blockCount+=Settings.blockValues.get(generic);
                      }
                    }
                  }
 else                   if (Settings.blockValues.containsKey(md)) {
                    if (y < Settings.sea_level) {
                      underWaterBlockCount+=Settings.blockValues.get(md);
                    }
 else {
                      blockCount+=Settings.blockValues.get(md);
                    }
                  }
 else                   if (Settings.blockValues.containsKey(generic)) {
                    if (y < Settings.sea_level) {
                      underWaterBlockCount+=Settings.blockValues.get(generic);
                    }
 else {
                      blockCount+=Settings.blockValues.get(generic);
                    }
                  }
                }
              }
            }
          }
        }
        blockCount+=(int)((double)underWaterBlockCount * Math.max(Settings.underWaterMultiplier,1D));
        final int score=blockCount / Settings.levelCost;
        plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
          @Override public void run(){
            int oldLevel=plugin.getPlayers().getIslandLevel(targetPlayer);
            plugin.getPlayers().setIslandLevel(targetPlayer,score);
            plugin.getPlayers().save(targetPlayer);
            if (plugin.getPlayers().inTeam(targetPlayer)) {
              for (              UUID member : plugin.getPlayers().getMembers(targetPlayer)) {
                plugin.getPlayers().setIslandLevel(member,score);
                plugin.getPlayers().save(member);
              }
            }
            if (!silent) {
              if (plugin.getPlayers().getIslandLevel(targetPlayer) > oldLevel) {
                plugin.getMessages().tellOfflineTeam(targetPlayer,ChatColor.GREEN + plugin.myLocale(targetPlayer).islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
              }
              if (asker.isOnline()) {
                asker.sendMessage(ChatColor.GREEN + plugin.myLocale(asker.getUniqueId()).islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
              }
            }
            if (!(asker.getUniqueId().equals(targetPlayer) && asker.hasPermission(Settings.PERMPREFIX + "String_Node_Str"))) {
              if (plugin.getPlayers().inTeam(targetPlayer)) {
                UUID leader=plugin.getPlayers().getTeamLeader(targetPlayer);
                if (leader != null) {
                  TopTen.topTenAddEntry(leader,score);
                }
              }
 else {
                TopTen.topTenAddEntry(targetPlayer,score);
              }
            }
            final IslandLevelEvent event=new IslandLevelEvent(plugin,targetPlayer,score);
            plugin.getServer().getPluginManager().callEvent(event);
          }
        }
);
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Calculates the level of an island
 * @param plugin
 * @param targetPlayer
 * @param asker
 */
public LevelCalcByChunk(final ASkyBlock plugin,final UUID targetPlayer,final Player asker,final boolean silent){
  Island island=plugin.getGrid().getIsland(targetPlayer);
  if (island != null) {
    World world=plugin.getPlayers().getHomeLocation(targetPlayer).getWorld();
    Set<ChunkSnapshot> chunkSnapshot=new HashSet<ChunkSnapshot>();
    for (int x=new BigDecimal((double)island.getMinProtectedX() / 16).setScale(0,BigDecimal.ROUND_DOWN).intValue(); x <= new BigDecimal((double)(island.getMinProtectedX() + island.getProtectionSize() - 1) / 16).setScale(0,BigDecimal.ROUND_UP).intValue(); x++) {
      for (int z=new BigDecimal((double)island.getMinProtectedZ() / 16).setScale(0,BigDecimal.ROUND_DOWN).intValue(); z <= new BigDecimal((double)(island.getMinProtectedZ() + island.getProtectionSize() - 1) / 16).setScale(0,BigDecimal.ROUND_UP).intValue(); z++) {
        chunkSnapshot.add(world.getChunkAt(x,z).getChunkSnapshot());
      }
    }
    final Set<ChunkSnapshot> finalChunk=chunkSnapshot;
    final int worldHeight=world.getMaxHeight();
    plugin.getServer().getScheduler().runTaskAsynchronously(plugin,new Runnable(){
      @SuppressWarnings("String_Node_Str") @Override public void run(){
        HashMap<MaterialData,Integer> limitCount=new HashMap<MaterialData,Integer>();
        for (        MaterialData m : Settings.blockLimits.keySet()) {
          limitCount.put(m,Settings.blockLimits.get(m));
        }
        int blockCount=0;
        int underWaterBlockCount=0;
        for (        ChunkSnapshot chunk : finalChunk) {
          for (int x=0; x < 16; x++) {
            for (int y=0; y < worldHeight; y++) {
              for (int z=0; z < 16; z++) {
                int type=chunk.getBlockTypeId(x,y,z);
                int data=chunk.getBlockData(x,y,z);
                MaterialData md=new MaterialData(type,(byte)data);
                MaterialData generic=new MaterialData(type);
                if (type != 0) {
                  if (limitCount.containsKey(md) && Settings.blockValues.containsKey(md)) {
                    int count=limitCount.get(md);
                    if (count > 0) {
                      limitCount.put(md,--count);
                      if (y < Settings.sea_level) {
                        underWaterBlockCount+=Settings.blockValues.get(md);
                      }
 else {
                        blockCount+=Settings.blockValues.get(md);
                      }
                    }
                  }
 else                   if (limitCount.containsKey(generic) && Settings.blockValues.containsKey(generic)) {
                    int count=limitCount.get(generic);
                    if (count > 0) {
                      limitCount.put(md,--count);
                      if (y < Settings.sea_level) {
                        underWaterBlockCount+=Settings.blockValues.get(generic);
                      }
 else {
                        blockCount+=Settings.blockValues.get(generic);
                      }
                    }
                  }
 else                   if (Settings.blockValues.containsKey(md)) {
                    if (y < Settings.sea_level) {
                      underWaterBlockCount+=Settings.blockValues.get(md);
                    }
 else {
                      blockCount+=Settings.blockValues.get(md);
                    }
                  }
 else                   if (Settings.blockValues.containsKey(generic)) {
                    if (y < Settings.sea_level) {
                      underWaterBlockCount+=Settings.blockValues.get(generic);
                    }
 else {
                      blockCount+=Settings.blockValues.get(generic);
                    }
                  }
                }
              }
            }
          }
        }
        blockCount+=(int)((double)underWaterBlockCount * Math.max(Settings.underWaterMultiplier,1D));
        final int score=blockCount / Settings.levelCost;
        plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
          @Override public void run(){
            int oldLevel=plugin.getPlayers().getIslandLevel(targetPlayer);
            plugin.getPlayers().setIslandLevel(targetPlayer,score);
            plugin.getPlayers().save(targetPlayer);
            if (plugin.getPlayers().inTeam(targetPlayer)) {
              for (              UUID member : plugin.getPlayers().getMembers(targetPlayer)) {
                plugin.getPlayers().setIslandLevel(member,score);
                plugin.getPlayers().save(member);
              }
            }
            if (!silent) {
              if (plugin.getPlayers().getIslandLevel(targetPlayer) > oldLevel) {
                plugin.getMessages().tellOfflineTeam(targetPlayer,ChatColor.GREEN + plugin.myLocale(targetPlayer).islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
              }
              if (asker.isOnline()) {
                asker.sendMessage(ChatColor.GREEN + plugin.myLocale(asker.getUniqueId()).islandislandLevelis + "String_Node_Str"+ ChatColor.WHITE+ plugin.getPlayers().getIslandLevel(targetPlayer));
              }
            }
            if (!(asker.getUniqueId().equals(targetPlayer) && asker.hasPermission(Settings.PERMPREFIX + "String_Node_Str"))) {
              if (plugin.getPlayers().inTeam(targetPlayer)) {
                UUID leader=plugin.getPlayers().getTeamLeader(targetPlayer);
                if (leader != null) {
                  TopTen.topTenAddEntry(leader,score);
                }
              }
 else {
                TopTen.topTenAddEntry(targetPlayer,score);
              }
            }
            final IslandLevelEvent event=new IslandLevelEvent(plugin,targetPlayer,score);
            plugin.getServer().getPluginManager().callEvent(event);
          }
        }
);
      }
    }
);
  }
}