Refactor StringConverter and its subclasses

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Component/s: javafx
    • None
    • source, binary
    • minimal
    • It is unlikely that users relied on the implementation details exposed by these classes. It is also unlikely that these classes were subclassed and used the removed methods.
    • Java API
    • JDK

      Summary

      Internal accessor methods of some StringConverter implementations were exposed erroneously. The relevant class hierarchies are:

      • DateTimeStringConverter
        • DateStringConverter
        • TimeStringConverter
      • NumberStringConverter
        • CurrencyStringConverter
        • PercentageStringConverter

      The method of DateTimeStringConverter was deprecated in JDK-8261092 and removed in JDK-8270855. The methods of the remaining classes were deprecated in JDK-8320615 and are being removed here.

      Problem

      Internal implementation details are exposed to the user, which can cause fragile reliance as internal code can change.

      Solution

      Remove the deprecated methods.

      Specification

      Removed in javafx.util.converter.TimeStringConverter and javafx.util.converter.DateStringConverter:

      /**
       * @deprecated This method was exposed erroneously and will be removed in a future version.
       */
      @Deprecated(forRemoval = true, since = "22")
      @Override
      protected DateFormat getDateFormat()
      

      Removed in javafx.util.converter.NumberStringConverter:

      /**
       * Returns a {@code NumberFormat} instance to use for formatting
       * and parsing in this {@code StringConverter}.
       *
       * @return a {@code NumberFormat} instance for formatting and parsing in this
       * {@code StringConverter}
       * @deprecated This method was exposed erroneously and will be removed in a future version.
       */
      @Deprecated(forRemoval = true, since = "22")
      protected NumberFormat getNumberFormat()
      

      Removed in javafx.util.converter.CurrencyStringConverter and javafx.util.converter.PercentageStringConverter:

      /**
       * @deprecated This method was exposed erroneously and will be removed in a future version.
       */
      @Deprecated(forRemoval = true, since = "22")
      @SuppressWarnings("removal")
      @Override
      public NumberFormat getNumberFormat()
      

            Assignee:
            Nir Lisker
            Reporter:
            Nir Lisker
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: