-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
Creating new instances of generic collections can be very verbose.
e.g.
Map<Integer, FindMatchResults> resultsMap = new HashMap<Integer, FindMatchResults>();
Create factory methods in the various Collections subclasses that use capture to reduce the amount of typing, so I can go:
Map<Integer, FindMatchResults> resultsMap = HashMap.create();
JUSTIFICATION :
Simpler code is easier to read, write and debug.
Construction of new generic collections classes is extremely common, and the verbosity makes code harder to work with.
Creating new instances of generic collections can be very verbose.
e.g.
Map<Integer, FindMatchResults> resultsMap = new HashMap<Integer, FindMatchResults>();
Create factory methods in the various Collections subclasses that use capture to reduce the amount of typing, so I can go:
Map<Integer, FindMatchResults> resultsMap = HashMap.create();
JUSTIFICATION :
Simpler code is easier to read, write and debug.
Construction of new generic collections classes is extremely common, and the verbosity makes code harder to work with.
- duplicates
-
JDK-8048330 JEP 269: Convenience Factory Methods for Collections
- Closed
- relates to
-
JDK-5092426 (coll) Collections.newSet() etc to avoid redundancy and concrete types
- Closed