Exposed implementation details in DateTimeStringConverter

Nir Lisker nlisker at gmail.com
Tue Jan 26 20:08:24 UTC 2021


Hi,

DateTimeStringConverter exposes final protected fields that are used for
internal implementation. These fields should have been private or
package-private. The reasons are:
1. A comment above them refers to them as private fields.
2. They have no documentation attached.
3. They are useless to the user (except for the DateFormat one) as some of
their values are unused, depending on the construction method, and they are
discarded after it.
4. There is a DateFormat getter method specifically for this field only,
which is the only field that is relevant during the life of the class. It
makes no sense to expose the field in addition.

I suggest deprecating these fields for removal from the public API. There
are minimal risks that these fields are being read by the user through
direct access.

- Nir


More information about the openjfx-dev mailing list