On Jan 13, 2010, at 7:36 PM, Ken Anderson wrote:

One minor point... weight, which is a BigDecimal, is immutable. The 'setScale' method actually returns a new BigDecimal, so this code will not do what is intended.

This has to be one of my biggest pet peeves... it is probably the worst named method in all of Java land.

And that means it has some stiff competition! But that is a truly evil name for what that method actually is.



Ken

On Jan 13, 2010, at 6:53 PM, Chuck Hill wrote:

             if(weight.scale() < 0)
                     weight.setScale(0);
             return weight;


--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to