<div dir="ltr">Gunnar, <div><br></div><div>I&#39;m using glassfish 4.0, that uses hibernate validator 5.0.0.Final. </div><div><br></div><div>Debugging ValidationExtension for a while, i found one problem (may be not). </div>
<div>When i use validations constraints in the abstract class, the ValidationEnabledAnnotatedType that enable the interception of the bean, is applied on the subclass implementation and the abstract class,<span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> but when i use an interface, the wrappedType is applied just in the interface.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><font face="arial, sans-serif">That way, the interface implementation will never be intercepted, right?</font><br></div>
<div><br></div><div><font face="arial, sans-serif">I will create an entry on forum, but there is no stacktrace in my case, the expected validation just not work.</font></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div><div><font face="arial, sans-serif">Att,</font></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/6 Gunnar Morling <span dir="ltr">&lt;<a href="mailto:gunnar@hibernate.org" target="_blank">gunnar@hibernate.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I don&#39;t think that&#39;s a spec problem.</div><div><br></div><div>The @NotNull constraint should be validated, no matter wether Foo is an interface or an abstract class. Generally constraints on overridden/implemented methods are to be considered, you only may not add any more parameter constraints in subclasses/implementations.</div>

<div><br></div><div>Are you using the Hibernate Validator CDI portable extension? Which container do you use? Could you create an entry with the complete stack trace and a detailed description of your environment to <a href="https://forum.hibernate.org/viewforum.php?f=9" target="_blank">https://forum.hibernate.org/viewforum.php?f=9</a>?</div>

<div><br></div><div>--Gunnar</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/6 Denis Silva <span dir="ltr">&lt;<a href="mailto:denis.analistajava@gmail.com" target="_blank">denis.analistajava@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi, </div><div><br></div><div>I&#39;m doing some tests with bean validation, and i have some doubts about the behavior of method constraints on inheritance hierarchies.</div>

<div>The specification tells about Liskov substitution, on method constraints within inheritance hierarchies, but i made the test bellow with </div>
<div>the reference implementation ( hiberante validator 5.1 ), and not understand if this is a bug in implementation or my misunderstanding the specification.</div><div><br></div><div>public interface Foo {</div><div>     public void doStuff(@NotNull String v);</div>


<div>}</div><div><br></div><div>@Named</div><div>public class Bar implements Foo {</div><div>     public void doStuff(String v) {}</div><div>}</div><div><br></div><div>Calling bar.doStuff(null), the validation is not fired.</div>


<div>But if i changed Foo interface to an abstract class, and made Bar extends it, the validation is fired and a ConstraintViolationException is propagated.</div><div>The test was done with cdi.</div><div><br></div><div>

What should be the appropriate behavior?</div><span><font color="#888888">
<div><br></div>-- <br>Denis Tiago<br></font></span></div>
<br></div></div>_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Denis Silva<br>
Analista Programador Java<br>11 - 8334-9915
</div>