forked from phoedos/pmd
Update docs to reflect on changes
This commit is contained in:
Juan Martín Sotuyo Dodero
committed by
Andreas Dangel
parent
b4d05e5f14
commit
756e9a713a
@ -103,13 +103,21 @@ public class Foo {
|
||||
class="net.sourceforge.pmd.lang.java.rule.unusedcode.UnusedModifierRule"
|
||||
externalInfoUrl="${pmd.website.baseurl}/rules/java/unusedcode.html#UnusedModifier">
|
||||
<description>
|
||||
Fields in interfaces are automatically public static final, and methods are public abstract.
|
||||
Classes or interfaces nested in an interface are automatically public and static (all nested interfaces are automatically static).
|
||||
Fields in interfaces and annotations are automatically `public static final`, and methods are `public abstract`.
|
||||
Classes, interfaces or annotations nested in an interface or annotation are automatically `public static`
|
||||
(all nested interfaces and annotations are automatically static).
|
||||
Nested enums are automatically `static`.
|
||||
For historical reasons, modifiers which are implied by the context are accepted by the compiler, but are superfluous.
|
||||
</description>
|
||||
<priority>3</priority>
|
||||
<example>
|
||||
<![CDATA[
|
||||
public @interface Annotation {
|
||||
public abstract void bar(); // both abstract and public are ignored by the compiler
|
||||
public static final int X = 0; // public, static, and final all ignored
|
||||
public static class Bar {} // public, static ignored
|
||||
public static interface Baz {} // ditto
|
||||
}
|
||||
public interface Foo {
|
||||
public abstract void bar(); // both abstract and public are ignored by the compiler
|
||||
public static final int X = 0; // public, static, and final all ignored
|
||||
@ -118,6 +126,9 @@ public interface Foo {
|
||||
}
|
||||
public class Bar {
|
||||
public static interface Baz {} // static ignored
|
||||
public static enum FoorBar { // static ignored
|
||||
FOO;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
|
Reference in New Issue
Block a user