[
https://issues.apache.org/jira/browse/ARTEMIS-2769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17111593#comment-17111593
]
ASF subversion and git services commented on ARTEMIS-2769:
----------------------------------------------------------
Commit 001a4b409e2e83e2ae2b367ec4cb62b16ecaf586 in activemq-artemis's branch
refs/heads/master from Clebert Suconic
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=001a4b4 ]
ARTEMIS-2769 ConfigurationHelper Test returning default on parsing error
> 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
> Time Spent: 10m
> 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)