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

JFormattedTextField.AbstractFormatter.getDocumentFilter()/getNavigationFilter() spec doesn't mention what the default impls return and what does it mean

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 17
    • client-libs
    • None
    • behavioral
    • minimal
    • No behavior change - specification only so minimal risk
    • Java API
    • SE

      Summary

      The current state of specification for /javax/swing/JFormattedTextField.AbstractFormatter.html#getDocumentFilter() /javax/swing/JFormattedTextField.AbstractFormatter.html#getNavigationFilter() doesn't mention "null" is returned by both "default" implementations

      Problem

      The current state of specification for /javax/swing/JFormattedTextField.AbstractFormatter.html#getDocumentFilter() /javax/swing/JFormattedTextField.AbstractFormatter.html#getNavigationFilter() doesn't mention "null" is returned by both "default" implementations

      Solution

      Default implementation returns "null" needs to be stated explicitly by @implSpec tag.

      Specification

              * Subclass and override if you wish to provide a
                * <code>DocumentFilter</code> to restrict what can be input.
                * <code>install</code> will install the returned value onto
                * the <code>JFormattedTextField</code>.
                *
      +         * @implSpec The default implementation returns <code>null</code>.
      +         *
                * @return DocumentFilter to restrict edits
                */
               protected DocumentFilter getDocumentFilter() {
                   return null;
      
                * Subclass and override if you wish to provide a filter to restrict
                * where the user can navigate to.
                * <code>install</code> will install the returned value onto
                * the <code>JFormattedTextField</code>.
                *
      +         * @implSpec The default implementation returns <code>null</code>.
      +         *
                * @return NavigationFilter to restrict navigation
                */
               protected NavigationFilter getNavigationFilter() {
                   return null;
               }

            psadhukhan Prasanta Sadhukhan
            dbessono Dmitry Bessonov
            Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: