summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schuster <theBohemian@gmx.net>2008-09-03 23:06:52 +0000
committerRobert Schuster <theBohemian@gmx.net>2008-09-03 23:06:52 +0000
commit27347dd877974878cedbe6b027235fe2783c5b07 (patch)
tree45f705e02ee12b650d412d7e0ab126dfe4943106
parent38a8042079b187f53de9139939c8885e96c6212e (diff)
downloadclasspath-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.
-rw-r--r--ChangeLog6
-rw-r--r--java/text/DecimalFormat.java6
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 <robertschuster@fsfe.org>
+
+ * java/text/DecimalFormat.java:
+ (scanFix): Use 'i + 1' when looking at following character.
+ (scanNegativePattern): Dito.
+
2008-09-02 Andrew John Hughes <gnu_andrew@member.fsf.org>
* 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);