The Java documentation only allows a
'-' sign, not a '+' sign in Integer.parseInt and Integer.decode.
David R Cok
"Andrew John Hughes"
<gnu_andrew@xxxxxxxxxxxxxx> Sent by: classpath-bounces@xxxxxxx
05/12/2008 04:46 PM
To
"Nicolas Geoffray" <nicolas.geoffray@xxxxxxxxxxx>
cc
classpath@xxxxxxx
Subject
Re: Integer.parseInt("+42")
gives -42
On 12/05/2008, Nicolas Geoffray <nicolas.geoffray@xxxxxxxxxxx>
wrote:
> With the following testcase (Test.java attached), the output of jamvm
is:
> -42
>
> It should have thrown an exception.
>
> I attached a patch to correct Integer.java. I could commit it,
but I can't
> find my username/password. Can someone commit it?
>
> (I already wrote to classpath-patches, but I may have a bigger
audience
> here)
>
> Thanks,
> Nicolas
>
>
Do you have a copyright assignment? If so, I'll test and commit on your
behalf.
--
Andrew :-)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net