[
https://issues.apache.org/jira/browse/CONFIGURATION-766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16962018#comment-16962018
]
Gary D. Gregory commented on CONFIGURATION-766:
-----------------------------------------------
I:
* Added a test to document current behavior.
* Added an ignored test from this ticket.
Please rebase your PR on master.
The proposed change will break behavioral compatibility of course. I am
wondering if we should:
* Change the behavior per the proposal, or
* Provide the new behavior via a new API (like {{toBigDecimalFoo}} where
{{Foo}} is not meaningful post fix.
I'd also like feedback from [~chtompki].
> BigDecimal(double) should not be used
> -------------------------------------
>
> Key: CONFIGURATION-766
> URL: https://issues.apache.org/jira/browse/CONFIGURATION-766
> Project: Commons Configuration
> Issue Type: Bug
> Environment: A single occurrence in file PropertyConverter.java, line
> 393:
> {code:java}
> return new BigDecimal(n.doubleValue());
> {code}
> Reporter: Haris Adzemovic
> Priority: Minor
>
> Static analysis with SonarQube shows a violation of rule
> [S2111|[https://rules.sonarsource.com/java/type/Bug/RSPEC-2111]] - a
> dangerous use of the BigDecimal constructor.
> Fixed by using BigDecimal.valueOf(param) instead.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)