-
Notifications
You must be signed in to change notification settings - Fork 3k
RestClient processor with NullPointerException during scope definition #50398
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
Conversation
1fca2ca
to
f9efe85
Compare
Thanks for this! It would be nice to have a test that would have failed with the existing version of the code, but that passes with this fix |
f9efe85
to
fbe239e
Compare
@geoand Added test for it. Just to make sure that when we define some wrong-scope it shouldn't return a NPE, but should apply the default scope. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🎊 PR Preview 021b167 has been successfully built and deployed to https://quarkus-pr-main-50398-preview.surge.sh/version/main/guides/
|
e7e1fe7
to
23db9a7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm actually wondering whether we should fail the build instead in these cases... WDYT @gsmet ? |
Any update about it? |
We are at a conference this week so responses will be delayed 😉 |
I'm on the verge of it. Warnings are easy to miss and this could have consequences so yeah maybe throwing an error is safer. @danielsoro as a user, what's your take on this? Maybe our CDI people will have a strong opinion about it? /cc @mkouba @Ladicek @manovotn |
I'm not sure how the NPE looks like, but a NPE is usually not intentional, so that sounds like a bug. I'm not sure if we "validate" a scope anywhere else in Quarkus (maybe we do, I just can't remember at the moment), but changing a scope in case the declared one is invalid seems like a bad idea. I'm +1 on turning that into an error. |
Yes, in the past, a warning was present instead of an error, which is why I kept it the same way. However, it makes sense to throw an exception; the feedback is much clearer. |
23db9a7
to
5c14746
Compare
5c14746
to
4869013
Compare
+1 for a build failure. |
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
Also 👍 for making it an error to declare wrong scope
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.
Thanks!
Status for workflow
|
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.
From the added tests, I take it the RESTEasy Reactive client already failed with an exception if an invalid scope was configured? And the change here to RESTEasy classic "just" unifies the behavior? If so, even better! Thanks!
Status for workflow
|
Before Quarkus 3.28, when we defined a wrong scope, Quarkus added a warning log to indicate that it wasn't possible to use the defined scope for the RestClient and initialize the Client with the default scope. With the current version, it is returning a NullPointerException, and no warning is thrown.
This change fixes the issue and adds a warning about it during the build.