diff --git a/src/main/java/cz/cvut/kbss/termit/event/VocabularyValidationFinishedEvent.java b/src/main/java/cz/cvut/kbss/termit/event/VocabularyValidationFinishedEvent.java index 724cc13a9..7c7686ab3 100644 --- a/src/main/java/cz/cvut/kbss/termit/event/VocabularyValidationFinishedEvent.java +++ b/src/main/java/cz/cvut/kbss/termit/event/VocabularyValidationFinishedEvent.java @@ -4,9 +4,11 @@ import org.springframework.lang.NonNull; import java.net.URI; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Map; /** * Indicates that validation for a set of vocabularies was finished. @@ -17,9 +19,9 @@ public class VocabularyValidationFinishedEvent extends VocabularyEvent { * Vocabulary closure of {@link #vocabularyIri}. * IRIs of vocabularies that are imported by {@link #vocabularyIri} and were part of the validation. */ - private final Collection vocabularyIris; + private final List vocabularyIris; - private final Collection validationResults; + private final List validationResults; /** * @param source the source of the event @@ -31,17 +33,18 @@ public VocabularyValidationFinishedEvent(@NonNull Object source, @NonNull URI or @NonNull Collection vocabularyIris, @NonNull List validationResults) { super(source, originVocabularyIri); - this.vocabularyIris = Collections.unmodifiableCollection(vocabularyIris); - this.validationResults = Collections.unmodifiableCollection(validationResults); + // defensive copy + this.vocabularyIris = new ArrayList<>(vocabularyIris); + this.validationResults = new ArrayList<>(validationResults); } @NonNull - public Collection getVocabularyIris() { - return vocabularyIris; + public List getVocabularyIris() { + return Collections.unmodifiableList(vocabularyIris); } @NonNull - public Collection getValidationResults() { - return validationResults; + public List getValidationResults() { + return Collections.unmodifiableList(validationResults); } }