JDK-8233704 : Deprecate for removal JavaBeanXxxPropertyBuilders constructors
  • Type: CSR
  • Component: javafx
  • Sub-Component: base
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: openjfx14
  • Submitted: 2019-11-06
  • Updated: 2019-11-20
  • Resolved: 2019-11-20
Related Reports
CSR :  
Description
Summary
-------

The public constructors of the classes `javafx.beans.property.adapter.JavaBeanXxxPropertyBuilder` and `javafx.beans.property.adapter.ReadOnlyJavaBeanXxxPropertyBuilder` (Xxx = Boolean, Float, Double, String, Object, Long, Int) was exposed by mistake and should be deprecated for removal.

Problem
-------

The `JavaBeanXxxPropertyBuilder` and `ReadOnlyJavaBeanXxxPropertyBuilder` classes had a default public constructor up to JavaFX 12 by mistake. They have a static `create()` method that is used for instantiation.

Solution
--------

In JavaFX 13 the constructors for `JavaBeanXxxPropertyBuilder` were made explicit with a doc comment that they will be removed in the future. In 14 they are to be deprecated for removal along with the constructors for `ReadOnlyJavaBeanXxxPropertyBuilder`. In 15 they are to be removed.

Specification
-------------

The `@Deprecated(since="14", forRemoval=true)` annotation was added to all `JavaBeanXxxPropertyBuilder`s and `ReadOnlyJavaBeanXxxPropertyBuilder`s as shown here for the Double variant:

    /**
     * @deprecated This constructor was exposed erroneously and will be removed in the next version. Use {@link #create()} instead.
     */
    @Deprecated(since="14", forRemoval=true)
    public JavaBeanDoublePropertyBuilder() {}

```
JavaBeanBooleanPropertyBuilder()
JavaBeanDoublePropertyBuilder()
JavaBeanIntegerProperty()
JavaBeanLongPropertyBuilder()
JavaBeanFloatPropertyBuilder()
JavaBeanStringPropertyBuilder()
JavaBeanObjectPropertyBuilder()

ReadOnlyJavaBeanBooleanPropertyBuilder()
ReadOnlyJavaBeanDoublePropertyBuilder()
ReadOnlyJavaBeanIntegerProperty()
ReadOnlyJavaBeanLongPropertyBuilder()
ReadOnlyJavaBeanFloatPropertyBuilder()
ReadOnlyJavaBeanStringPropertyBuilder()
ReadOnlyJavaBeanObjectPropertyBuilder()
```


Comments
Re-approving amended version.
20-11-2019

The updated version looks good.
20-11-2019

[~kcr] I Updated the draft.
19-11-2019

Removing myself as Reviewer, since the code review uncovered a need for additional changes (additional classes to which this same fix applies). Once it is updated, I will re-review it and then it can be moved back to Finalized.
19-11-2019

Moving to Approved.
14-11-2019

Looks good. Go ahead and move to Finalize when ready.
13-11-2019

Moving to Provisional; please have [~kcr] review the request before it is Finalized for the second phase of CSR review.
06-11-2019

Two things, and then go ahead and move it to Proposed: 1. (minor) per the code review discussion, you can remove the spaces surrounding the `=` in the `@Deprecated` line. 2. Please list all constructors that will be deprecated for removal (I see no need to repeat the `@Deprecated` comment, since it is the same for all constructors in question).
06-11-2019