Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 81525 invoked from network); 15 Aug 2007 05:23:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Aug 2007 05:23:53 -0000 Received: (qmail 94887 invoked by uid 500); 15 Aug 2007 05:23:50 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 94812 invoked by uid 500); 15 Aug 2007 05:23:49 -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 94803 invoked by uid 99); 15 Aug 2007 05:23:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2007 22:23:49 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2007 05:23:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A843F7141F2 for ; Tue, 14 Aug 2007 22:23:30 -0700 (PDT) Message-ID: <22302501.1187155410634.JavaMail.jira@brutus> Date: Tue, 14 Aug 2007 22:23:30 -0700 (PDT) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (COLLECTIONS-256) ListUtils.transformedList(list, transformer) doesn't transform MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COLLECTIONS-256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated COLLECTIONS-256: -------------------------------------- Fix Version/s: 3.3 Given that javadoc states: "Returns a transformed list backed by the given list." Then this seems like a definite bug that needs fixing. > ListUtils.transformedList(list, transformer) doesn't transform > -------------------------------------------------------------- > > Key: COLLECTIONS-256 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-256 > Project: Commons Collections > Issue Type: Bug > Components: List > Affects Versions: 3.2 > Environment: Java 1.5 > Reporter: Kurtis Williams > Fix For: 3.3 > > > The static method ListUtils.transformedList(List list, Transformer trans) does not apply the transformer before returning the list. I've traced into the code and it falls all the way through to the TransformedCollection constructor which has documentation that states that items existing in the list are NOT transformed. This yields bizarre unexpected behavior for this method. > Conversely, the ListUtils.predicatedList(List list, Predicate pred) DOES apply the predicate. These methods are very similar but behave inconsistently. > If the transformer is not applied to the list, the method's usefulness is somewhat limited and causes the user to create an extra unwanted list in some circumstances: > // To transform an existing list > List myList = ... some list to be transformed ... > List transformed = ListUtils.transformedList(new ArrayList(), myTransformer); > transformed.addAll(myList); > I would expect a much shorter implementation such as: > List transformed = ListUtils.transformedList(myList, myTransformer) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.