@@ -43,7 +43,8 @@ private class FragmentChanges{
43
43
@ Override
44
44
public void validate (ControlledVocabulary newCV , ControlledVocabulary oldCV , ValidatorCallback callback ) {
45
45
46
- List <FragmentVocabularyTerm > invalidUpdateTerms =newCV .getTerms ().stream ()
46
+ List <FragmentVocabularyTerm > invalidUpdateTerms =newCV .getTerms ().stream ()
47
+ .filter (term -> term instanceof FragmentVocabularyTerm )
47
48
.map (term ->(FragmentVocabularyTerm )term )
48
49
.filter (term ->!Optional .ofNullable (term .getFragmentStructure ()).isPresent ()
49
50
|| !Optional .ofNullable (term .getDisplay ()).isPresent ()
@@ -58,6 +59,7 @@ public void validate(ControlledVocabulary newCV, ControlledVocabulary oldCV, Val
58
59
FragmentChanges changes = getAddedUpdatedDeletedTerms (newCV , oldCV );
59
60
60
61
Map <String , List <String >> hashLookup = newCV .getTerms ().stream ()
62
+ .filter (term -> term instanceof FragmentVocabularyTerm )
61
63
.map (key ->(FragmentVocabularyTerm )key )
62
64
.map (f ->Tuple .of (getHash (f ), f .getValue ()))
63
65
.filter (t ->t .k ().isPresent ())
@@ -130,7 +132,8 @@ private FragmentChanges getAddedUpdatedDeletedTerms(ControlledVocabulary newCV,
130
132
131
133
FragmentChanges fragmentChanges = new FragmentChanges ();
132
134
133
- List <FragmentVocabularyTerm > termsAfterUpdate =newCV .getTerms ().stream ()
135
+ List <FragmentVocabularyTerm > termsAfterUpdate =newCV .getTerms ().stream ()
136
+ .filter (term ->term instanceof FragmentVocabularyTerm )
134
137
.map (term ->(FragmentVocabularyTerm )term )
135
138
.collect (Collectors .toList ());
136
139
@@ -140,7 +143,8 @@ private FragmentChanges getAddedUpdatedDeletedTerms(ControlledVocabulary newCV,
140
143
return fragmentChanges ;
141
144
}
142
145
143
- List <FragmentVocabularyTerm > termsBeforeUpdate = oldCV .getTerms ().stream ()
146
+ List <FragmentVocabularyTerm > termsBeforeUpdate = oldCV .getTerms ().stream ()
147
+ .filter (term -> term instanceof FragmentVocabularyTerm )
144
148
.map (term ->(FragmentVocabularyTerm )term )
145
149
.collect (Collectors .toList ());
146
150
0 commit comments