A RetroSearch Logo

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

Search Query:

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

[java] MissingOverride is triggered in illegal places · Issue #1063 · pmd/pmd · GitHub

Affects PMD Version:
6.3.0

Rule:
<rule ref="category/java/bestpractices.xml/MissingOverride" />

Description:
MissingOverride is triggered in places where adding @Override would be an error.

Code Sample demonstrating the issue:

I found two such cases.

An interface extending another interface to specialize the return type of a method.

interface Foo extends Cloneable {
    // triggers MissingOverride but mustn't
    Foo clone() throws CloneNotSupportedException;
}

Static methods that happen to have the same name in a class hierarchy.

public class FooBase {
    public static FooBase parse(String input) {
        // ...
    }
}

public class FooA extends FooBase {
    // triggers MissingOverride but mustn't
    public static FooA parse(String input) {
        // ...
    }
}

public class FooB extends FooBase {
    // triggers MissingOverride but mustn't
    public static FooB parse(String input) {
        // ...
    }
}

Running PMD through: Gradle


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