RFR: 8156211: [JVMCI] ResolvedJava* interfaces should extend AnnotatedElement
Christian Thalinger
christian.thalinger at oracle.com
Mon May 9 17:16:38 UTC 2016
> On May 8, 2016, at 11:39 PM, Roland Schatz <roland.schatz at oracle.com> wrote:
>
> Whoops... Good catch.
>
> Fixed:
> http://cr.openjdk.java.net/~rschatz/JDK-8156211/webrev.01/ <http://cr.openjdk.java.net/~rschatz/JDK-8156211/webrev.01/>
Looks good. One nit:
+ public Annotation[] getDeclaredAnnotations() {
+ Field javaField = toJava();
+ if (javaField != null) {
+ return javaField.getDeclaredAnnotations();
+ }
+ return new Annotation[0];
+ }
+ public Annotation[] getDeclaredAnnotations() {
+ Executable javaMethod = toJava();
+ return javaMethod == null ? new Annotation[0] : javaMethod.getDeclaredAnnotations();
+ }
Make them look the same.
>
> - Roland
>
> On 05/06/2016 11:24 PM, Christian Thalinger wrote:
>>
>>> On May 6, 2016, at 2:18 AM, Roland Schatz < <mailto:roland.schatz at oracle.com>roland.schatz at oracle.com <mailto:roland.schatz at oracle.com>> wrote:
>>>
>>> Please review this small jvmci change:
>>>
>>> http://cr.openjdk.java.net/~rschatz/JDK-8156211/webrev.00/ <http://cr.openjdk.java.net/%7Erschatz/JDK-8156211/webrev.00/>
>>> https://bugs.openjdk.java.net/browse/JDK-8156211 <https://bugs.openjdk.java.net/browse/JDK-8156211>src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
>>
>> + public Annotation[] getDeclaredAnnotations() {
>> + Executable javaMethod = toJava();
>> + return javaMethod == null ? null : javaMethod.getDeclaredAnnotations();
>> + }
>> This seems wrong. The specification says:
>>
>> * If there are no annotations <em>directly present</em> on this element,
>> * the return value is an array of length 0.
>>
>> and the others return an empty array.
>>
>>>
>>> This change was contributed by Vojin Jovanovic (cc'ed).
>>>
>>> Thanks,
>>> Roland
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160509/e12a721c/attachment.html>
More information about the hotspot-compiler-dev
mailing list