OSDN Git Service

Fixing BigDecimal.stripLeadingZeroes on "0e100", as discovered by jtreg.
authorJesse Wilson <jessewilson@google.com>
Tue, 22 Dec 2009 01:59:46 +0000 (17:59 -0800)
committerJesse Wilson <jessewilson@google.com>
Tue, 22 Dec 2009 02:01:56 +0000 (18:01 -0800)
Plus other jtreg test scrubbing.

libcore/math/src/main/java/java/math/BigDecimal.java
libcore/tools/runner/expectations.txt

index 6c00560..33042ba 100644 (file)
@@ -2148,7 +2148,7 @@ public class BigDecimal extends Number implements Comparable<BigDecimal>, Serial
         long newScale = scale;
 
         if (isZero()) {
-            return new BigDecimal("0");
+            return this;
         }
         BigInteger strippedBI = getUnscaledValue();
         BigInteger[] quotAndRem;
index 641ec88..9644ef7 100644 (file)
@@ -674,3 +674,25 @@ result UNSUPPORTED
 test sun.security.smartcardio
 result UNSUPPORTED
 
+# Our exception messages don't match the RIs
+test java.lang.StringBuilder.Exceptions
+result EXEC_FAILED
+pattern .*got java\.lang\.StringIndexOutOfBoundsException: null - FAILED.*
+
+test java.lang.StringBuffer.Exceptions
+result EXEC_FAILED
+pattern .*got java\.lang\.StringIndexOutOfBoundsException: null - FAILED.*
+
+
+# We don't expose Java 6 APIs
+test java.lang.String.IsEmpty
+result COMPILE_FAILED
+pattern .*cannot find symbol.*method isEmpty\(\).*
+
+test java.lang.String.Exceptions
+result COMPILE_FAILED
+pattern .*cannot find symbol.*new String.*
+
+test java.lang.String.Encodings
+result COMPILE_FAILED
+pattern .*cannot find symbol.*new String.*