Enable warning about unused Enum fields in Intellij

If IDEA has the following code:

final public static String unused="";

It will show “unused” in gray with underlined underlines and a tooltip that says: “The field“ unused ”is never used.”

However, this code:

enum MyEnum{
  UNUSED
}

doesn't show the scraper. I can run analyze | Inspect Code to receive the "Unused declaration" message in the "verification results".

Is there a way to force IDEA to automatically find unused enum fields when opening code in an editor?

+4
source share
1 answer

, Settings | unused declaration Java . , .

0

Source: https://habr.com/ru/post/1679274/


All Articles