Why is the Bigdecimal(double d) construction still around?
api, bigdecimal, java
Solution
Deprecation is deprecated. Parts of APIs are only marked deprecated in exceptional cases.
So, run FindBugs as part of your build process. FindBugs has a detector PlugIn API and is also open source (LGPL, IIRC).
Problem
I've noticed substantial pain over this constructor (even here on Stack Overflow). People use it even though the documentation clearly states: The results of this constructor can be somewhat unpredictable http://java.sun.com/javase/6/docs/api/java/math/BigDecimal.html#BigDecimal(double) I've even seen a JSR-13 being APPROVED with a recommendation stating: Existing specifications that might be deprecated: We propose deprecating the BigDecimal(double) constructor, which currently gives results that are different to the Double.toString() method. Despite all this, the constructor has not yet been deprecated. I'd love to hear any views on this.