A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/247 below:

[java] UnusedModifier doesn't check annotations inner classes · Issue #247 · pmd/pmd · GitHub

Rule Set: unused/UnusedModifier

Description:
Nested classes in annotations are public static by default, no other modifiers are allowed. Explicitly setting them matches this rule's criteria:

For historical reasons, modifiers which are implied by the context are accepted by the compiler, but are superfluous.

The same applies to inner interfaces and annotations on annotations, which are public by default.

Code Sample demonstrating the issue:

public @interface Test {
  public static Inner { }
  public interface Interface { }
  public @interface InnerAnnotation { }
}

PMD will find no violations on this annotation, 4 violations are expected.

Running PMD through: Any

Relate to #246


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4