do not highlight enum constants as unused when values are used (IDEA-65298 )

This commit is contained in:
anna
2011-06-15 14:51:09 +04:00
parent dd59a46431
commit 765d5e4f01
8 changed files with 107 additions and 2 deletions
@@ -0,0 +1,22 @@
class UnusedDeclBug {
public static enum Concern {
// These fields are used! Just because I don't mention them by name
// doesn't mean they aren't used!
// IDEA tells me I need: @SuppressWarnings({"UnusedDeclaration"})
LOW,
MEDIUM,
HIGH;
};
public static void main(String[] args) {
System.out.println("Concerns are:");
// Invoking Concern.values() should count as using all the fields in the
// enum.
for (Concern concern : Concern.values()) {
System.out.print("\t");
System.out.println(concern);
} // end for
}
}