RFR: 5047859 : (reflect) Class.getField can't find String[].length

Joel Borggren-Franck joel.franck at oracle.com
Mon Aug 26 13:28:04 UTC 2013

Hi Florian,

Thanks for the comments,

On 2013-08-26, Florian Weimer wrote:
> On 08/26/2013 02:39 PM, Joel Borggren-Franck wrote:
> >Hi,
> >
> >Please review doc fix and test for http://bugs.sun.com/view_bug.do?bug_id=5047859
> >
> >http://cr.openjdk.java.net/~jfranck/5047859/webrev.00/
> >
> >This is a spec change to update the spec to match the long-standing implementation.
> Perhaps use {@code length} instead of 'length'?

I agree, will fix.

> Technically, I
> don't think the length field exists at all.  The Java language just
> happens to use field syntax to represent the arraylength opcode.
> But adding some clarification to the documentation certainly doesn't
> hurt.

The language spec (JLS $10.7) is very clear that there is a length
member for array types, and that it is public, final and a field. I
don't think most vm's implement it as a field, but that shouldn't
matter. So while I agree this is clarifying it is actually a "bug fix"
as well.


More information about the core-libs-dev mailing list