-
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
Introduce AutoAddScopeBuildItem to remove boilerplate necessary when annotation transformers are used to add a scope annotation to a class #11350
Conversation
* | ||
* @return self | ||
*/ | ||
public Builder hasInjectionPoint() { |
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.
It might be a stupid question and sorry if it's the case but should we also detect the lifecycle annotations? You might not have anything injected but a @PostConstruct
?
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.
It's not a stupid question but I'm not sure all the specs support the lifecycle callbacks... In any case, we could add one more method to detect @PostConstruct
and @PreDestroy
.
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.
Well, that wouldn't hurt the ones that don't support it and would be nice for the ones that do? Or am I missing something?
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.
I get the point. We should rename the method then. It's only best effort anyway because even though we walk the class hierarchy we don't handle some special cases (e.g. an overriden initializer method)...
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.
Hm, what about requiresContainerServices()
?
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 good, just one question.
It looks (maybe I am just missing something though) like this can lead to an erroneous state where you attempt to auto add scope but then later on ArC figures the given class is not a legal bean type. E.g. say it contains a wilcard.
I suppose in such case we blow up. Is that ok or should we add some checks for that?
@manovotn Yes, it could blow up and even the current approach could blow up. Maybe we could add some check later. In any case, it would be easier to fix it in one place ;-). |
Very nice, let's get this in :). |
Formatting issue:
A |
@gsmet Ah, damn |
...annotation transformers are used to add a scope annotation to a class - also fixes quarkusio#11340
@mkouba could you check how much time it adds to enable the formatter with quickly? |
@gsmet I don't get consistent results on my laptop :-(. It's roughly 20 seconds ( BTW those failures are CI problems again:
|
...annotation transformers are used to add a scope annotation to a class