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

Inconsistency in when BeanContainer.createInstance() may be called #688

Closed
Azquelt opened this issue Aug 10, 2023 · 4 comments · Fixed by #689
Closed

Inconsistency in when BeanContainer.createInstance() may be called #688

Azquelt opened this issue Aug 10, 2023 · 4 comments · Fixed by #689

Comments

@Azquelt
Copy link
Contributor

Azquelt commented Aug 10, 2023

The Javadoc for BeanContainer.createInstance() defines its behaviour when called during AfterBeanDiscovery. The Javadoc for BeanManager says it's not valid before AfterBeanDiscovery.

However, the spec (3.9.1) says that it's not valid before AfterDeploymentValidation which is fired after AfterBeanDiscovery.

The spec and the Javadoc disagree here, which one should be changed?

@Azquelt
Copy link
Contributor Author

Azquelt commented Aug 10, 2023

It looks like the TCK asserts that it can't be called before AfterDeploymentValidation (i.e. matching what the spec says)

@manovotn
Copy link
Contributor

It looks like the TCK asserts that it can't be called before AfterDeploymentValidation (i.e. matching what the spec says)

This is what I would expect to be the correct behavior.
Weld should behave that way as well, although we skip this verification in non-portable mode.

The Javadoc for BeanContainer.createInstance() defines its behaviour when called during AfterBeanDiscovery.

Interestingly, the same javadoc, just a few lines below, also defines that it throws an exception if invoked before ADV :)

@Azquelt
Copy link
Contributor Author

Azquelt commented Aug 10, 2023

Weld should behave that way as well

It does :)

Interestingly, the same javadoc, just a few lines below, also defines that it throws an exception if invoked before ADV :)

Huh, so it does.

I guess it's just the Javadoc that needs cleaned up then. I will check for any other references and make a PR.

@manovotn
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants