<Swing Dev> RFR: 8252722: More Swing plaf APIs that rely on default constructors [v2]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Tue Sep 22 14:01:04 UTC 2020


> Please review a fix for issue where it was seen that several classes in plaf package 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
> protected classes for javax.swing module

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  Modified construct javadic pattern

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/251/files
  - new: https://git.openjdk.java.net/jdk/pull/251/files/2b6273bf..38ff7128

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=251&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=251&range=00-01

  Stats: 47 lines in 15 files changed: 11 ins; 0 del; 36 mod
  Patch: https://git.openjdk.java.net/jdk/pull/251.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/251/head:pull/251

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


More information about the swing-dev mailing list