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

Bean removal should WARN when lookups fail #658

Closed
FroMage opened this issue Jan 29, 2019 · 6 comments · Fixed by #674
Closed

Bean removal should WARN when lookups fail #658

FroMage opened this issue Jan 29, 2019 · 6 comments · Fixed by #674
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@FroMage
Copy link
Member

FroMage commented Jan 29, 2019

I wasted half a day on figuring out why my injection stopped working after the latest master commits that remove "unused" (statically) beans. I mean, the feature is great, but for people doing API injection that's going to be a huge WTF. We should record (in a file or in generated code, I don't care) which beans have been removed, and when trying to inject them at run-time, we should WARN (we can revise that logging level later after usage experience) that they were removed at build time, and include info on how to not have them removed.

@FroMage
Copy link
Member Author

FroMage commented Jan 29, 2019

@mkouba what do you think?

@mkouba
Copy link
Contributor

mkouba commented Jan 29, 2019

Sounds reasonable. We should definitely implement something like that and I'm sorry for your wasted time. Just out of curiosity - what was the use case?

@FroMage
Copy link
Member Author

FroMage commented Jan 29, 2019

The use case is that I'm doing API injection lookup because I can't inject there. Don't be sorry, that's what happens with new features :)

@mkouba
Copy link
Contributor

mkouba commented Jan 29, 2019

"API injection lookup" means BeanContainer.instance(Class<T>, Annotation...)?

@FroMage
Copy link
Member Author

FroMage commented Jan 29, 2019

Yes.

@FroMage
Copy link
Member Author

FroMage commented Jan 30, 2019

Thanks!

@cescoffier cescoffier added this to the 0.8.0 milestone Jan 30, 2019
maxandersen added a commit to maxandersen/quarkus that referenced this issue Nov 5, 2022
Main usecase is that tools like bach uses suffix less files.

for example to allow building https://github.com/jbee/purejin
using `jbang --jsh --java 16 https://bit.ly/bach-main-build`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants