bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/67188] New: [PATCH] BigInteger constructor should raise N


From: wispym.gcc at mailnull dot com
Subject: [Bug classpath/67188] New: [PATCH] BigInteger constructor should raise NumberFormatException on empty string
Date: Wed, 12 Aug 2015 11:36:18 +0000

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67188

            Bug ID: 67188
           Summary: [PATCH] BigInteger constructor should raise
                    NumberFormatException on empty string
           Product: classpath
           Version: 0.99
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wispym.gcc at mailnull dot com
  Target Milestone: ---

To get Armed Bear Common Lisp running with GNU classpath, I needed to patch
BigInteger.java as follows to make it adhere to the official javadoc and raise
a NumberFormatException when given an empty string.

diff -Naur classpath-0.99/java/math/BigInteger.java
classpath-0.99.abcl/java/math/BigInteger.java
--- classpath-0.99/java/math/BigInteger.java  2010-09-02 17:47:07.000000000
+0100
+++ classpath-0.99.abcl/java/math/BigInteger.java 2015-08-11 02:01:18.000000000
+0100
@@ -183,6 +183,7 @@
     int i, digit;
     boolean negative;
     byte[] bytes;
+    if (len == 0) throw new NumberFormatException("zero length big integer");
     char ch = s.charAt(0);
     if (ch == '-')
       {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]