Skip to content

Avoid use of double constructor of BigDecimal #1282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

marschall
Copy link
Contributor

Codacy warns about an Error Prone [1] use of the double constructor of
BigDecimal in tests. The reason given is that it is a source of
precision loss if the number does not have an exact double
representation. The recommendation is to use the String constructor of
BigDecimal instead as it does not require using a lossy argument.

This commit contains the following changes:

  • replace usage of the double constructor of BigDecimal with the
    String constructor of BigDecimal in JdbcTemplateQueryTests
  • update the copyright year

[1] http://errorprone.info/bugpattern/BigDecimalLiteralDouble

Issue: SPR-15077

Codacy warns about an Error Prone [1] use of the double constructor of
BigDecimal in tests. The reason given is that it is a source of
precision loss if the number does not have an exact double
representation. The recommendation is to use the String constructor of
BigDecimal instead as it does not require using a lossy argument.

This commit contains the following changes:

 - replace usage of the double constructor of BigDecimal with the
   String constructor of BigDecimal in JdbcTemplateQueryTests
 - update the copyright year

 [1] http://errorprone.info/bugpattern/BigDecimalLiteralDouble

Issue: SPR-15077
@snicoll snicoll self-assigned this Jan 4, 2017
snicoll added a commit that referenced this pull request Jan 4, 2017
* pr/1282:
  Avoid use of double constructor of BigDecimal
@snicoll
Copy link
Member

snicoll commented Jan 4, 2017

Fixed in 3f97ab1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants