Further updated so that the hashsets are not modified outside the AnnotatedTypeImpl.State constructor.
Dug around and the only usage of the AnnotatedTypeImpl.addAnnotatedMethod(..) and similar methods was if someone attempted to construct an AnnotatedFieldImpl, etc. and not pass in a declaringType. I looked through all the code usages, ran all the tests, ran the TCK in OWB and in TomEE and this never happened. If anyone sees any issues with it, let me know. -David On May 11, 2013, at 3:04 PM, David Blevins <david.blev...@gmail.com> wrote: > > On May 11, 2013, at 1:59 PM, David Blevins <david.blev...@gmail.com> wrote: > >> That being said, I'll see if I can reduce the memory requirement of the fix. > > Done. Managed to reduce the memory requirement of the original code for the > lazy case as well. Basically two object references lighter (128 bits). > > Thread-safe, lighter and slightly more immutable. > > > -David >