Incorrect value handler on trace logging

Description

When trace logging is enabled, ConstraintTree calls valueContext.getCurrentValidatedValue() before the validatedValueHandler has been set in getInitializedConstraintValidator. This results in a cast exception when working with Optional and non-Optional fields. The correct behavior is to log the raw `currentValue` instead of trying to unwrap it. Or move the tracing statements until after the correct validatedValueHandler has been assigned.

Originally reported on the dropwizard project

This is similar to HV-1127 but only when trace logging is on.

Tested on 5.4.1, but earlier versions likely effected too.

Environment

None

Assignee

Gunnar Morling

Reporter

N

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Major
Configure