Revision 9d97647a
Added by Andreas Müller almost 3 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategy.java | ||
---|---|---|
83 | 83 |
// } |
84 | 84 |
|
85 | 85 |
//sec. |
86 |
List<TaggedText> secTags = getSecundumTags(taxonBase); |
|
86 |
List<TaggedText> secTags = getSecundumTags(taxonBase, isMisapplication);
|
|
87 | 87 |
if (!secTags.isEmpty()){ |
88 | 88 |
tags.add(new TaggedText(TagEnum.separator, secSeparator)); |
89 | 89 |
tags.addAll(secTags); |
90 |
}else if (isMisapplication && isBlank(taxonBase.getAppendedPhrase())){ |
|
91 |
tags.add(new TaggedText(TagEnum.appendedPhrase, "auct.")); |
|
90 | 92 |
} |
91 | 93 |
|
92 | 94 |
if (isMisapplication){ |
... | ... | |
133 | 135 |
return tags; |
134 | 136 |
} |
135 | 137 |
|
136 |
private List<TaggedText> getSecundumTags(T taxonBase) { |
|
138 |
private List<TaggedText> getSecundumTags(T taxonBase, boolean isMisapplication) {
|
|
137 | 139 |
List<TaggedText> tags = new ArrayList<>(); |
138 | 140 |
|
139 | 141 |
Reference sec = taxonBase.getSec(); |
... | ... | |
141 | 143 |
String secRef; |
142 | 144 |
if (sec == null){ |
143 | 145 |
//missing sec |
144 |
if (isBlank(taxonBase.getAppendedPhrase())){ |
|
146 |
if (isBlank(taxonBase.getAppendedPhrase()) && !isMisapplication ){
|
|
145 | 147 |
secRef = "???"; |
146 | 148 |
}else{ |
147 | 149 |
secRef = null; |
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategyTest.java | ||
---|---|---|
232 | 232 |
Taxon mainTaxon = Taxon.NewInstance(TaxonNameFactory.NewBacterialInstance(Rank.SPECIES()), ReferenceFactory.newBook() ); |
233 | 233 |
mainTaxon.addMisappliedName(man, null, null); |
234 | 234 |
assertEquals("Taxon titlecache must use sensu", expectedNameCache + " sensu Sp.Pl., non (L.) Mill.", cacheStrategy.getTitleCache(man)); |
235 |
man.setSec(null); |
|
236 |
assertEquals("Taxon titlecache must use sensu", expectedNameCache + " auct., non (L.) Mill.", cacheStrategy.getTitleCache(man)); |
|
237 |
man.setAppendedPhrase("aucts."); |
|
238 |
assertEquals("Taxon titlecache must use sensu", expectedNameCache + " aucts., non (L.) Mill.", cacheStrategy.getTitleCache(man)); |
|
239 |
//reset sec + appendedPhrase |
|
240 |
man.setSec(sec); |
|
241 |
man.setAppendedPhrase(null); |
|
235 | 242 |
|
236 | 243 |
//add another from relation |
237 | 244 |
Taxon relatedTaxon = Taxon.NewInstance(TaxonNameFactory.NewBacterialInstance(Rank.SPECIES()), ReferenceFactory.newBook() ); |
Also available in: Unified diff
ref #9433 fix incorrect handling for MAN without sec/sensu reference