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

[RESTEASY-2845] ResteasyWebTarget.proxy(Class) problem with questionmark in @Path with Regex #2754

Merged
merged 2 commits into from Dec 12, 2022

Conversation

petrberan
Copy link
Contributor

@petrberan
Copy link
Contributor Author

Hi, there seems to be a problem with CI dependencies. I'm not aware of any changes in dependencies in my code, is that an error I should fix?

Annotation[] pathParams = new Annotation[method.getParameterTypes().length];
HashMap<String, Object> pathParamsMap = new HashMap<>();

for (int i = 0; i < pathParams.length; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could just be method.getParameterTypes().length and the pathParams could be deleted as it's only used here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your advice, you are correct. I changed the code, tests run just fine and will push the changes once we resolve the second problem

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in new commit

Comment on lines 184 to 185
for (int i = 0; i < processors.length; i++) {
if (processors != null && processors[i] instanceof WebTargetProcessor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the processors can be null we need to do the null check sooner otherwise processors.length will throw an NPE.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for notifying me about this if statement, though this code should not be marked as changed - I may have unknowingly done some format changes and Github decided to highlight them. Similar if statement can be seen on line 185 in the committed file.

Despite that, I believe this check is not necessary, as processors is an object created by ProcessorFactory.createProcessorswhich returns an array of objects, no matter if it's empty or not. In my point of view, in order to get null Processors , the ProcessorFactory should throw an exception itself and thus such case can't happen.

I think that the original idea for the part of this line should be processors[i] since it's part of a for loop, but changing the part or completely removing it does not effect tests at all.

Should I fix the code so this check happens before the for loop?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right I see. It doesn't matter much, but if you're up for I say we do in this case as it looks odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, fixed in new commit

@ronsigal ronsigal added the main label May 4, 2021
@jamezp
Copy link
Contributor

jamezp commented Nov 29, 2022

Thank you for the contribution. We are cleaning up older PR's that seem to be stale. If you feel this is still an issue please feel free to re-open.

@jamezp jamezp closed this Nov 29, 2022
@jamezp jamezp reopened this Dec 1, 2022
@petrberan
Copy link
Contributor Author

Hi @jamezp can I ask for a review please? There is a one test failure, but I believe it's not caused by my changes as I don't see it in my local build

Signed-off-by: James R. Perkins <jperkins@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants