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 16C69F3C5 for ; Tue, 14 May 2013 00:53:16 +0000 (UTC) Received: (qmail 54725 invoked by uid 500); 13 May 2013 23:53:16 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 54619 invoked by uid 500); 13 May 2013 23:53:16 -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 54609 invoked by uid 99); 13 May 2013 23:53:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 May 2013 23:53:16 +0000 Date: Mon, 13 May 2013 23:53:16 +0000 (UTC) From: "Matt Benson (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COLLECTIONS-461) splitmap.TransformedMap is not really a Map MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COLLECTIONS-461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13656547#comment-13656547 ] Matt Benson commented on COLLECTIONS-461: ----------------------------------------- I'm still not connecting the dots as to how the "real" Maps are compromised. {{TransformedMap}} isn't a {{Map}}. It's not intended to be plugged in as one. Rather, if you need to be agnostic to whether you have a {{Map}} or a {{Put}} and a {{Get}}, you can program to the {{Put}}/{{Get}} APIs and use any of the {{IterableMap}} impls provided by {{\[collections\]}} to implement these as well. By extending {{Map}} and {{Put}}, {{IterableMap}} forces the RT of {{#put()}} to be narrowed to {{V}}. > splitmap.TransformedMap is not really a Map > ------------------------------------------- > > Key: COLLECTIONS-461 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-461 > Project: Commons Collections > Issue Type: Bug > Reporter: Sebb > Fix For: 4.x > > > splitmap.TransformedMap is part of the Get/Put hierarchy, but it does not behave like a proper Java Map. > In particular, java.util.Map.put(K, V) returns V. > However the collections Put interface returns Object. > As far as I can tell, this was done in order to be able to include TransformedMap in the hiearchy. But the side effect is to break the generics for all the non-transformer maps in the hierarchy. > Maybe there should be a separate PutTransformed interface which has the appropriate generic types, i.e. > public T put(K key, V value) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira