schwaller
(Martin Schwaller)
July 2, 2020, 9:56am
1
For some reason the rule java:S2111 did not detect the following issue:
Object myDoubleObject = 23.5d;
new BigDecimal((Double)myDoubleObject)
However, when i change it to the following the issue is detected correctly:
Object myDoubleObject = 23.5d;
new BigDecimal((double)(Double)myDoubleObject)
SonarQube Version: 8.0.0.29455
SQUID: https://rules.sonarsource.com/java/RSPEC-2111
I hope this is not expected behaviour
Quentin
(Quentin Jaquier)
July 6, 2020, 10:03am
2
Hello @schwaller ,
I agree with you and this is not an expected behavior.
In fact, it seems that BigDecimal
created from boxed types are not detected, but still subject to the problem.
Ticket created (SONARJAVA-3455 ).
Thanks!
Quentin
system
(system)
Closed
July 13, 2020, 10:03am
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.