mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
unused declaration: report enum consts as used if enum class object is used (IDEA-206125)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>16</line>
|
||||
<entry_point TYPE="method" FQNAME="Test.YYY void mode()" />
|
||||
<problem_class severity="WARNING">unused declaration</problem_class>
|
||||
<description>Method is never used.</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>15</line>
|
||||
<entry_point TYPE="method" FQNAME="Test.YYY void depeche()" />
|
||||
<problem_class severity="WARNING">unused declaration</problem_class>
|
||||
<description>Method is never used.</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,18 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Arrays.toString(XXX.class.getEnumConstants()));
|
||||
System.out.println(Arrays.toString(YYY.class.getDeclaredMethods()));
|
||||
}
|
||||
|
||||
enum XXX {
|
||||
Foo, Bar
|
||||
}
|
||||
|
||||
// Don't think it's should be marked as used
|
||||
class YYY {
|
||||
void depeche() {}
|
||||
void mode() {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user