From 27347dd877974878cedbe6b027235fe2783c5b07 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Wed, 3 Sep 2008 23:06:52 +0000 Subject: Fix problem when using \u00a4 in number format patterns. 2008-09-04 Robert Schuster * java/text/DecimalFormat.java: (scanFix): Use 'i + 1' when looking at following character. (scanNegativePattern): Dito. --- ChangeLog | 6 ++++++ java/text/DecimalFormat.java | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4b1f27c7..bf41af8cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-04 Robert Schuster + + * java/text/DecimalFormat.java: + (scanFix): Use 'i + 1' when looking at following character. + (scanNegativePattern): Dito. + 2008-09-02 Andrew John Hughes * tools/gnu/classpath/tools/javah/ClassWrapper.java: diff --git a/java/text/DecimalFormat.java b/java/text/DecimalFormat.java index cb0f782e3..425174437 100644 --- a/java/text/DecimalFormat.java +++ b/java/text/DecimalFormat.java @@ -1321,7 +1321,7 @@ public class DecimalFormat extends NumberFormat currencySymbol = this.symbols.getCurrencySymbol(); // if \u00A4 is doubled, we use the international currency symbol - if (i < len && pattern.charAt(i + 1) == '\u00A4') + if ((i + 1) < len && pattern.charAt(i + 1) == '\u00A4') { currencySymbol = this.symbols.getInternationalCurrencySymbol(); i++; @@ -1345,7 +1345,7 @@ public class DecimalFormat extends NumberFormat else if (ch == '\'') { // QUOTE - if (i < len && pattern.charAt(i + 1) == '\'') + if ((i + 1) < len && pattern.charAt(i + 1) == '\'') { // we need to add ' to the buffer buffer.append(ch); @@ -1717,7 +1717,7 @@ public class DecimalFormat extends NumberFormat else if (ch == '\'') { // QUOTE - if (i < len && pattern.charAt(i + 1) == '\'') + if ((i + 1) < len && pattern.charAt(i + 1) == '\'') { // we need to add ' to the buffer buffer.append(ch); -- cgit v1.2.1