Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 70858 invoked from network); 3 May 2007 19:45:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 May 2007 19:45:43 -0000 Received: (qmail 8118 invoked by uid 500); 3 May 2007 19:45:44 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 8000 invoked by uid 500); 3 May 2007 19:45:44 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 7943 invoked by uid 99); 3 May 2007 19:45:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2007 12:45:44 -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; Thu, 03 May 2007 12:45:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3BDD2714077 for ; Thu, 3 May 2007 12:45:16 -0700 (PDT) Message-ID: <26891879.1178221516242.JavaMail.jira@brutus> Date: Thu, 3 May 2007 12:45:16 -0700 (PDT) From: "Henri Yandell (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (COLLECTIONS-231) Not return the base interface on decorate In-Reply-To: <31451534.1162205116610.JavaMail.root@brutus> 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-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated COLLECTIONS-231: -------------------------------------- Fix Version/s: 3.3 Makes sense to me. > Not return the base interface on decorate > ----------------------------------------- > > Key: COLLECTIONS-231 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-231 > Project: Commons Collections > Issue Type: Improvement > Components: Map > Affects Versions: 3.2 > Reporter: Torsten Curdt > Fix For: 3.3 > > > At the moment I don't see a reason why the static "decorate" method does not return ListOrderedMap but just the base interface OrderedMap. > I want to decorate a Map to be a ListOrderedMap but due to the fact that the constructor is not visible and decorate only returns the base interface OrderedMap an unnecessary cast is required. > ListOrderedMap map = (ListOrderedMap)ListOrderedMap.decorate(new MyMap()); > As the decorate method is static and not part of any interface it should be fine to return the real type instead of the base. Otherwise I'd suggest to make the constructor visible. From the API POV It is not really understandable why this > ListOrderedMap map = new ListOrderedMap(); > is fine and creates a HashMap under the hood while this > ListOrderedMap map = new ListOrderedMap(new MyMap())); > is not ok. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org