Skip to content
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

Merged
merged 4 commits into from
May 21, 2019
Merged

Conversation

ljnelson
Copy link
Member

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:

  • Serialization is repaired so that default information is read
  • Generics warnings are eliminated
  • Methods that should never have been 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]

@ljnelson ljnelson requested review from barchetta and tjquinno May 18, 2019 03:10
ljnelson added 2 commits May 17, 2019 20:34
…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]>
Copy link
Member

@tjquinno tjquinno left a 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()) {
Copy link
Member

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?

Copy link
Member Author

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 NullPointerExceptions 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.

@ljnelson ljnelson requested a review from romain-grecourt May 20, 2019 22:22
@ljnelson ljnelson added bug Something isn't working MP P1 labels May 20, 2019
@ljnelson ljnelson merged commit 6414cad into helidon-io:master May 21, 2019
@ljnelson ljnelson deleted the issue-650 branch May 21, 2019 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working MP P1
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants