Code review request for 8007113 Upgrade AnnotatedElement.isAnnotionPresent to be a default method

Chris Hegarty chris.hegarty at oracle.com
Fri Feb 1 09:33:13 UTC 2013


On 01/02/2013 07:18, Joe Darcy wrote:
> Hi Chris,
>
> On 01/31/2013 11:08 PM, Chris Hegarty wrote:
>> Joe,
>>
>> This looks good to me Joe, and I like that the default method spells
>> out its implementation.
>>
>> Out of curiosity, strictly speaking is this considered a specification
>> change? Since the public override methods no longer exist in the
>> concrete classes.
>
> The specification change here is the default-ness of the
> isAnnotationPresent method in AnnotatedElement; that delta will be
> covered by JCK signature tests. Putting aside how the classes
> implementing AnnotatedElement look via core reflection, the set of
> methods in the implementations of AnnotatedElement and their behavior at
> runtime will be unchanged so that aspects of the fix is not a
> specification change. Preserving the details of the core reflection view
> is generally outside of our compatibility contract for java SE;

Ah ha, thank you for the explanation. Makes sense.

-Chris.

> this change should be fully source and binary compatible.
>
> Thanks for the review,
>
> -Joe
>
>>
>> -Chris.
>>
>> On 02/01/2013 03:21 AM, Joe Darcy wrote:
>>> Hello,
>>>
>>> I'd like to upgrade the existing AnnotatedElement.isAnnotationPresent
>>> interface method to a default method:
>>>
>>> 8007113 Upgrade AnnotatedElement.isAnnotionPresent to be a default
>>> method
>>> http://cr.openjdk.java.net/~darcy/8007113.0/
>>>
>>> This ends up removing several copies of the same logic in the JDK; all
>>> reflection and annotations regression test pass with this change.
>>>
>>> Thanks,
>>>
>>> -Joe
>



More information about the core-libs-dev mailing list