[bv-dev] ValueExtractionUnwrappingTest: quibble between spec and TCK
guillaume.smet at gmail.com
Sat Mar 31 07:42:33 EDT 2018
On Sat, Mar 31, 2018 at 11:51 AM, Gunnar Morling <gunnar at hibernate.org>
> That's an interesting one; it was originally worded exactly like Matt
> suggests, but then we changed into the current version:
> I'm sympathetic to the current behaviour of that TCK test and to adjusting
> the spec wording accordingly. Only you, Guillaume, didn't seem to like that
> alternative as per our discussion on June 26th, in the Hibernate Validator
> chat room. Perhaps you remember what made you dislike it back then?
Ah, yes, I remember now.
The paragraph is:
- If the constraint carries neither the Unwrapping.Unwrap nor the
- If there is exactly one maximally-specific type-compliant value
extractor and this extractor is marked with @UnwrapByDefault, this
extractor is applied;
- Otherwise, no value extractor is applied.
The initial wording "exactly one maximally-specific type-compliant value
extractor marked with @UnwrapByDefault" was not accurate because it was not
clear if we should determine the "maximally-specific type-compliant value
extractor" first and then check if it is @UnwrapByDefault. This is
important because, for a given type parameter, we want to get the maximally
specific value extractor first and then we want to check if it is marked
with @UnwrapByDefault. We don't want to get the maximally specific (value
extractor marked with @UnwrapByDefault).
We also miss a mention of the case when there are 2 maximally-specific
type-compliant value extractors marked with @UnwrapByDefault.
I think a wording more in line with our intentions would be:
- We determine the maximally-specific type-compliant value extractors.
- If there are no matching value extractors or none is marked with
@UnwrapByDefault, no value extractor is applied.
- If exactly one is marked with @UnwrapByDefault, this very extractor
- If more than one are marked with @UnwrapByDefault, a
ConstraintDeclarationException is raised.
I would lean towards implementing it this way in the implementations and
fix it for BV 2.1.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the beanvalidation-dev