Fix Long.parseLong to correctly handle MIN_VALUE

Previously Long.parseLong raised an exception for MIN_VALUE because we
accumulated positive values and -MIN_VALUE == MAX_VALUE + 1.  So when
parsing MIN_VALUE, the accumulated value overflows MAX_VALUE.

The fix is to accumulate negative values and negate the sign at the
end.

Fixes issue 7308

Review-Link: http://gwt-code-reviews.appspot.com/1825803/

Review by: goktug@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@11481 8db76d5a-ed1c-0410-87a9-c151d255dfc7
2 files changed