Skip to content

Change of behaviour for UUID in bean validation output in v5.3.27 #30661

@vandeven

Description

@vandeven

Affects: 5.3.27


Hello spring team!
I tried to update my spring-boot application, and I found a change of behaviour in bean validation output on how it renders UUID's
The old behaviour would show the .toString() version of the UUID, the new version would show the object id instead.
I traced it down to this change:

https://github.com/spring-projects/spring-framework/blob/v5.3.26/spring-context/src/main/java/org/springframework/validation/FieldError.java
to
https://github.com/spring-projects/spring-framework/blob/v5.3.27/spring-context/src/main/java/org/springframework/validation/FieldError.java

in the toString() of FieldError ObjectUtils.nullSafeToString(this.rejectedValue) was changed to ObjectUtils.nullSafeConciseToString(this.rejectedValue)

Here it checks if it is a "isSimpleValueType" and if so, it calls the toString() and otherwise it returns the typename.
From reading the issues I think this change happend because otherwhise whole object hierarchies would be included, which is not really useful. UUID's do sound like an exception to this rule.
I do not mind making a pull request for this myself (would be nice to help spring :)) but I would like some guidance to where you think it is best to solve this (if you consider this desirable behaviour). I could UUID to the isSimpleValueType method, or should I make a special case for this?

Kind regards

Ties

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions