Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7C3143F02 for ; Tue, 3 May 2011 00:26:44 +0000 (UTC) Received: (qmail 49888 invoked by uid 500); 3 May 2011 00:26:44 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 49827 invoked by uid 500); 3 May 2011 00:26:44 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 49819 invoked by uid 99); 3 May 2011 00:26:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 May 2011 00:26:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 May 2011 00:26:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 270F8BE482 for ; Tue, 3 May 2011 00:26:03 +0000 (UTC) Date: Tue, 3 May 2011 00:26:03 +0000 (UTC) From: "Anirudh Vyas (JIRA)" To: issues@commons.apache.org Message-ID: <709296528.17013.1304382363156.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COLLECTIONS-88) [collection] Map filter with MapUtils.predicatedMap feature request MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COLLECTIONS-88?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027952#comment-13027952 ] Anirudh Vyas commented on COLLECTIONS-88: ----------------------------------------- I don't buy that argument, I can submit the patch if thats what it takes, I still feel this is a valid issue, and the method should be called filter( ) on MapUtils, that solution being described is ugly. My 2 cents. Anirudh > [collection] Map filter with MapUtils.predicatedMap feature request > ------------------------------------------------------------------- > > Key: COLLECTIONS-88 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-88 > Project: Commons Collections > Issue Type: Bug > Affects Versions: 3.1 > Environment: Operating System: other > Platform: Other > Reporter: Luc Carpentier > > Hello, > I stumbled into the following problem: > A client submits an http request with prefixed parameters. Each prefix will > have it's own javabean to populate. So if there are two prefixes, then there > will be two different javabeans to populate from the request parameters. > I created a PrefixPredicate that only allows values with a specific prefix. I > then used this PrefixPredicate to copy the Map with the request parameters to > a predicated Map with: > Map predicatedMap = MapUtils.predicatedMap(dataMap,keyPredicate,null); > However, since the request parameters contain parameters with other prefixes > as well, this returns an IllegalArgumentException. > It would be nice to be able to specify to the MapUtils.predicatedMap method to > ignore entries that do not comply to the predicate instead of to throw an > exception. > There are lots of possabilities to filter on a Collection, but a Map is not a > collection... -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira