summaryrefslogtreecommitdiffstats
path: root/expectations
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-04-09 10:58:08 +0100
committerNeil Fuller <nfuller@google.com>2014-04-15 17:42:16 +0100
commitc96651d01dc87a20aa718d60feaff6611451852e (patch)
treece98bb104e94dfdb9c066fced7cab12ca0760a5b /expectations
parentd1c5e1ffb8bb8a351300d96e5edb9eda2c81741f (diff)
downloadlibcore-c96651d01dc87a20aa718d60feaff6611451852e.zip
libcore-c96651d01dc87a20aa718d60feaff6611451852e.tar.gz
libcore-c96651d01dc87a20aa718d60feaff6611451852e.tar.bz2
Change DecimalFormat.setRoundingMode() behavior to stay in spec
The serialization tests revealed that some DecimalFormat instances could not be round-tripped. The reason is that the setRoundingMode() method was setting a non-zero rounding increment, which cannot be persisted, and also creates patterns that are outside of the DecimalFormat spec. Addressed the fact that ICU4C appears to support RoundingMode.UNNECESSARY now by deleting special-case code. Changed SerializationStressTest to use canonical DecimalFormat patterns: The ones chosen had a couple things that were not ideal: 1) Putting '-' in quotes causes ICU (for non-obvious reasons) treat the negative pattern prefix as not being default. Default in this case means "the positive prefix with a preceding '-'. Removing the quotes meant it would recognize the pattern as not needing everything after ;., so the pattern would be shrunk. 2) The positive pattern was also not one ICU could deal with fully. ICU changed "#.#" to "#0.#" at parse time (which can be corrected with a setMinimumIntegerDigits(0)). It's not clear why ICU cannot deal with parsing "#.#" when it can produce it, but there is a long comment in decimfmt.cc suggesting it is intentional and to avoid format producing empty strings. The pattern has been changed to one that ICU can handle and would choose when the various serialized fields are read back. This is necessary because NativeDecimalFormat compares the patterns and not just the serialized fields. Leaving the pattern check part of equals() means that two non-spec patterns will not be considered equal(), which is important while Android allows non-spec patterns. Restricting support in DecimalFormat to the documented subset of characters is not worth the effort and may cause problems elsewhere. Change-Id: I2de588458b86619733c0dc1692d526f179059910 Bug: 11668227
Diffstat (limited to 'expectations')
-rw-r--r--expectations/knownfailures.txt2
1 files changed, 0 insertions, 2 deletions
diff --git a/expectations/knownfailures.txt b/expectations/knownfailures.txt
index eabadfd..cf79a53 100644
--- a/expectations/knownfailures.txt
+++ b/expectations/knownfailures.txt
@@ -1700,8 +1700,6 @@
description: "Known failures in SerializationStressTest",
bug: 11668227,
names: [
- "org.apache.harmony.tests.java.io.SerializationStressTest3#test_18_113_writeObject",
- "org.apache.harmony.tests.java.io.SerializationStressTest3#test_18_115_writeObject",
"org.apache.harmony.tests.java.io.SerializationStressTest4#test_writeObject_Collections_UnmodifiableMap_UnmodifiableEntrySet"
]
},