RFR: jsr166 jdk9 integration wave 13

Stefan Zobel spliterator at gmail.com
Fri Dec 16 20:21:44 UTC 2016


2016-12-16 20:58 GMT+01:00 Martin Buchholz <martinrb at google.com>:
> Thanks, Stefan!
>
> The creation of these bridge classes seem like a misfeature/bug of javac.
> We should avoid them where possible.  Every unnecessary class file makes
> every single java program a little slower to start up.  We can discover such
> "bridge classes" heuristically by looking for "small" synthetic class files:
>
> find build/classes/java.base/ -name '*$[0-9].class' -size -800c
>
> I think adding the package-private constructor is slightly better software
> engineering than making the classes themselves package-private:
>

Hi Martin,

yes, I agree. It may be better to add a comment like in ArrayList.Itr:

// prevent creating a synthetic constructor

Otherwise someone might be tempted to drop these empty constructors.

See also
http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-September/043803.html


Regards,
Stefan


More information about the core-libs-dev mailing list