activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMQ-5616) Declare variables as ConcurrentMap not ConcurrentHashMap to avoid issues after compiling on Java 8
Date Wed, 25 Feb 2015 20:37:04 GMT

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

Timothy Bish updated AMQ-5616:
------------------------------
    Attachment: AMQ5616.patch

Initial pass at this task, need to validate and test full suite.

> 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)

Mime
View raw message