I updated the Mauve tests and had to check in this small change.

2005-11-22  Anthony Balkissoon  <[EMAIL PROTECTED]>

        * javax/swing/text/MaskFormatter.java:
        (convertValue): Don't check the valid/invalid character sets if we're 
        matching a literal.

--Tony
Index: javax/swing/text/MaskFormatter.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/MaskFormatter.java,v
retrieving revision 1.2
diff -u -r1.2 MaskFormatter.java
--- javax/swing/text/MaskFormatter.java	22 Nov 2005 19:42:04 -0000	1.2
+++ javax/swing/text/MaskFormatter.java	22 Nov 2005 20:07:17 -0000
@@ -399,6 +399,7 @@
     StringBuffer result = new StringBuffer(value);
     char markChar;
     char resultChar;
+    boolean literal;
 
     // this boolean is specifically to avoid calling the isCharValid method
     // when neither invalidChars or validChars has been set
@@ -406,11 +407,8 @@
 
     for (int i = 0, j = 0; i < value.length(); i++, j++)
       {
+        literal = false;
         resultChar = result.charAt(i);
-        // If necessary, check if the character is valid.
-        if (checkCharSets && !isCharValid(resultChar))
-          throw new ParseException("invalid character: "+resultChar, i);
-
         // This switch block on the mask character checks that the character 
         // within <code>value</code> at that point is valid according to the
         // mask and also converts to upper/lowercase as needed.
@@ -450,15 +448,21 @@
             // Escape character, check the next character to make sure that 
             // the literals match
             j++;
+            literal = true;
             if (resultChar != mask.charAt(j))
               throw new ParseException ("Invalid character: "+resultChar, i);
             break;
           default:
+            literal = true;
             if (!getValueContainsLiteralCharacters() && convert)
               throw new ParseException ("Invalid character: "+resultChar, i);
             else if (resultChar != mask.charAt(j))
               throw new ParseException ("Invalid character: "+resultChar, i);
           }
+        // If necessary, check if the character is valid.
+        if (!literal && checkCharSets && !isCharValid(resultChar))
+          throw new ParseException("invalid character: "+resultChar, i);
+
       }
     return result.toString();
   }
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to