The cache in TypeSafeObserverResolver, as used by TransactionalObserverNotifier does not have any form of limiting or expiry, which means that it could grow very large and cause an OutOfMemoryError if a large number of distinct qualifier are used.
Usually the number of qualifiers is finite (and relatively small), but this is not true if an application uses AnnotationLiteral-derived classes with arbitrary data in the annoation. An example of where this occurs is Solder's ServletEventBridgeListener, which emits events with a qualifier annotation containing the URL path and method.
The cache should have some form of limit or expiry, so that it does not grow arbitrarily large.
|