Search code examples
javaintellij-ideaintellij-14

Intellij Idea 14 cannot find the set usage type for public static variables


I've accidently discover that IntellijIdea 14 does not show the Value set/write type of usage for public static variables.

public class Test {

    public static boolean B_VALUE;

    public static void main(String [] args) throws IOException {
        System.out.println(B_VALUE);
    }

    public void test1() {
        B_VALUE = true;
    }

    public boolean test2() {
        boolean v = B_VALUE;

        B_VALUE = !v;
        return v && ("test2".equals("TEST2".toLowerCase()));
    }
}

Press Alt+F7 on B_VALUE, and get result:

Nobody ever read image description

You can see that we have at least 4 usages in test code (2 read and 2 set), but only read usages are lighted.

Is it a bug?


Solution

  • It's not a bug, I just tried this and saw 4 usages, 2 for read and 2 for write.

    Please make sure the RED icon on the left side, near the bottom, is ticked ("Show write access")