Hi,

I have added a new Mauve test:
   gnu/testlet/java/text/NumberFormat/position.java

This test tells that there is something wrong in the ParsePosition settings
of java/text/DecimalFormat.java.

Here is my patch.

ChangeLog

2007-01-18  Ito Kazumitsu  <[EMAIL PROTECTED]>

        * java/text/DecimalFormat.java(parse): Corrected the ParsePosition
        settings.

cvs diff: Diffing classpath/java/text
Index: classpath/java/text/DecimalFormat.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/text/DecimalFormat.java,v
retrieving revision 1.32
diff -u -r1.32 DecimalFormat.java
--- classpath/java/text/DecimalFormat.java      19 Dec 2006 01:14:23 -0000      
1.32
+++ classpath/java/text/DecimalFormat.java      18 Jan 2007 15:23:44 -0000
@@ -672,6 +672,7 @@
           }
         else if (this.parseIntegerOnly)
           {
+            i--;
             break;
           }
         else if (ch == decimalSeparator)
@@ -688,8 +689,16 @@
             if (inExponent)
               number.append(ch);
             else
-              break;
-          }
+             {
+               i--;
+               break;
+             }
+          }
+       else
+         {
+           i--;
+           break;
+         }
       }
 
     // 2nd special case: infinity
@@ -749,7 +758,7 @@
     
     if (isNegative) number.insert(0, '-');
    
-    pos.setIndex(i - 1);
+    pos.setIndex(i);
     
     // now we handle the return type
     BigDecimal bigDecimal = new BigDecimal(number.toString());
cvs diff: Diffing classpath/java/text/spi

Reply via email to