Program: 172362
Project: 172362
Buggy source:
/** 
 * 发奖励，活动结束或者所有boss打死
 */
private void sendAward(){
  try {
    awardLock.lock();
    if (worldBossData.isbAward()) {
      return;
    }
    players.clear();
    worldBossData.setbAward(true);
    messageService.sendSysMsg(4);
    multiService.clearGroup(Scene.WORLD_BOSSS_PVE);
    List<HurtRecord> list=new ArrayList<>(worldBossData.getHurtMap().values());
    Collections.sort(list,SORT);
    List<GoodsEntry> killRewards=new ArrayList<>();
    Map<Integer,int[]> lastBeatReward=ConfigData.globalParam().worldBossLastFightReward;
    Map<Integer,int[]> killReward=ConfigData.globalParam().worldBossKillReward;
    Map<Integer,List<GoodsEntry>> beatRewardMap=new HashMap<>();
    for (    Map.Entry<Integer,Integer> s : worldBossData.getKillMap().entrySet()) {
      List<GoodsEntry> lastBeatRewards=beatRewardMap.get(s.getValue());
      if (lastBeatRewards == null) {
        lastBeatRewards=new ArrayList<>();
        beatRewardMap.put(s.getValue(),lastBeatRewards);
      }
      int[] nArr=lastBeatReward.get(s.getKey());
      for (int k=0; k < nArr.length; k+=2) {
        GoodsEntry goodsEntry=new GoodsEntry(nArr[k],nArr[k + 1]);
        lastBeatRewards.add(goodsEntry);
      }
      nArr=killReward.get(s.getKey());
      for (int k=0; k < nArr.length; k+=2) {
        GoodsEntry goodsEntry=new GoodsEntry(nArr[k],nArr[k + 1]);
        killRewards.add(goodsEntry);
      }
    }
    String lastTitle=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_LAST_BEAT_TITLE).tips;
    String lastContent=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_LAST_BEAT_CONTENT).tips;
    for (    Map.Entry<Integer,List<GoodsEntry>> s3 : beatRewardMap.entrySet()) {
      mailService.sendSysMail(lastTitle,lastContent,s3.getValue(),s3.getKey(),LogConsume.WORLD_BOSS_LAST_BEAT);
    }
    List<GoodsEntry> rewards=new ArrayList<>();
    int[][] rankReward=ConfigData.globalParam().worldBossReward;
    int[][] rankRewardRank=ConfigData.globalParam().worldBossRewardRank;
    int rankLen=rankRewardRank.length;
    WorldBossReward rewardCli=new WorldBossReward();
    rewardCli.hurtReward=new ArrayList<>();
    rewardCli.rankReward=new ArrayList<>();
    for (int i=0; i < list.size(); i++) {
      HurtRecord hr=list.get(i);
      int rank=i + 1;
      hr.setRank(rank);
      rewards.clear();
      for (int k=0; k < rankLen; k++) {
        int[] rankArr=rankRewardRank[k];
        int minRank=rankArr[0];
        int maxRank=rankArr[1];
        if (rank >= minRank && rank <= maxRank) {
          int[] nArr=rankReward[k];
          for (int n=0; n < nArr.length; n+=2) {
            GoodsEntry goodsEntry=new GoodsEntry(nArr[n],nArr[n + 1]);
            rewards.add(goodsEntry);
            Reward reward=new Reward();
            reward.count=nArr[n + 1];
            reward.id=nArr[n];
            rewardCli.rankReward.add(reward);
          }
          break;
        }
      }
      int itemId=ConfigData.globalParam().worldBossHurtReward[0];
      int num=ConfigData.globalParam().worldBossHurtReward[1];
      rewards.add(new GoodsEntry(itemId,num));
      Reward reward=new Reward();
      reward.count=itemId;
      reward.id=num;
      rewardCli.hurtReward.add(reward);
      String killTitle=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_TITLE).tips;
      String killContent=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_CONTENT).tips;
      String beatTitle=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_TITLE).tips;
      String beatContent=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_CONTENT).tips;
      mailService.sendSysMail(killTitle,killContent,rewards,hr.getPlayerId(),LogConsume.WORLD_BOSS_REWARD);
      if (!killRewards.isEmpty()) {
        mailService.sendSysMail(beatTitle,beatContent,killRewards,hr.getPlayerId(),LogConsume.WORLD_BOSS_KILL);
      }
    }
    saveData();
  }
  finally {
    awardLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * 发奖励，活动结束或者所有boss打死
 */
private void sendAward(){
  try {
    awardLock.lock();
    if (worldBossData.isbAward()) {
      return;
    }
    players.clear();
    worldBossData.setbAward(true);
    messageService.sendSysMsg(4);
    multiService.clearGroup(Scene.WORLD_BOSSS_PVE);
    List<GoodsEntry> killRewards=new ArrayList<>();
    Map<Integer,int[]> lastBeatReward=ConfigData.globalParam().worldBossLastFightReward;
    Map<Integer,int[]> killReward=ConfigData.globalParam().worldBossKillReward;
    Map<Integer,List<GoodsEntry>> beatRewardMap=new HashMap<>();
    for (    Map.Entry<Integer,Integer> s : worldBossData.getKillMap().entrySet()) {
      List<GoodsEntry> lastBeatRewards=beatRewardMap.get(s.getValue());
      if (lastBeatRewards == null) {
        lastBeatRewards=new ArrayList<>();
        beatRewardMap.put(s.getValue(),lastBeatRewards);
      }
      int[] nArr=lastBeatReward.get(s.getKey());
      for (int k=0; k < nArr.length; k+=2) {
        GoodsEntry goodsEntry=new GoodsEntry(nArr[k],nArr[k + 1]);
        lastBeatRewards.add(goodsEntry);
      }
      nArr=killReward.get(s.getKey());
      for (int k=0; k < nArr.length; k+=2) {
        GoodsEntry goodsEntry=new GoodsEntry(nArr[k],nArr[k + 1]);
        killRewards.add(goodsEntry);
      }
    }
    String lastTitle=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_LAST_BEAT_TITLE).tips;
    String lastContent=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_LAST_BEAT_CONTENT).tips;
    for (    Map.Entry<Integer,List<GoodsEntry>> s3 : beatRewardMap.entrySet()) {
      mailService.sendSysMail(lastTitle,lastContent,s3.getValue(),s3.getKey(),LogConsume.WORLD_BOSS_LAST_BEAT);
    }
    List<GoodsEntry> rewards=new ArrayList<>();
    int[][] rankReward=ConfigData.globalParam().worldBossReward;
    int[][] rankRewardRank=ConfigData.globalParam().worldBossRewardRank;
    int rankLen=rankRewardRank.length;
    WorldBossReward rewardCli=new WorldBossReward();
    rewardCli.hurtReward=new ArrayList<>();
    rewardCli.rankReward=new ArrayList<>();
    List<HurtRecord> list=hurtRank();
    for (int i=0; i < list.size(); i++) {
      HurtRecord hr=list.get(i);
      int rank=i + 1;
      hr.setRank(rank);
      rewards.clear();
      for (int k=0; k < rankLen; k++) {
        int[] rankArr=rankRewardRank[k];
        int minRank=rankArr[0];
        int maxRank=rankArr[1];
        if (rank >= minRank && rank <= maxRank) {
          int[] nArr=rankReward[k];
          for (int n=0; n < nArr.length; n+=2) {
            GoodsEntry goodsEntry=new GoodsEntry(nArr[n],nArr[n + 1]);
            rewards.add(goodsEntry);
            Reward reward=new Reward();
            reward.count=nArr[n + 1];
            reward.id=nArr[n];
            rewardCli.rankReward.add(reward);
          }
          break;
        }
      }
      int itemId=ConfigData.globalParam().worldBossHurtReward[0];
      int num=ConfigData.globalParam().worldBossHurtReward[1];
      rewards.add(new GoodsEntry(itemId,num));
      Reward reward=new Reward();
      reward.count=itemId;
      reward.id=num;
      rewardCli.hurtReward.add(reward);
      String killTitle=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_TITLE).tips;
      String killContent=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_CONTENT).tips;
      String beatTitle=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_TITLE).tips;
      String beatContent=ConfigData.getConfig(ErrCode.class,Response.WORLD_BOSS_KILL_CONTENT).tips;
      mailService.sendSysMail(killTitle,killContent,rewards,hr.getPlayerId(),LogConsume.WORLD_BOSS_REWARD);
      if (!killRewards.isEmpty()) {
        mailService.sendSysMail(beatTitle,beatContent,killRewards,hr.getPlayerId(),LogConsume.WORLD_BOSS_KILL);
      }
    }
    saveData();
  }
  finally {
    awardLock.unlock();
  }
}