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

Fix ClassCastException from return value validation with proxy when adaptConstraintViolations=true #33105

Closed
wants to merge 2 commits into from

Conversation

imvtsl
Copy link
Contributor

@imvtsl imvtsl commented Jun 27, 2024

Fix argument in call to applyReturnValueValidation() method in MethodValidationInterceptor.java. Method argument was passed instead of the return value of the method that was being validated.

Closes gh-33092

Fix argument in call to applyReturnValueValidation()
method in MethodValidationInterceptor.java. Method
argument was passed instead of the return value of the
method that was being validated.

Closes spring-projectsgh-33092
@pivotal-cla
Copy link

@imvtsl Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@imvtsl Thank you for signing the Contributor License Agreement!

@imvtsl imvtsl marked this pull request as ready for review June 27, 2024 03:08
@imvtsl
Copy link
Contributor Author

imvtsl commented Jun 27, 2024

@rstoyanchev
Please review.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 27, 2024
Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

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

It would be good to have a test. Would you like to add one, possibly in MethodValidationProxyReactorTests or MethodValidationProxyTests?

@rstoyanchev rstoyanchev changed the title Fix return value validation Fix ClassCastException from return value validation with proxy when adaptConstraintViolations=true Jun 27, 2024
@rstoyanchev rstoyanchev self-assigned this Jun 27, 2024
@rstoyanchev rstoyanchev added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 27, 2024
@rstoyanchev rstoyanchev added this to the 6.1.11 milestone Jun 27, 2024
sbluemel added a commit to sbluemel/spring-framework that referenced this pull request Jun 27, 2024
Fix argument in call to applyReturnValueValidation()
method in MethodValidationInterceptor.java. Method
argument was passed instead of the return value of the
method that was being validated.

Closes spring-projects spring-projectsgh-33105
@imvtsl
Copy link
Contributor Author

imvtsl commented Jun 27, 2024

Sure. I am working on adding test now.

Fix argument in call to applyReturnValueValidation()
method in MethodValidationInterceptor.java. Method
argument was passed instead of the return value of the
method that was being validated.

Closes spring-projectsgh-33092
@imvtsl imvtsl requested a review from rstoyanchev June 28, 2024 00:45
@imvtsl
Copy link
Contributor Author

imvtsl commented Jun 28, 2024

@rstoyanchev
I added tests to MethodValidationProxyTests.
In tests, I changed expected exception from ValidationException to ConstraintViolationException as ConstraintViolationException is more specific. I hope that's okay?

I read CONTRIBUTING.md and I have a query. Should I sqaush these 2 commits into one or is it okay?

rstoyanchev pushed a commit that referenced this pull request Jun 28, 2024
Fix argument in call to applyReturnValueValidation()
method in MethodValidationInterceptor.java. Method
argument was passed instead of the return value of the
method that was being validated.

See gh-33105
@rstoyanchev
Copy link
Contributor

I've squashed them for you and updated the tests a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClassCastException from return value validation with proxy when adaptConstraintViolations=true
4 participants