[
https://issues.apache.org/jira/browse/ARTEMIS-710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15453037#comment-15453037
]
ASF subversion and git services commented on ARTEMIS-710:
---------------------------------------------------------
Commit 275924e8f4718ac07715eee464db4438099d63bb in activemq-artemis's branch
refs/heads/master from [~mstyk]
[ https://git-wip-us.apache.org/repos/asf?p=activemq-artemis.git;h=275924e ]
ARTEMIS-710 Avoid inefficient iteration over Map
> Avoid inefficient iteration over Map
> ------------------------------------
>
> Key: ARTEMIS-710
> URL: https://issues.apache.org/jira/browse/ARTEMIS-710
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Affects Versions: 1.4.0
> Reporter: Martin Styk
> Priority: Minor
>
> On few places in Artemis code, inefficient iteration over Map object is
> present.
> Example
> {code:java}
> Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
> for (Thread thread : threadMap.keySet()) {
> StackTraceElement[] stack = threadMap.get(thread);
> ....
> {code}
> To make it more efficient, we should use Map.Entry instead of getting keySet
> and than finding corresponding value.
> Places where this could be changed
> * ScaleDownHandler#scaleDownDuplicateIDs
> * PostOfficeJournalLoader#recoverPendingPageCounters
> * ActiveMQTestBase#tearDown
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)