JEP 186: Collection Literals

Per Bothner per at bothner.com
Tue Jan 14 11:05:11 PST 2014


On 01/14/2014 09:23 AM, Brian Goetz wrote:>
> In fact, since the goal at this point is to discuss whether we should
> move forward or not with the /exploration/ of the language feature, let
> me restrict the discussion to this point: is this something that needs a
> language feature, or would library support be enough?

Collection literals encourage embedding large data structures in the
Java source code.  (These could be program-generated.)  This is more
likely to blow up class-file size limitations, primarily size of
constant pool, and size of code attributes.

Note that a library-only solution does not solve this problem.

In this day and age I would be embarrassed to say: We added
collection literals, but they can be no longer that 10k elements long
(on a good day).

Ergo I think we need to fix the classfile-size-limitation bug
if we're adding collection literals.  I was surprised to not find
that in the list at http://openjdk.java.net/jeps/0

If we fix this, some resource files could probably be replaced
by (machine-generated?) collection literals.  That might allow
marginally faster loading/startup (I'm guessing) of such code.
-- 
	--Per Bothner
per at bothner.com   http://per.bothner.com/


More information about the lambda-dev mailing list