RFR  Class.getModifiers() returns "static" for anonymous classes
ivan.gerasimov at oracle.com
Fri Mar 7 18:40:37 UTC 2014
On 07.03.2014 20:32, Jonathan Gibbons wrote:
> I would remove the comment in Attr 2132-2138.
> In general, javac lives in the present. There's no need to document
> an erroneous past in the comments. That's what the Mercurial changelog
> and bug system are for ;-)
Yes, I agree.
I'll remove that comment.
> -- Jon
> On 03/07/2014 12:29 AM, Ivan Gerasimov wrote:
>> Resent with the correct Subject line
>> JLS states that an anonymous class cannot be static .
>> However, in OpenJDK implementation Class#getModifiers(), when called
>> for the anonymous class, returns the STATIC bit set.
>> Would you please help review the proposed fix, which removes STATIC
>> from the anonymous class's modifier?
>> An exception to this is an enum constant's body.
>> It's not clear, whether they should be treated in the same way as
>> anonymous classes, so I left them as they are now.
>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8034044
>> WEBREV: http://cr.openjdk.java.net/~igerasim/8034044/0/webrev/
>> I ran tests from langtools/test/tools/javac/ with jtreg.
>> No failures were caused by this fix.
>> Sincerely yours,
More information about the compiler-dev