-
Notifications
You must be signed in to change notification settings - Fork 580
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
Ensures that our MP Config CDI extension processes only enabled injection points #708
Conversation
…tion points Signed-off-by: Laird Nelson <[email protected]>
… fix Spotbugs complaint Signed-off-by: Laird Nelson <[email protected]>
…om the GUI is a no-op) since the last run timed out spuriously Signed-off-by: Laird Nelson <[email protected]>
…rying from the GUI is a no-op) since the last run had a gRPC test failure (unrelated) Signed-off-by: Laird Nelson <[email protected]>
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.
LGTM. One question posted.
private void harvestConfigPropertyInjectionPointsFromEnabledBean(@Observes ProcessBean<?> event) { | ||
Bean<?> bean = event.getBean(); | ||
Set<InjectionPoint> beanInjectionPoints = bean.getInjectionPoints(); | ||
if (beanInjectionPoints != null && !beanInjectionPoints.isEmpty()) { |
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.
Mostly to satisfy my own curiosity... There are several null-checks in this method. The JavaDoc for the invoked methods does not say that null might be returned (although it doesn't say null will not ever be returned either although one could infer that). Are you just being really careful or have you seen these methods return null in your past experience with CDI?
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.
Mostly being careful. I've seen NullPointerException
s from non-market-leader CDI implementations in odd places and it has scarred me. Also, a Bean
in particular is an interface that an end user may implement, so she may return null
from a variety of its methods and the specification does not forbid her from doing so. So yes, being careful.
This PR ensures that
@ConfigProperty
-annotated injection points belonging only to enabled beans are processed. This is a partial fix for #650. Subsequent PRs will continue to fix the other multiple issues surfaced by that issue. The TCK continues to pass.Other minor changes:
public
(i.e. are intended only for the CDI container to call and that should not be part of our public supported subclassable API) have been marked@Deprecated
Signed-off-by: Laird Nelson [email protected]