[ 
https://issues.apache.org/jira/browse/ARTEMIS-4735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Bertram updated ARTEMIS-4735:
------------------------------------
    Description: 
[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.

  was:
[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.


> 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
>            Assignee: Justin Bertram
>            Priority: Minor
>
> [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.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to