Review request: update javac to properly output mandated parameters in MethodParameters attributes

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Feb 7 10:45:41 PST 2013


Uhm - the definition of ACC_MANADATE seems to imply that there's a spec 
demanding a given extra parameter. But that's not the case for, i.e. 
extra constructor arguments generated in this case:

class Foo {
     void m() {
         final Object o = null;
         new Object() { };
     }
}

the constructor of the anonymous inner class will accept and extra 
Object argument. Is that mandated by the spec?

Again,

class Outer {
     class Inner { }
     void m(Outer outer) {
         outer.new Inner() { };
     }
}

Extra argument here (enclosing this). This one is generated in one place 
(Attr) - the following is generated in a different place (Lower)

class Outer {
     class Inner { }
     void m(Outer outer) {
         new Inner() { };
     }
}

The list is long - the point is - is any of this specified anywhere? I 
don't think so (they are all marked as SYNTHETIC). But your check, since 
it compares the number of arguments in the method type against the 
number of argument in the symbol I think it will pick up all this stuff. 
Or am I missing something?

Maurizio


On 06/02/13 17:23, Eric McCorkle wrote:
> Hello,
>
> Please review the following patch, which updates javac to output
> mandated parameters in MethodParameters attributes.  It also updates
> javac to reflect spec changes, namely the definition of the ACC_MANDATED
> flag.
>
> The webrev is here:
> http://cr.openjdk.java.net/~emc/8006345/
>
> This patch addresses the following issues:
> http://bugs.sun.com/view_bug.do?bug_id=8006345
> http://bugs.sun.com/view_bug.do?bug_id=8006896
> http://bugs.sun.com/view_bug.do?bug_id=8006345
>
> The latest version of the spec for parameter reflection can be found here:
>
> http://cr.openjdk.java.net/~abuckley/8misc.pdf
>
> Thanks,
> Eric




More information about the compiler-dev mailing list