From alex.buckley at oracle.com Tue Jun 18 16:51:11 2013 From: alex.buckley at oracle.com (Alex Buckley) Date: Tue, 18 Jun 2013 16:51:11 -0700 Subject: Metadata about parameter names Message-ID: <51C0F26F.3020908@oracle.com> Prompted by discussions on jdk8-dev [1], I have specified an isNamePresent() method in java.lang.reflect.Parameter. It exposes whether the parameter has a name _according to the MethodParameters attribute_. Non-Java clients can use it to determine whether the parameter "really" has a name, because for the sake of Java clients, a parameter always has a name _according to getName()_ even if we have to synthesize it. The mini-spec for this method is at [2] and the enhanced metadata spec incorporates it for completeness [3]. Alex [1] http://mail.openjdk.java.net/pipermail/jdk8-dev/2013-June/002658.html [2] http://bugs.sun.com/view_bug.do?bug_id=8016285 [3] http://cr.openjdk.java.net/~abuckley/8misc.pdf From alex.buckley at oracle.com Fri Jun 28 15:33:19 2013 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 28 Jun 2013 15:33:19 -0700 Subject: Repeatable non-inheritable annotation types Message-ID: <51CE0F2F.5080600@oracle.com> Deven You raised the following point at [1]. Assume the declarations: @Foo(1) @Foo(2) class A {} class B extends A {} where Foo is _not_ inheritable. Foo is repeatable with FooContainer as its containing annotation type, and FooContainer _is_ inheritable. B.class.getAnnotationsByType(FooContainer.class) will of course expose the inherited @FooContainer annotation. But, B.class.getAnnotationsByType(Foo.class) should not expose @Foo(1) @Foo(2), as Foo is not inheritable. The definitions of "present" and "associated" annotations in the spec are correct, but this particular scenario - with a _non_-inheritable Foo - was not covered in the examples in section 1.2. I have extended example 1.2-1 to cover it, and updated the spec PDF at: http://cr.openjdk.java.net/~abuckley/8misc.pdf Alex [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-June/017675.html