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=30020>. 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=30020 Method that add a Object to a Collection if it was not null Summary: Method that add a Object to a Collection if it was not null Product: Commons Version: 3.2 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Collections AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] It would be a new static method to CollectionUtils class. It would retur boolean because add() method from Collection returns a boolean. It would had only a line: public static boolean addNotNull(Collection c, Object o) { return (o != null)? c.add(o): false; } Of course if c was null, it will throw a NullPointerException. Aparently it is possible use a PredicatedCollection with NotNullPredicate. But it will trhow a IllegalArgumentException if o was null. It is not interesting. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
