<Swing Dev> RFR: 8252721: Nested classes in Swing APIs rely on default constructors
Prasanta Sadhukhan
psadhukhan at openjdk.java.net
Tue Sep 8 12:10:11 UTC 2020
Please review a fix for issue where it was seen that several
nested classes rely on default constructors as part of their public API.
It's to be noted that "A no-arg public constructor is generated by the compiler for a class if it does not declare an
explicit constructor. While convenient, this is inappropriate for many kinds of formal classes, both because the
constructor will have no javadoc and because the constructor may be unintended."
For the JDK, classes intended to be used outside of the JDK, public classes in exported packages, should not rely on
default constructors.
Proposed fix is to add explicit public no-arg constructors for public classes and protected no-arg constructor for
public abstract classes for javax.swing module (as one part of overalll java.desktop change)
CSR: https://bugs.openjdk.java.net/browse/JDK-8252908
-------------
Commit messages:
- 8252721: Nested classes in Swing APIs rely on default constructors
- 8252721: Nested classes in Swing APIs rely on default constructors
- 8248532: Every time I change keyboard language at my MacBook, Java crashes
Changes: https://git.openjdk.java.net/jdk/pull/72/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=72&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8252721
Stats: 252 lines in 42 files changed: 252 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/72.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/72/head:pull/72
PR: https://git.openjdk.java.net/jdk/pull/72
More information about the swing-dev
mailing list