org.sonar.l10n.pmd.rules.pmd.AbstractClassWithoutAnyMethod.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-pmd-plugin Show documentation
Show all versions of sonar-pmd-plugin Show documentation
Sonar-PMD is a plugin that provides coding rules from PMD.
The newest version!
If an abstract class does not provide any method, it may be acting as a simple data container that is not meant to be instantiated. In this case, it is probably better to use a private or protected constructor in order to prevent instantiation than make the class misleadingly abstract.
Example:
public class abstract Example {
String field;
int otherField;
}
This rule is deprecated, use {rule:java:S1694} instead.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy