RFR: 8156211: [JVMCI] ResolvedJava* interfaces should extend AnnotatedElement
Christian Thalinger
christian.thalinger at oracle.com
Tue May 10 18:31:54 UTC 2016
> On May 9, 2016, at 11:25 PM, Roland Schatz <roland.schatz at oracle.com> wrote:
>
> On 05/09/2016 07:16 PM, Christian Thalinger wrote:
>>
>>> On May 8, 2016, at 11:39 PM, Roland Schatz < <mailto:roland.schatz at oracle.com>roland.schatz at oracle.com <mailto: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/%7Erschatz/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.
>
> Done (and also made the existing getAnnotations() methods look the same, while we're at it).
>
> http://cr.openjdk.java.net/~rschatz/JDK-8156211/webrev.02/ <http://cr.openjdk.java.net/~rschatz/JDK-8156211/webrev.02/>
Thanks.
>
> - Roland
>
>
>>
>>>
>>> - Roland
>>>
>>> On 05/06/2016 11:24 PM, Christian Thalinger wrote:
>>>>
>>>>> On May 6, 2016, at 2:18 AM, Roland Schatz <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/20160510/00ec9a34/attachment.html>
More information about the hotspot-compiler-dev
mailing list