[ 
https://issues.apache.org/jira/browse/AMQ-5616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Timothy Bish resolved AMQ-5616.
-------------------------------
    Resolution: Fixed

Fixed on master.

> Declare variables as ConcurrentMap not ConcurrentHashMap to avoid issues 
> after compiling on Java 8
> --------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-5616
>                 URL: https://issues.apache.org/jira/browse/AMQ-5616
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 5.11.1
>            Reporter: Timothy Bish
>            Assignee: Timothy Bish
>            Priority: Minor
>             Fix For: 5.12.0
>
>         Attachments: AMQ5616.patch
>
>
> Java 8 redefines the method keySet() on ConcurrentHashMap to return a 
> narrower type than the standard return type given in the Map interface. If 
> the code is compiled in Java 8 and then run under Java 7 this causes linking 
> issues.  We don't depend on the narrowed type and can live with the standard 
> for our usages of ConcurrentHashMap
> We can avoid these issues by always declaring the instances of 
> ConcurrentHashMap where we need method like putIfAbsent in terms of the 
> interface ConcurrentMap



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

Reply via email to