Convenience factory methods for collections [JEP-269]

The Java programming language does not support collection literals. Adding this feature to the Java platform was proposed in 2013 and revisited in 2016, but it only gained exposure as a research proposal, not for future implementation.

Oracle's definition of a collection literal is "a syntactic expression form that evaluates to an aggregate type, such as an array, list, or map" (http://openjdk.java.net/jeps/186).

Of course, that is until Java 9 is released. Implementing collection literals in the Java programming language is reported to have the following benefits:

  • Performance improvement
  • Increased safety
  • Reduction of boilerplate code

Even without being part of the research group, our ...

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.