java.lang.reflect.AnnotatedElement changes

Joseph Darcy joe.darcy at
Sat Feb 16 00:25:15 UTC 2013

On 2/15/2013 3:49 PM, Martin Buchholz wrote:
> On Fri, Feb 15, 2013 at 6:10 AM, David Holmes <david.holmes at>wrote:
>> On 15/02/2013 11:53 PM, Kasper Nielsen wrote:
>>> Hi,
>>> I know AnnotatedElement is not a common class to implement outside of the
>>> JDK. But the interface introduces some new methods that will break
>>> existing
>>> code.
>> I must admit I am surprised as I thought that any new methods on
>> interfaces would have to have default implementations to avoid this kind of
>> breakage. Seems to me that defaults should be possible for those new
>> methods. Perhaps this is still a work in progress?
> OpenJDK could invest more in static analysis tools.  Here it would be good
> to use a tool to audit all interfaces to check that new methods without
> defaults have not been added.

Hi Martin,

FWIW, with my ccc hat on, I've previously (internally) asked the JCK 
team to run such reports. IIRC, the methods on AnnotatedElement where 
the only potentially problematic ones made so far. (We'll be added 
methods to interfaces over in javax.lang.model.*, but we can't use 
default methods over than and we explicitly warn implementers and user 
of the API of the potential for new methods.)



More information about the core-libs-dev mailing list