Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6363651

(coll) factory methods in collections classes to ease collection creation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs

      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.

            smarks Stuart Marks
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: