commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37979] New: - [collections] PredicateUtils.allPredicate() should not throw if 1 or 0 predicates
Date Tue, 20 Dec 2005 14:54:18 GMT
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: yozh@mx1.ru


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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message