Georg Ragaller wrote: > @Niclas > > Fixed it directly in NotEmptyConstraint#isValid. But I was wondering > about the @NotNull annotation on the @NotEmpty annotation itself. Should > that have any effect on @NotEmpty or is this for documentation purpose > only? I.e. did I fix it at the right place? > > If so, I would fix some of the other constraints too, like > ContainsConstraint, GreaterThanConstraint and so on (same pattern: > 'value' argument is not checked against null). > > Also added new testcases for org.qi4j.library.framework.constraint.
Well, the way this was done in the previous implementation was to do try/catch NPE around the constraint invocation, specifically so that the constraint itself did not have to do null checks (they should be as simplistic as possible). So, the best way to do this is actually to add try/catch NPE in all places where isValid is called, and consider an NPE to be a constraint failure. I'll do that immediately. Easy to do. /Rickard _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

