RFR: 8251353: Many javafx scenegraph classes have implicit no-arg constructors [v2]

Nir Lisker nlisker at openjdk.java.net
Tue Aug 25 09:38:12 UTC 2020

On Tue, 18 Aug 2020 23:41:23 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/application/Preloader.java line 121:
>>> 120:     public Preloader() {
>>> 121:     }
>>> 122:
>> Not sure that "default" means anything here. I don't see any configuration.
> Right, but isn't that true of most of the classes, including those in the two related bugs that were fixed?
> Worth noting is that the JDK chose different language for abstract classes than concrete ones. For abstract classes,
> they just use the following language:
> * Constructor for subclasses to call.
> And for concrete ones:
> Constructs a {@code Foo}.
> This gets around the problem of whether or not `default` adds any useful information since it is the only constructor.
> Not saying we should adopt this now, but just adding another data point.

I didn't look closely at whether "default" was suitable in the previous cases. I like the JDK's wording, but in cases
where there are constructors that allow configuration, the empty constructor could use "default", though specifying
what the default values are is more beneficial anyway.


PR: https://git.openjdk.java.net/jfx/pull/283

More information about the openjfx-dev mailing list