[Codenarc-developer] new BigDecimal(42)
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2011-07-30 01:04:17
|
Regarding this issue: https://sourceforge.net/tracker/?func=detail <https://sourceforge.net/tracker/?func=detail&aid=3376518&group_id=250145&at id=1126573> &aid=3376518&group_id=250145&atid=1126573 The UnnecessaryBigDecimalInstantiation recommends rewriting new BigDecimal("42") as 42G, but this will produce a BigInteger, not a BigDecimal. The same issue exists for new BigDecimal(42) and BigDecimal(42L). Both recommend replacing with 42G. I am inclined to have the UnnecessaryBigDecimalInstantiation not produce violations for new BigDecimal(42), new BigDecimal(42L) or new BigDecimal("42") - i.e., when the parameter evaluates to an integer/long. Any objection? Chris |