Review request for JDK-8014230: Compilation incorrectly succeeds with inner class constructor with 254 parameters
alex.buckley at oracle.com
Mon Jun 17 11:43:07 PDT 2013
Regarding the NumArgs5/6/7/8 tests:
- @author and @bug tags are wrong.
- NumArgs5 and 6 fail to document the important point, which is the
presence not only of a hidden 'this' parameter but also an implicitly
declared 'outer' parameter.
- NumArgs7 and 8 feature static nested classes, which means they're not
inner by definition, so don't call them Inner!
The NumArgs1-4 tests have their own problems which carried over to 5-8:
- @summary is pretty useless - what VM limits?
- They mention 'T1 this' but no T1 type exists.
- NumArgs3/4 seem to be trying to test ctor limits (otherwise they'd be
identical to NumArgs1/2), but declare a void method rather than a ctor.
The NumArgsX nomenclature wasn't terribly helpful when the 1-4 tests
were written, and now we have more dimensions under test. I propose a
new directory test/tools/javac/limits/parameters containing:
NumArgs1 -> MethodOfToplevelClass256 // fail
NumArgs2 -> MethodOfToplevelClass255 // pass
NumArgs3 -> CtorOfToplevelClass256 // fail
NumArgs4 -> CtorOfToplevelClass255 // pass
NumArgs5 -> CtorOfInnerClass255 // fail
NumArgs6 -> CtorOfInnerClass254 // pass
NumArgs7 -> CtorOfNoninnerClass256 // fail
NumArgs8 -> CtorOfNoninnerClass255 // pass
OK, eight tests. But really, there are three dimensions:
i) Enclosing class: Toplevel || Non-private inner member || Anonymous ||
Noninner member (ignoring private inner member classes and local
classes for simplicitly)
ii) Parameter declarer: Ctor || Instance method || Static method
iii) Number of parameters: 253 || 254 || 255 || 256
That makes 48 interesting cases, notwithstanding that "number of
parameters" can be simplified in some cases (no point trying 256
parameters when 255 already failed). Even if we don't have 48, we should
at least have CtorofAnonymousClass255/254.
On 6/14/2013 11:29 AM, Eric McCorkle wrote:
> Please review this patch, which addresses a problem with javac not
> taking inner this parameters into account when determining if there are
> too many parameters to a function.
> The webrev is here:
> The bug report is here:
More information about the compiler-dev