Reports usages of classes in a field or method signature when a class in a signature is less visible than the member itself.
While legal Java, such members are useless outside of the visibility scope.
Example:
public
method which returns a private
inner class
.
protected
field whose type is a package-local class
.
In Java 9, a module may hide some of its classes by excluding their packages from export.
So, if the signature of exported API contains a non-exported class, such an API is useless outside of the module.
Configure the inspection:
- Use the Module's API exposes not exported classes (Java 9+) option to report about the module API
that exposes unexported classes.
Note that the option works if the language level of the project or module is 9 or higher.
- Use the Public API exposes non-accessible classes option to report about a public API
that exposes non-accessible classes.
- Use the Package-local API exposes private classes option to report about package-local API
that exposes
private
classes.