On Tue, Dec 15, 2009 at 4:24 AM, BobV <[email protected]> wrote:

> What is the motivation for this change?
>

short foo = 32767;
foo++;

will behave differently in dev mode and prod mode.  In prod mode, foo will
now have the "impossible" value of 32768, while in dev mode it will be -1.
 GWT does not properly handle overflow due to the performance cost involved,
so this provides a way to detect when an overflow has occurred, so the
programmer can insert their own fixes for this in the few cases where it is
actually useful.

This is intended as a tool for finding such places, such as during a test or
run of a program, and is not intended for use in production code.

For example, I believe the reason two tests are failing in the BigDecimal
JRE emulation I am working on is due to uncaught arithmetic overflow, and at
Dan's suggestion decided it would be quicker to write this to find it rather
than going through tricky code to figure out where it is happening.

-- 
John A. Tamplin
Software Engineer (GWT), Google

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to