Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6548409

Method stringToValue of MaskFormatter subclass is not called when editing

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.6.0_01"
      Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
      Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      I use a a custom subclass of MaskFormatter, providing my own stringToValue method.

      When typing and then replacing a character in a JFormattedField using this custom MaskFormatter, the stringToValue method of the class DefaultFormatter is called instead of my subclass method during validation process.

      It appears that the method :

      private Object stringToValue(String value, boolean completeMatch) // line 430

      .. in the MaskFormatter class incorrectly calls :

      return super.stringToValue(value); // line 438

      .. instead of simply :

      return stringToValue(value);


      REPRODUCIBILITY :
      This bug can be reproduced always.

            peterz Peter Zhelezniakov
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: