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

This commit is contained in:
Pavel Dolgov
2019-02-20 18:00:15 +03:00
parent f588d814fa
commit 63092d9c2e
22 changed files with 322 additions and 0 deletions
@@ -0,0 +1,11 @@
// "Wrap with unmodifiable map" "true"
import java.util.Collections;
import java.util.Map;
import java.util.HashMap;
class C {
Map<String, Integer> test() {
var result = new HashMap<>();
return Collections.unmodifiableMap(result);
}
}