Wednesday, April 20, 2011

Searching For Non Final Static Variables in Eclipse

I am programming in Java in Eclipse. I was wondering if there is a way to search for all non final static variables in my code base.

For example:

private static int MY_VAR = 0;

But not:

public static final int MY_CONSTANT = 1;
From stackoverflow
  • As mentioned in this question, a regex could do the job.

    I would however prefer findbugs for a more complete detection
    (or at least use the regex in a checkstyle configuration)

    Those static analysis tools can generate much more useful informations than just list non-final static variables, as they detect when and describe why a given practice is inappropriate.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.