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
[RESTEASY-2026]: Priority override MUST be taken into account when registering #1709
Conversation
@asoldano With the changes I did in this PR, I had to modify some test classes you wrote for unit test |
@NicoNes thanks for your PR, can you please look at the conflict and resolve it? (master recently went through a bit of refactoring, sorry) |
Hi @asoldano, Yes sure. I've just fixed the conflicts, everything is OK now. |
@asoldano, I'll take a look. |
ContextResolver Signed-off-by: NicoNes <nicolas.nesmon@gmail.com>
227efd1
to
a67f6e8
Compare
@ronsigal any update here? |
@asoldano, Ooops. Will do. |
{ | ||
rtn.add(resolver.obj); | ||
} | ||
} |
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.
Hi @NicoNes.
I'm trying to understand why you took this section out. I don't see any broken tests, but could you explain your thinking?
Thanks,
Ron
Hey @ronsigal , Actually there were two problems with the old code:
So to be precise To really test the first problem I should enrich the test registering
Let me know if it's clearer. |
Hi @NicoNes, re: "That's what I fixed by adding priority argument to addContextResolver(...) signature." I took that to be an efficiency measure, since line 1118 recalculates priority. re: "Then I realize that it was because of the if section at line https://github.com/resteasy/Resteasy/pull/1709/files#diff-c684d1c557d88c213e775fefc4fb0f5eL1165 which was turning, the already well sorted list, upside down. Thats why I remove this if section and only take the else bloc." It's the removal of the if section that concerns me, since someone (probably Bill Burke) gave a justification for the backwards sort. On the other hand, the javadoc for Providers.getContextResolver() says
The comment in ResteasyProviderFactoryImpl.getContextResolvers() seems to say that, if "*/*" is passed in, a resolver with @produces("*/*") would be preferred over one with @produces("text/plain"), which contradicts the javadoc rule. So I guess I'm willing to say that the TCK issue is no longer applicable. -Ron |
Hey @ronsigal
Yep, it was calculated at this line but without considering user priorityOverride
Actually I was not really confident neither when I removed it until I saw the spec section you talked about. Then I made the change and also review test
Unless it has already been done, is it possible to run the TCK tests to be sure ? |
This test has been originally written by Bill here |
@NicoNes, for legal reasons, I'm not supposed to talk about the TCK publicly. But I can say that your changes are correct. Thank you, as always. |
No description provided.