#vulnerable code 
                              @Override
  public int compare(Solution o1, Solution o2) {
    if (o1 == null) {
      return 1;
    } else if (o2 == null) {
      return -1;
    }

    int flagComparatorRank = RANK_COMPARATOR.compare(o1, o2);
    if (flagComparatorRank != 0) {
      return flagComparatorRank;
    }
    
    /* His rank is equal, then distance crowding RANK_COMPARATOR */
    double distance1 = (double)o1.getAttributes().getAttribute("CrowdingDistance");
    double distance2 = (double)o2.getAttributes().getAttribute("CrowdingDistance");
    if (distance1 > distance2) {
      return -1;
    }

    if (distance1 < distance2) {
      return 1;
    }

    return 0;
  } 
                            #location 15 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              @Override
  public int compare(Solution o1, Solution o2) {
    if (o1 == null) {
      return 1;
    } else if (o2 == null) {
      return -1;
    }

    int flagComparatorRank = RANK_COMPARATOR.compare(o1, o2);
    if (flagComparatorRank != 0) {
      return flagComparatorRank;
    }
    
    /* His rank is equal, then distance crowding RANK_COMPARATOR */
    double distance1 = (double)o1.getAlgorithmAttributes().getAttribute("CrowdingDistance");
    double distance2 = (double)o2.getAlgorithmAttributes().getAttribute("CrowdingDistance");
    if (distance1 > distance2) {
      return -1;
    }

    if (distance1 < distance2) {
      return 1;
    }

    return 0;
  }