Java: Intention that wraps list/set/map with Collections.unmodifiable - handle the caret at the end of the expression (IDEA-93154)

This commit is contained in:
Pavel Dolgov
2019-02-21 18:03:24 +03:00
parent 0267b104b3
commit 96b9ab4f80
3 changed files with 39 additions and 7 deletions
@@ -0,0 +1,11 @@
// "Wrap with unmodifiable set" "true"
import java.util.Collections;
import java.util.Set;
import java.util.HashSet;
class C {
Set<String> test() {
Set<String> result = new HashSet<>();
return Collections.unmodifiableSet(result);
}
}
@@ -0,0 +1,10 @@
// "Wrap with unmodifiable set" "true"
import java.util.Set;
import java.util.HashSet;
class C {
Set<String> test() {
Set<String> result = new HashSet<>();
return result<caret>;
}
}