Niclas Hedhman wrote: > On Mon, Jun 16, 2008 at 10:26 PM, Georg Ragaller <[EMAIL PROTECTED]> wrote: > >> Should we really do that? So we won't get an NPE if this NPE comes from >> an implementation error in the constraint***, but a valid result (false >> in this case). >> >> I think we should add the null check to the expression like I did it: >> >> OLD: value.trim().length() > 0; >> NEW: (null != value) && (value.trim().length() > 0); >> >> which is also 'simplistic' and the Constraint#isValid javadoc should >> state that 'value' can be null. > > There are of course good argument for both cases. > > I think Rickard is trying to avoid that the "value" argument need to > be checked everywhere in the constrain implementations.
Yes, that's it. We are talking checks which should be reasonably trivial to implement. If they are not, then it is quite possible that it's not a constraint, and that the concept is being confused with validation. I'm sorry, but I think I'll keep the current version, which considers an NPE to be a failed constraint. /Rickard _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

