DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37979>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37979

           Summary: [collections] PredicateUtils.allPredicate() should not
                    throw if 1 or 0 predicates
           Product: Commons
           Version: 3.2
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Collections
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


PredicateUtils.allPredicate() throws IllegalArgumentException if array with one 
or zero predicates is 
given. This is bad, because when I make my list of predicates (for example, 
parsing some string) I have 
to explicitly check number of predicates in list. Current behaviour limits 
usages of method without 
reason.

PredicateUtils.allPredicate() should return first element of array in case of 
array with one element, and

PredicateUtils.allPredicate() should return truePredicate() in case of empty 
array.

Similary,

PredicateUtils.anyPredicate() should return first predicate of array in case of 
array with one element, and

PredicateUtils.anyPredicate() should return falsePredicate() in case of empty 
array.

PredicateUtils.onePredicate() ...

PredicateUtils.nonePredicate() ...

This is almost backward compatible change, because nobody either passes arrays 
with zero or one 
predicates to this method or checks for IllegalArgumentException.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to