JDK 16 RFR of build changes for JDK-8071961: Add javac lint warning when a default constructor is created

Joe Darcy joe.darcy at oracle.com
Fri Jul 31 21:18:43 UTC 2020


Hello,

FYI, a new javac lint warning is in the works and out for review on 
compiler-dev:

     JDK-8071961: Add javac lint warning when a default constructor is 
created
https://mail.openjdk.java.net/pipermail/compiler-dev/2020-July/014782.html

The warning notes where a formal API class exposes a default 
constructor, that is, an implicit constructor generated by the compiler 
(see JLS 8.8.9 for details 
https://docs.oracle.com/javase/specs/jls/se14/html/jls-8.html#jls-8.8.9).

The JDK modules are generally compiled under "-Xlint:all -Werror". 
Therefore, if a new lint warning is added *without* first clearing those 
conditions, the build will break. Many modules have already been cleared 
(JDK-8250212); others are still in progress (JDK-8250639).

Please review the make system portions of JDK-8071961 that disable the 
warning on modules where the new warning still has some occurrences:

     http://cr.openjdk.java.net/~darcy/8071961.7/

Patch for the relevant file below. Depending on the relative timing of 
fixing the warning locations and the javac changes being ready, some of 
the module changes in the make file might be removed.

Thanks,

-Joe

--- old/make/CompileJavaModules.gmk    2020-07-31 14:04:28.285167000 -0700
+++ new/make/CompileJavaModules.gmk    2020-07-31 14:04:27.657167000 -0700
@@ -76,6 +76,7 @@

  ################################################################################

+java.desktop_DISABLED_WARNINGS += default-ctor
  java.desktop_DOCLINT += -Xdoclint:all/protected,-reference \
      '-Xdoclint/package:java.*,javax.*'
  java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
@@ -298,6 +299,10 @@

  ################################################################################

+jdk.accessibility_DISABLED_WARNINGS += default-ctor
+
+################################################################################
+
  jdk.charsets_COPY += .dat

  ################################################################################
@@ -347,10 +352,19 @@

  ################################################################################

+jdk.jartool_DISABLED_WARNINGS += default-ctor
  jdk.jartool_JAVAC_FLAGS += -XDstringConcat=inline

  ################################################################################

+jdk.httpserver_DISABLED_WARNINGS += default-ctor
+
+################################################################################
+
+jdk.unsupported.desktop_DISABLED_WARNINGS += default-ctor
+
+################################################################################
+
  # No SCTP implementation on Mac OS X or AIX. These classes should be 
excluded.
  SCTP_IMPL_CLASSES = \
$(TOPDIR)/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/AssociationChange.java \




More information about the build-dev mailing list