unused declaration: add test for static import (IDEA-143882)

This commit is contained in:
Dmitry Batkovich
2018-07-20 17:52:45 +03:00
parent 80f3bfc52c
commit c0100c98d7
4 changed files with 26 additions and 0 deletions
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>Holder.java</file>
<line>4</line>
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">unused declaration</problem_class>
<description>Method is never used.</description>
</problem>
</problems>
@@ -0,0 +1,7 @@
import static holder.Holder.*;
public class Usage {
public static void main(String[] args) {
System.out.println(CONST);
}
}
@@ -0,0 +1,5 @@
package holder;
public class Holder {
public static final String CONST = "JB";
public String method() { return "JB"; }
}
@@ -206,4 +206,8 @@ public class UnusedDeclarationTest extends AbstractUnusedDeclarationTest {
public void testReferenceFromGroovy() {
doTest();
}
public void testStaticImport() {
doTest();
}
}