Project

General

Profile

« Previous | Next » 

Revision 09023b8d

Added by Andreas Kohlbecker almost 8 years ago

fixing bugs related to the rank intervall in the TransmissionEngineDistribution

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/ClassificationLookupDTO.java
88 88
        Collection<Integer> idsForRank = taxonIdByRank.get(rank);
89 89
        taxonIdByRank.remove(rank);
90 90

  
91
        for(Integer taxonId : idsForRank) {
92
            Integer parentId = taxonIdToParentId.get(taxonId);
93
            taxonIdToParentId.remove(taxonId);
94
            childTaxonMap.remove(parentId);
91
        if(idsForRank != null) {
92
            for(Integer taxonId : idsForRank) {
93
                Integer parentId = taxonIdToParentId.get(taxonId);
94
                taxonIdToParentId.remove(taxonId);
95
                childTaxonMap.remove(parentId);
96
            }
95 97
        }
96 98
    }
97 99

  
98 100
    /**
99
     * @param ranks
101
     * Drops all ranks from the classifiacationLookupDTO except those
102
     * listed in ranks.
103
     *
104
     * @param includeRanks
100 105
     */
101
    public void filter(List<Rank> ranks) {
102
       for(Rank rank : ranks) {
103
           dropRank(rank);
106
    public void filterInclude(List<Rank> includeRanks) {
107

  
108
       Set<Rank> rankSet = new HashSet<Rank>(taxonIdByRank.keySet());
109
       for(Rank rank : rankSet) {
110
           if(!includeRanks.contains(rank)) {
111
               dropRank(rank);
112
           }
104 113
       }
105 114
    }
106 115

  

Also available in: Unified diff