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

Clebert Suconic closed ARTEMIS-2769.
------------------------------------

> NumberFormatException  
> -----------------------
>
>                 Key: ARTEMIS-2769
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2769
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.12.0, 2.13.0
>            Reporter: Todor Neykov
>            Assignee: Clebert Suconic
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 2.14.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Hi, 
> I found an issue in ConfigurationHelper.getIntProperty() 
> If there is a String propery but not a numeric value it lead to 
> NumberFormatException. 
> My expectation in this case is to be returned a default value instead of 
> exception. 
> The code is
> {code:java}
> if (prop instanceof String) {
>     return Integer.valueOf((String) prop);
> } else ...
>  
> {code}
> Fix proposal : 
> {code:java}
> if (prop instanceof String)
> {
>     try
>     {
>         return Integer.valueOf((String)prop);
>     }
>     catch (NumberFormatException e)
>     {
>         ActiveMQClientLogger.LOGGER.propertyNotInteger(propName, 
> prop.getClass().getName());
>         return def;
>     }
> }
> else ...
> {code}
> Same case is in getLongProperty() 
>  



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

Reply via email to