<div dir="auto">That&#39;s why I advocate being literal; then you don&#39;t have to guess at people&#39;s intention. Can&#39;t they compose a version that defaults strict to false?<div dir="auto"><br></div><div dir="auto">Matt</div></div><div class="gmail_extra"><br><div class="gmail_quote">On May 9, 2017 6:22 PM, &quot;Gunnar Morling&quot; &lt;<a href="mailto:gunnar@hibernate.org">gunnar@hibernate.org</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is inclusive more common really? My feeling is that one would want to<br>
exclude 0 more often than not. But I don&#39;t have any good idea of how<br>
to quantify that...<br>
<br>
2017-05-09 19:48 GMT+02:00 Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt;:<br>
&gt; Well I object :)<br>
&gt; You are addressing the less common scenario with this default.<br>
&gt;<br>
&gt;&gt; On 9 May 2017, at 11:09, Gunnar Morling &lt;<a href="mailto:gunnar@hibernate.org">gunnar@hibernate.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; So my preference is to make strict() default to true (so it&#39;s<br>
&gt;&gt; consistent with the default value for orPresent() of @Past/@Future).<br>
&gt;&gt; I&#39;ve filed PR <a href="https://github.com/beanvalidation/beanvalidation-api/pull/106" rel="noreferrer" target="_blank">https://github.com/<wbr>beanvalidation/beanvalidation-<wbr>api/pull/106</a>.<br>
&gt;&gt;<br>
&gt;&gt; If there are no objections by Thursday, I&#39;ll merge it then.<br>
&gt;&gt;<br>
&gt;&gt; Thanks for any comments,<br>
&gt;&gt;<br>
&gt;&gt; --Gunnar<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2017-05-03 18:13 GMT+02:00 Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt;:<br>
&gt;&gt;&gt;&gt; On Wed 17-04-26 10:40, Gunnar Morling wrote:<br>
&gt;&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; 2017-04-25 20:05 GMT+02:00 Matt Benson &lt;<a href="mailto:mbenson@apache.org">mbenson@apache.org</a>&gt;:<br>
&gt;&gt;&gt;&gt;&gt; After reviewing the proposed API, I have the following<br>
&gt;&gt;&gt;&gt;&gt; questions/suggestions. I apologize if any of these have already been<br>
&gt;&gt;&gt;&gt;&gt; considered:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; * Should there be a common superinterface for<br>
&gt;&gt;&gt;&gt;&gt; Path$[BeanNode|PropertyNode|<wbr>ContainerElementNode], all of which define<br>
&gt;&gt;&gt;&gt;&gt; the same methods?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I&#39;ve been wondering the same, but come to think that it doesn&#39;t give you much.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; You (as a user) are going to work with specific node types (as<br>
&gt;&gt;&gt;&gt; narrowed down via getKind() + as()), so I would not expect you to deal<br>
&gt;&gt;&gt;&gt; with that super-type in your code. It&#39;d put the declaration of those<br>
&gt;&gt;&gt;&gt; methods into one place, which is nice, though I kinda like the<br>
&gt;&gt;&gt;&gt; simplicity of the current Node hierarchy, with one specific sub-type<br>
&gt;&gt;&gt;&gt; per kind.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; What do others think?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I think that was my idea for not adding a hierarchy back in 1.x.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; * Should ValidatorContext include a self type, as does Configuration?<br>
&gt;&gt;&gt;&gt;&gt; This would facilitate the use of custom ValidatorContext subclasses.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Ah, there&#39;s even an issue for this:<br>
&gt;&gt;&gt;&gt; <a href="https://hibernate.atlassian.net/browse/BVAL-211" rel="noreferrer" target="_blank">https://hibernate.atlassian.<wbr>net/browse/BVAL-211</a>.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; It would have been great to make this a self-referential type from the<br>
&gt;&gt;&gt;&gt; get-go, but at this point I&#39;d rather leave it as is. Essentially it<br>
&gt;&gt;&gt;&gt; only causes a small effort to providers which need to redeclare all<br>
&gt;&gt;&gt;&gt; the ValidatorContext methods to return their own specialised sub-type.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The reason I&#39;m reluctant to add it is that users - when upgrading<br>
&gt;&gt;&gt;&gt; existing code to BV 2.0 - will get a raw type warning when assigning<br>
&gt;&gt;&gt;&gt; ValidatorContext to a variable. I&#39;d prefer to avoid this, at the cost<br>
&gt;&gt;&gt;&gt; of the few method re-definitions to be done by providers once, which<br>
&gt;&gt;&gt;&gt; seems acceptable.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; * Should Positive/Negative#strict() default true be provided as<br>
&gt;&gt;&gt;&gt;&gt; #orZero() default false, for commonality with<br>
&gt;&gt;&gt;&gt;&gt; [Past|Future]#orPresent() ?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hum, yes, good point. I think I&#39;d prefer that.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; @Emmanuel, I vaguely remember we discussed this. Did you see a good<br>
&gt;&gt;&gt;&gt; reason for the current default?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I don&#39;t even vaguely remember talking about it. Sounds good.<br>
&gt;&gt;&gt; Actually I remember now, we discussed whether Positive#orZero should be<br>
&gt;&gt;&gt; defaulted to true.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I imagine that &gt;=0 is the most common use case for @Positive (despite<br>
&gt;&gt;&gt; the math definition).<br>
&gt;&gt;&gt; As for @Negative, I&#39;m on the fence.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; @All, what do you think?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Matt<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --Gunnar<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt;&gt; beanvalidation-dev mailing list<br>
&gt;&gt;&gt;&gt;&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
&gt;&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt;&gt; beanvalidation-dev mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
&gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt;&gt; beanvalidation-dev mailing list<br>
&gt;&gt;&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; beanvalidation-dev mailing list<br>
&gt;&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; beanvalidation-dev mailing list<br>
&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
</blockquote></div></div>