Java: Intention that wraps list/set/map with Collections.unmodifiableList/Set/Map (IDEA-93154)

This commit is contained in:
Pavel Dolgov
2019-02-20 16:03:13 +03:00
parent f588d814fa
commit 63092d9c2e
22 changed files with 322 additions and 0 deletions

View File

@@ -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);
}
}