diff options
| author | Robert Schuster <theBohemian@gmx.net> | 2008-09-03 23:06:52 +0000 |
|---|---|---|
| committer | Robert Schuster <theBohemian@gmx.net> | 2008-09-03 23:06:52 +0000 |
| commit | 27347dd877974878cedbe6b027235fe2783c5b07 (patch) | |
| tree | 45f705e02ee12b650d412d7e0ab126dfe4943106 /java/text | |
| parent | 38a8042079b187f53de9139939c8885e96c6212e (diff) | |
| download | classpath-27347dd877974878cedbe6b027235fe2783c5b07.tar.gz | |
Fix problem when using \u00a4 in number format patterns.
2008-09-04 Robert Schuster <robertschuster@fsfe.org>
* java/text/DecimalFormat.java:
(scanFix): Use 'i + 1' when looking at following character.
(scanNegativePattern): Dito.
Diffstat (limited to 'java/text')
| -rw-r--r-- | java/text/DecimalFormat.java | 6 |
1 files changed, 3 insertions, 3 deletions
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); |
