You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Galkin Alexey (Jira)" <ji...@apache.org> on 2024/04/20 14:07:00 UTC

[jira] [Created] (ARTEMIS-4735) BOXED PRIMITIVE FOR PARSING in ActiveMQConnectionMetaData.java

Galkin Alexey created ARTEMIS-4735:
--------------------------------------

             Summary: BOXED PRIMITIVE FOR PARSING in ActiveMQConnectionMetaData.java
                 Key: ARTEMIS-4735
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4735
             Project: ActiveMQ Artemis
          Issue Type: Bug
            Reporter: Galkin Alexey


[On line 48|https://github.com/apache/activemq-artemis/blob/main/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionMetaData.java(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.

 

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author Alexey Galkin.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)