Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 39478 invoked from network); 19 Jun 2010 19:29:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Jun 2010 19:29:48 -0000 Received: (qmail 8616 invoked by uid 500); 19 Jun 2010 19:29:48 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 8493 invoked by uid 500); 19 Jun 2010 19:29:48 -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 8485 invoked by uid 99); 19 Jun 2010 19:29:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jun 2010 19:29:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jun 2010 19:29:46 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5JJTOB6009020 for ; Sat, 19 Jun 2010 19:29:24 GMT Message-ID: <28618481.96061276975764568.JavaMail.jira@thor> Date: Sat, 19 Jun 2010 15:29:24 -0400 (EDT) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (COLLECTIONS-352) AbstractCollectionDecorator is inconsistent with AbstractListDecorator. Uses private member variable instead of protected getter In-Reply-To: <589232329.189781265834127920.JavaMail.jira@brutus.apache.org> 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-352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated COLLECTIONS-352: -------------------------------------- Fix Version/s: 4.0-beta-1 (was: 4.0) > AbstractCollectionDecorator is inconsistent with AbstractListDecorator. Uses private member variable instead of protected getter > -------------------------------------------------------------------------------------------------------------------------------- > > Key: COLLECTIONS-352 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-352 > Project: Commons Collections > Issue Type: Bug > Components: Collection > Affects Versions: 3.0, 3.1, 3.2 > Reporter: Adam Gent > Priority: Minor > Fix For: 4.0-beta-1 > > > AbstractListDecorator uses getList() to access its private member variable for its methods: > {code} > public int indexOf(Object object) { > return getList().indexOf(object); > } > {code} > Which allows me to almost do something like this (notice I'm taking some liberties here with the no-arg serialization constructor): > {code} > public static class FutureList extends AbstractListDecorator { > private Future> futureList; > public FutureList(Future> futureList) > { > super(); > this.futureList = futureList; > } > @Override > protected Collection getCollection() > { > try > { > return futureList.get(); > } > catch (InterruptedException e) > { > throw new RuntimeException(e); > } > catch (ExecutionException e) > { > throw new RuntimeException(e); > } > } > } > {code} > But AbstractCollectionDecorator uses its private member variable > {code} > public boolean add(Object object) { > return collection.add(object); > } > {code} > When it should be IMHO: > {code} > public boolean add(Object object) { > return getCollection().add(object); > } > {code} > Of course most everybody has an armpit and an opinion :) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.