Add test case

This commit is contained in:
Clément Fournier committed 2022-01-16 15:51:51 +01:00
1 parent 7432048d75
commit 4790a38e20
1 file changed
+17
@@ -592,6 +592,23 @@ public class Test {
]]></code>
</test-code>
<test-code>
<description>Unused import with member inherited AND imported</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
package net.sourceforge.pmd.lang.java.rule.codestyle.unnecessaryimport;
import static net.sourceforge.pmd.lang.java.rule.codestyle.unnecessaryimport.HelloMore.sayHello;
public class Test extends HelloMore {
public static void main(String... args) {
// import is unused as the method is inherited here
sayHello();
}
}
]]></code>
</test-code>
<test-code>
<description>NPE with static import on interface</description>
<expected-problems>1</expected-problems>