Re: Integer.parseInt("+42") gives -42

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8



[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux