Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-224

FindBugs performance warnings on StackKeyedObjectPool

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.6.1
    • Labels:

      Description

      FindBugs is currently showing 2 performance warnings in StackKeyedObjectPool due to the usage of

      new Integer(value)

      as opposed to

      Integer.valueOf(value)

      Also, it seems we create a new Integer instance each time we need to store 1 in the map – since the Integer class is immutable, we can actually share one single instance for these cases, and reduce pressure on the GC, and this patch addresses this minor optimization as well.

        Attachments

        1. POOL-224.patch.bz2
          1 kB
          Liviu Tudor

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              liviutudor Liviu Tudor
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified