Andre Flakowski created ARTEMIS-2594:
----------------------------------------

             Summary: TypedProperties#getLongProperty throws 
java.lang.NumberFormatException if property is not set / null
                 Key: ARTEMIS-2594
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2594
             Project: ActiveMQ Artemis
          Issue Type: Bug
    Affects Versions: 2.10.1
         Environment: CentOS 5.4.10 x86_64 GNU/Linux, openjdk version "11.0.3" 
2019-04-16 LTS
            Reporter: Andre Flakowski


See:
{code:java}
org.apache.activemq.artemis.utils.collections.TypedProperties#getLongProperty{code}
[https://github.com/apache/activemq-artemis/blob/2.10.1/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java#L234]

if the value for the key is not present / null, 
{code:java}
Long.valueOf(null);{code}
is invoked which will always throw a java.lang.NumberFormatException

presumably null should be returned and  the behaviour would be:
{code:java}
Long number = request.getLongProperty(key);
if (number != null) {
    Long sum = Long.sum(42, number);
}
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to