From e3e9bbaffb0ed4f64e1dcdbf7af402029688ad2e Mon Sep 17 00:00:00 2001 From: Shane Carr Date: Tue, 2 May 2017 00:10:45 +0000 Subject: [PATCH] ICU-13177 Minor parse-debugging changes. X-SVN-Rev: 40095 --- .../src/com/ibm/icu/impl/number/Parse.java | 25 ++++++++++++++++++- .../src/com/ibm/icu/text/DecimalFormat.java | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java index 7ca7d9fe60..a7fc7131ed 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java @@ -777,6 +777,29 @@ public class Parse { assert i >= 0 && i < length; return items[i]; } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(""); + return sb.toString(); + } } /** @@ -1122,7 +1145,7 @@ public class Parse { if (DEBUGGING) { System.out.println("Parsing: " + input); System.out.println(properties); - System.out.println(state.affixHolders); + System.out.println(state); } // Start walking through the string, one codepoint at a time. Backtracking is not allowed. This diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java index 17e0b9779c..fee4bcc622 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java @@ -815,6 +815,7 @@ public class DecimalFormat extends NumberFormat { @Override public CurrencyAmount parseCurrency(CharSequence text, ParsePosition parsePosition) { try { + // TODO(sffc): Make this thread-safe CurrencyAmount result = Parse.parseCurrency(text, parsePosition, properties, symbols); if (result == null) return null; Number number = result.getNumber();