Summary
Expand the lint warning added under JDK-8071961 to cover protected
classes as well as public
ones.
Problem
Besides public
classes having default constructors exposed accidentally, a protected
class can have its default constructors exposed too as part of the full API of a package.
Solution
Expand the lint warning to cover protected
classes with the other conditions staying the same. In detail, a warning is issued for public
or protected
classes in a named package that has an unqualified export from its module where, for nested classes, all the syntactically enclosing classes must are either public
or protected
.
Specification
javac.opt.Xlint.desc.missing-explicit-ctor=\
- Warn about missing explicit constructors in public classes in exported packages.
+ Warn about missing explicit constructors in public and protected classes in exported packages.
- csr of
-
JDK-8251921 Expand default constructor warning to cover more cases
- Resolved
- relates to
-
JDK-8250795 Add javac lint warning when a default constructor is created
- Closed