2016-12-16 20:58 GMT+01:00 Martin Buchholz <[email protected]>: > 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
