commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pétur Ingi Egilsson (JIRA) <j...@apache.org>
Subject [jira] [Created] (COLLECTIONS-559) Objects which are not of type V can be placed in a MultiValueMap<K,V>.
Date Wed, 01 Apr 2015 19:26:53 GMT
Pétur Ingi Egilsson created COLLECTIONS-559:
-----------------------------------------------

             Summary: Objects which are not of type V can be placed in a MultiValueMap<K,V>.
                 Key: COLLECTIONS-559
                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-559
             Project: Commons Collections
          Issue Type: Bug
          Components: KeyValue
    Affects Versions: 4.0
         Environment: java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
OS X 10.10
            Reporter: Pétur Ingi Egilsson


I declared a MultiValueMap as this:
{code}
MultiValueMap<Integer, Path> duplicates = new MultiValueMap<Integer, Path>();
{code}

Elsewhere in code I doing (by accident) something in this direction
{code}
duplicates.put(number, new LinkedList<Path>());
{code}

Exceptions were being thrown when values returned from the list could not be assigned to variables
of type Path.

{code:title=org.apache.commons.collections4.map.MultiValueMap.java}
public Object put(final K key, final Object value) {
...
{code}
I propose that Object in the above decleration is changed to T.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message