[
https://issues.jboss.org/browse/CDI-721?page=com.atlassian.jira.plugin.sy...
]
Mark Struberg commented on CDI-721:
-----------------------------------
The AT configurator will build the AT when the AT is needed the next time.
That might be at the end of _all_ events get invoked (when the AT is further processed by
the CDI runtime) or when getAnnotatedType() is invoked on the pat the next time.
Technically it doesn't make any difference whether this happens in the next observer
method or in the same one.
The CDI container, or resp the ProcessAnnotatedType implementation, has to deal with it
anyway.
So this restriction technically makes no sense.
configureAnnotatedType vs setAnnotatedType restrition is unecessarily
strict
----------------------------------------------------------------------------
Key: CDI-721
URL:
https://issues.jboss.org/browse/CDI-721
Project: CDI Specification Issues
Issue Type: Bug
Components: Portable Extensions
Affects Versions: 2.0 .Final
Reporter: Mark Struberg
{noformat}
Any observer of this event is permitted to wrap and/or replace the AnnotatedType by
calling either setAnnotatedType() or configureAnnotatedType(). If both methods are called
within an observer notification an IllegalStateException is thrown.
{noformat}
This rule is way too strict without any real reason.
Any CDI container must support that both methods are being called on the same event
payload anyway. Because we did not forbid that observerMethod1 invokes setAnnotatedType
and observerMethod2 uses configureAnnoatedType. And that's good that way, otherwise
the pluggability would be lost.
We should delete this sentence without any substitution.
The same applies to similar configurator methods like configureBeanAttributes, etc.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)