Skip to content

Commit

Permalink
Restore full representation of rejected value in FieldError.toString()
Browse files Browse the repository at this point in the history
We would preferably use ObjectUtils.nullSafeConciseToString(rejectedValue) here but revert to the full nullSafeToString representation for strict backwards compatibility (programmatic toString calls as well as exception messages).

Closes gh-30799
  • Loading branch information
jhoeller committed Jul 4, 2023
1 parent 0226580 commit 1dc9dff
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -124,8 +124,10 @@ public int hashCode() {

@Override
public String toString() {
// We would preferably use ObjectUtils.nullSafeConciseToString(rejectedValue) here but
// keep including the full nullSafeToString representation for backwards compatibility.
return "Field error in object '" + getObjectName() + "' on field '" + this.field +
"': rejected value [" + ObjectUtils.nullSafeConciseToString(this.rejectedValue) + "]; " +
"': rejected value [" + ObjectUtils.nullSafeToString(this.rejectedValue) + "]; " +
resolvableToString();
}

Expand Down

0 comments on commit 1dc9dff

Please sign in to comment.