<Swing Dev> RFR: 8252721: Nested classes in Swing APIs rely on default constructors [v2]

Sergey Bylokhov serb at openjdk.java.net
Wed Sep 9 23:25:52 UTC 2020


On Wed, 9 Sep 2020 05:37:22 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/Box.java line 436:
>> 
>>> 434:          * Constructs a {@code AccessibleBox}.
>>> 435:          */
>>> 436:         public AccessibleBox() {}
>> 
>> Shouldn't this be a protected constructor?
>> "if the class is declared protected, then the default constructor is implicitly given the access modifier protected".
>
> Modified to "protected" constructor

These classes are not abstract so not sure about the spec for the constructor: "Constructor for subclasses to call."
Some of them like "AccessibleBox" is instantiated directly.

-------------

PR: https://git.openjdk.java.net/jdk/pull/72


More information about the swing-dev mailing list