-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArC fixes for spec compatibility, round 9 #33447
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome number of fixes for TCKs! LGTM
This comment has been minimized.
This comment has been minimized.
The |
This mainly fixes a bug with `BeanManager.getReference()`, but it also attempts to cleanup the `InstanceImpl` implementation and adds some more tests. This commit would also remove a TCK exclusion for `InjectionPointTest`, except the test uses stereotype annotations on injection points, which we consider an error. There's a challenge for it.
ArC used to treat producers as depending on their declaring beans, so if a bean also has a dependency on one of the producers it declares, circular dependency exists. This is too strict for `static` producers: they in fact don't depend on their declaring beans, so no circularity exists in such case. Circular dependency only exists if the producer is not `static`. This commit fixes that. When creating the `Bean` instance of a bean that depends on another bean, ArC either supplies the `Bean` instance of the dependency directly, in case it already exists, or it allows deferred instantiation in most cases. There used to be one case that didn't allow deferred instantiation of `Bean` objects: a declaring bean of a producer. There is no reason for that, deferred instantiation works correctly even in this case, so this commit allows it.
The `InstanceHandle.destroy()` method used to catch exceptions thrown by the call to `Bean.destroy()`, but that isn't enough. Per the specification, the generated `Bean.destroy()` method itself must catch exceptions. This commit does that; catching exceptions in `InstanceHandle.destroy()` becomes superfluous, so is removed.
… corresponding context It makes no sense to register an additional scope annotation without registering a corresponding context, but the CDI TCK uses that and it isn't terribly hard to support. With this commit, ArC treats additional bean defining annotations that are meta-annotated `@Scope` or `@NormalScope` as scope annotations, even if there is no corresponding context. This commit also fixes the type discovery implementations to also discover scope annotations and register them as additional bean defining annotations.
The CDI specification mandates that if a superclass of a bean declares a scope annotation, scope annotations from further superclasses are not inherited. This holds even if the annotation is not `@Inherited`. This commit fixes searching for inherited scopes to honor this.
Rebased. |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
Related to #28558
Bean.getInjectionPoints()
in the strict modeBean.getInjectionPoints()
virtually uselessInstanceImpl
constructors and static factoriesstatic
producers and normal-scoped beansBeanInfo.isProducer()
andisStaticProducer()
, bean dependency handling inComponentsProviderGenerator
)Bean.destroy()
methods to catch exceptionsScopeInfo
just needs to be there@Inherited
scope annotation on a superclass is not inherited, but it prevents inheriting an@Inherited
scope annotation from a further superclass