#15 Validator.validateFieldValue should not return null

closed-fixed
seb
None
5
2008-02-03
2008-02-03
Axel Fontaine
No

Oval v1.10

net.sf.oval.Validator.validateFieldValue

Javadoc:
...
* @return a list with the detected constraint violations. if no violations are detected an empty list is returned
* @throws ...

Code (line 1257):
if (checks == null || checks.size() == 0) return null;

Clearly, there is a contradiction.

I vote for a code change:
final List<ConstraintViolation> violations = CollectionFactoryHolder.getFactory().createList();
if (checks == null || checks.size() == 0) return violations;

Discussion

  • seb
    seb
    2008-02-03

    Logged In: YES
    user_id=341856
    Originator: NO

    Fixed in SVN. Thanks for reporting!

     
  • seb
    seb
    2008-02-03

    • assigned_to: nobody --> sebthom
    • status: open --> closed-fixed