- TaxonomyDataManager.getLineageTaxCacheMap().put( lineage_str, up_tax );
- if ( !ForesterUtil.isEmpty( up_tax.getScientificName() ) ) {
- TaxonomyDataManager.getSnTaxCacheMap().put( up_tax.getScientificName(), up_tax );
+ //in case of more than one (e.g. "Xenopus" Genus and Subgenus), keep shorter, less specific one:
+ int shortest = Integer.MAX_VALUE;
+ UniProtTaxonomy least_specific_up_tax = null;
+ for( final UniProtTaxonomy m : matching_taxonomies ) {
+ final int s = m.getLineage().size();
+ if ( s < shortest ) {
+ shortest = s;
+ least_specific_up_tax = m;
+ }