JDK 16 RFR of JDK-8251921: Expand default constructor warning to cover more cases

Alex Buckley alex.buckley at oracle.com
Wed Aug 26 00:08:49 UTC 2020


CSR looks good.

I note that no change is needed to the compiler message which was 
ultimately chosen for this lint warning -- "class {0} in exported 
package {1} declares no explicit constructors, thereby exposing a 
default constructor to clients of module {2}" 
(http://hg.openjdk.java.net/jdk/jdk/rev/f74d10596242#l5.8)

Alex

On 8/25/2020 4:31 PM, Joe Darcy wrote:
> Hello,
> 
> As a follow-up to JDK-8071961: "Add javac lint warning when a default 
> constructor is created," Phil observed that there are cases in the JDK 
> where a *protected* class has a default constructor appearing in the 
> JDK. Please review the changes and CSR to augment the warning to cover 
> both public and protected classes. For nested classes, the enclosing 
> types must be either public or protected all the way up for the warning 
> to be issued.
> 
>      JDK-8251921: Expand default constructor warning to cover more cases
>      CSR: https://bugs.openjdk.java.net/browse/JDK-8252348
>      webrev: http://cr.openjdk.java.net/~darcy/8251921.0/
> 
> Patch below. Clean langtools test run with this change.
> 
> Thanks,
> 
> -Joe


More information about the compiler-dev mailing list