Project

General

Profile

« Previous | Next » 

Revision 3056cfa7

Added by Andreas Müller almost 8 years ago

#5838 Fix taxon cache strategy for taxa with missing name

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategy.java
66 66

  
67 67
            if (nameTags.size() > 0){
68 68
                tags.addAll(nameTags);
69
            }else{
70
                tags.add(new TaggedText(TagEnum.fullName, "???"));
71
            }
69 72

  
70
                boolean isSynonym = taxonBase.isInstanceOf(Synonym.class);
71
                String secSeparator =  (isSynonym? " syn." : "") + " sec. ";
72
                //not used: we currently use a post-separator in the name tags
73
            boolean isSynonym = taxonBase.isInstanceOf(Synonym.class);
74
            String secSeparator =  (isSynonym? " syn." : "") + " sec. ";
75
            //not used: we currently use a post-separator in the name tags
73 76
//                if (nameTags.get(nameTags.size() - 1).getType().equals(TagEnum.nomStatus)){
74 77
//                    secSeparator = "," + secSeparator;
75 78
//                }
76 79

  
77
                //ref.
78
                List<TaggedText> secTags = getSecundumTags(taxonBase);
80
            //ref.
81
            List<TaggedText> secTags = getSecundumTags(taxonBase);
79 82

  
80
                //sec.
81
                if (!secTags.isEmpty()){
82
                    tags.add(new TaggedText(TagEnum.separator, secSeparator));
83
                    tags.addAll(secTags);
84
                }
85

  
86
            }else{
87
                tags.add(new TaggedText(TagEnum.fullName, taxonBase.toString()));
83
            //sec.
84
            if (!secTags.isEmpty()){
85
                tags.add(new TaggedText(TagEnum.separator, secSeparator));
86
                tags.addAll(secTags);
88 87
            }
88

  
89 89
        }
90 90
        return tags;
91 91
    }
......
108 108
            if (StringUtils.isNotBlank(taxonBase.getAppendedPhrase())){
109 109
                tags.add(new TaggedText(TagEnum.appendedPhrase, taxonBase.getAppendedPhrase().trim()));
110 110
            }
111
        }else{
112
            tags.add(new TaggedText(TagEnum.name, "???"));
113 111
        }
112

  
114 113
        return tags;
115 114
    }
116 115

  

Also available in: Unified diff