ref #8242 Load all supported states with one service call
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 24 Apr 2019 10:12:41 +0000 (12:12 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 24 Apr 2019 10:12:41 +0000 (12:12 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/CharacterMatrix.java

index e586da7567472e90441622c17c77aa698e43b9cc..f92f29df4b016019681a80371e169bddf853dd71 100644 (file)
@@ -297,12 +297,12 @@ public class CharacterMatrix extends Composite {
 
     private void fetchSupportedStates(Character character) {
         if(character.isSupportsCategoricalData()){
-            List<TermDto> supportedStates = new ArrayList<>();
             Set<TermVocabulary<State>> supportedCategoricalEnumerations = character.getSupportedCategoricalEnumerations();
+            List<UUID> vocUuids = new ArrayList<>();
             for (TermVocabulary<State> termVocabulary : supportedCategoricalEnumerations) {
-                supportedStates.addAll(CdmStore.getService(IVocabularyService.class).getTerms(termVocabulary.getUuid()));
+                vocUuids.add(termVocabulary.getUuid());
             }
-//            Collections.sort(supportedStates, (state1, state2)->state1.getLabel().compareTo(state2.getLabel()));
+            List<TermDto> supportedStates = new ArrayList<>(CdmStore.getService(IVocabularyService.class).getTerms(vocUuids));
             categoricalFeatureToStateMap.put(character, supportedStates);
         }
     }