mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
relevant method chain completion: don't add items to unmodifiable collection (EA-102737)
This commit is contained in:
@@ -48,7 +48,7 @@ public class ChainSearcher {
|
||||
if (methods == null) {
|
||||
methods = currentMethods;
|
||||
} else {
|
||||
methods.addAll(currentMethods);
|
||||
methods = unionSortedSet(currentMethods, methods);
|
||||
}
|
||||
}
|
||||
return new SearchInitializer(methods, context);
|
||||
@@ -169,4 +169,13 @@ public class ChainSearcher {
|
||||
result.add(newChain);
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> SortedSet<T> unionSortedSet(SortedSet<T> s1, SortedSet<T> s2) {
|
||||
if (s1.isEmpty()) return s2;
|
||||
if (s2.isEmpty()) return s1;
|
||||
TreeSet<T> result = new TreeSet<>();
|
||||
result.addAll(s1);
|
||||
result.addAll(s2);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user