PB.CTOR
Avoid package-private classes with "public" constructors
Description
This rule flags any "package-private" class with a "public" constructor.
A "public" constructor of a non-"public" class does not have "public" accessibility.Thus, the "public" modifier should be removed because it has no effect and it is confusing.
Example
package PB;
class CTOR { // package accessible class
public CTOR () { // public constructor.
}
}
Repair
Change the constructor's modifier to either "package" or "private".
|