Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-5828

(7.1.0) Avoid inefficient iteration over Map

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Optional
    • 7.1.0.DR8
    • 7.1.0.DR3
    • ActiveMQ
    • None

    Description

      On few places in Artemis code, inefficient iteration over Map object is present.
      Example

        Map<Thread, StackTraceElement[]> threadMap = Thread.getAllStackTraces();
               for (Thread thread : threadMap.keySet()) {
                 StackTraceElement[] stack = threadMap.get(thread);
                 ....
      

      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

      Attachments

        Issue Links

          Activity

            People

              mstyk_jira Martin Styk (Inactive)
              mstyk_jira Martin Styk (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: