|
|
|
> {quote} I am using the @UnwrapValidatedValue with a custom Guava OptionalUnwrapper > and sometimes OptionalUnwrapper#getValidatedValueType() is called also for > non-Optional<> fields. > > > The bug reproduction is sporadic and tricky. {quote}
{quote} If you say sporadic, does it mean validating one and the same POJO POJ sometimes shows the issue and in some other cases it doesn't, without withou altering any parts of the code? {quote}
> {quote} I managed to pinpoint it to > {{ ValidatorImpl#setValidatedValueHandlerToValueContextIfPresent() }} that does > not perform {{ valueContext.setValidatedValueHandler( null ) }} when there is no > need for an unwrapper. Since {{ valueContext }} is re-used between fields, it is > possible for the OptionalUnwrapper to be first called for Optional fields > and then re-used for non-Optional fields with the same > validatedValueHandler of the Optional field. > {quote}
{quote} Interesting, this doesn't seem correct indeed. Without having a closer look loo I'd say the un-wrapper should be reset on the context between validation of different properties. {quote}
Mailing list discussion: https://www.mail-archive.com/hibernate-dev@lists.jboss.org/msg11303.html
Attached is the test reproduction (requires Guava)
|
|
|
|