Summary
-------
`TimeStringConverter` and `DateStringConverter` expose `getDateFormat()` by mistake after it was removed already in `DateTimeStringConverter`.
`NumberStringConverter` (and subclasses) expose `getNumberFormat()` by mistake as well.
Problem
-------
The above protected methods allow access to internal states. These should not be part of the public API.
Solution
--------
Deprecate for removal the protected access methods so that they can be removed from public API.
Specification
-------------
diff --git a/modules/javafx.base/src/main/java/javafx/util/converter/CurrencyStringConverter.java b/modules/javafx.base/src/main/java/javafx/util/converter/CurrencyStringConverter.java
index c8340a6fb16..65cd2bbd532 100644
--- a/modules/javafx.base/src/main/java/javafx/util/converter/CurrencyStringConverter.java
+++ b/modules/javafx.base/src/main/java/javafx/util/converter/CurrencyStringConverter.java
@@ -89,8 +89,12 @@ public CurrencyStringConverter(NumberFormat numberFormat) {
super(null, null, numberFormat);
}
- /** {@inheritDoc} */
- @Override protected NumberFormat getNumberFormat() {
+ /**
+ * @deprecated This method was exposed erroneously and will be removed in a future version.
+ */
+ @Deprecated(forRemoval = true, since = "22")
+ @Override
+ protected NumberFormat getNumberFormat() {
Locale _locale = locale == null ? Locale.getDefault() : locale;
if (numberFormat != null) {
diff --git a/modules/javafx.base/src/main/java/javafx/util/converter/DateStringConverter.java b/modules/javafx.base/src/main/java/javafx/util/converter/DateStringConverter.java
index 2b70b3427b3..232b72cbc9e 100644
--- a/modules/javafx.base/src/main/java/javafx/util/converter/DateStringConverter.java
+++ b/modules/javafx.base/src/main/java/javafx/util/converter/DateStringConverter.java
@@ -126,8 +126,12 @@ private DateStringConverter(Locale locale, String pattern, DateFormat dateFormat
// --------------------------------------------------------- Private Methods
- /** {@inheritDoc} */
- @Override protected DateFormat getDateFormat() {
+ /**
+ * @deprecated This method was exposed erroneously and will be removed in a future version.
+ */
+ @Deprecated(forRemoval = true, since = "22")
+ @Override
+ protected DateFormat getDateFormat() {
DateFormat df = null;
if (dateFormat != null) {
diff --git a/modules/javafx.base/src/main/java/javafx/util/converter/DateTimeStringConverter.java b/modules/javafx.base/src/main/java/javafx/util/converter/DateTimeStringConverter.java
index 3983b9b71c4..0ab26ea41a1 100644
--- a/modules/javafx.base/src/main/java/javafx/util/converter/DateTimeStringConverter.java
+++ b/modules/javafx.base/src/main/java/javafx/util/converter/DateTimeStringConverter.java
@@ -191,7 +191,7 @@ public DateTimeStringConverter(DateFormat dateFormat) {
// --------------------------------------------------------- Private Methods
/**
- * <p>Return a <code>DateFormat</code> instance to use for formatting
+ * <p>Returns a <code>DateFormat</code> instance to use for formatting
* and parsing in this {@link StringConverter}.</p>
*
* @return a {@code DateFormat} instance for formatting and parsing in this
diff --git a/modules/javafx.base/src/main/java/javafx/util/converter/NumberStringConverter.java b/modules/javafx.base/src/main/java/javafx/util/converter/NumberStringConverter.java
index b9a4bfacef4..f9eefc0cddb 100644
--- a/modules/javafx.base/src/main/java/javafx/util/converter/NumberStringConverter.java
+++ b/modules/javafx.base/src/main/java/javafx/util/converter/NumberStringConverter.java
@@ -141,7 +141,9 @@ public NumberStringConverter(NumberFormat numberFormat) {
*
* @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() {
Locale _locale = locale == null ? Locale.getDefault() : locale;
diff --git a/modules/javafx.base/src/main/java/javafx/util/converter/PercentageStringConverter.java b/modules/javafx.base/src/main/java/javafx/util/converter/PercentageStringConverter.java
index f393ac55353..1e7f706c08f 100644
--- a/modules/javafx.base/src/main/java/javafx/util/converter/PercentageStringConverter.java
+++ b/modules/javafx.base/src/main/java/javafx/util/converter/PercentageStringConverter.java
@@ -65,8 +65,12 @@ public PercentageStringConverter(NumberFormat numberFormat) {
super(null, null, numberFormat);
}
- /** {@inheritDoc} */
- @Override public NumberFormat getNumberFormat() {
+ /**
+ * @deprecated This method was exposed erroneously and will be removed in a future version.
+ */
+ @Deprecated(forRemoval = true, since = "22")
+ @Override
+ public NumberFormat getNumberFormat() {
Locale _locale = locale == null ? Locale.getDefault() : locale;
if (numberFormat != null) {
diff --git a/modules/javafx.base/src/main/java/javafx/util/converter/TimeStringConverter.java b/modules/javafx.base/src/main/java/javafx/util/converter/TimeStringConverter.java
index 3d5d923d7d0..ff19e3a8018 100644
--- a/modules/javafx.base/src/main/java/javafx/util/converter/TimeStringConverter.java
+++ b/modules/javafx.base/src/main/java/javafx/util/converter/TimeStringConverter.java
@@ -127,8 +127,12 @@ private TimeStringConverter(Locale locale, String pattern, DateFormat dateFormat
// --------------------------------------------------------- Private Methods
- /** {@inheritDoc} */
- @Override protected DateFormat getDateFormat() {
+ /**
+ * @deprecated This method was exposed erroneously and will be removed in a future version.
+ */
+ @Deprecated(forRemoval = true, since = "22")
+ @Override
+ protected DateFormat getDateFormat() {
DateFormat df = null;
if (dateFormat != null) {