Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-4735

BOXED PRIMITIVE FOR PARSING in ActiveMQConnectionMetaData.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      On line 48(JMS_MAJOR_VERSION = Integer.valueOf(versionProps.getProperty("activemq.version.implementation.majorVersion", "2")), a truly boxed primitive is created from a string simply to extract the value of the unboxed primitive. This approach is inefficient and can lead to code redundancy and loss of performance.

      A more efficient approach would be to immediately convert strings to primitive values ​​without creating boxed primitives. For example, use the Integer.parseInt() method to directly convert a string to an int without creating an Integer object.

      Attachments

        Issue Links

          Activity

            People

              jbertram Justin Bertram
              galkinaa2 Galkin Alexey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: