bottleneck by java.lang.Class.getAnnotations() - a better patch

Peter Levart peter.levart at
Tue Nov 6 14:41:36 UTC 2012

On 11/06/2012 03:00 PM, Alan Bateman wrote:
> Peter,
> I haven't studied your patch yet but moving the fields into a helper 
> class is what was envisaged. Here's another reminder that the 
> initialization has been crying out to be re-worked for some time:
> -Alan.
I noticed the static syncronized AnnotationType.getInstance too. My 
proposed patch does away with synchronized 
Class.initAnnotationsIfNecessary and replaces it with plain 
Class.privateGetAnnotations that doesn't use any locks. Therefore it 
solves this deadlock.

Regards, Peter

More information about the core-libs-dev mailing list