Not finding unused references

I have an enumerator class in which I define a number of objects as follows * public static final RuntimeMsgCode VSJTEXTFIELD1 = new RuntimeMsgCode(
_VSJTEXTFIELD1);*

The issues is that this was a migration from an old code base and a number of these references are now unused. If I do a find usages ]]> it comes back with no usages found. My question is, is there an easier way to find all unused attributes other than one at a time as I have hunderds of them to check

3 comments
Comment actions Permalink


tony lodge wrote:
> My question is, is there an

easier way to find all unused attributes other than one at a time as
I have hunderds of them to check


IDEA has an "Unused Declaration" inspection which should find these
problems.

Bas

0
Comment actions Permalink

I have tried that and it did not report any problems, I do not know if it has something to do with the fact the object is static

0
Comment actions Permalink

tony lodge wrote:

I have tried that and it did not report any problems, I do not know
if it has something to do with the fact the object is static


It works for me, even with static objects. Are your declarations part of
inner classes? I believe there could be some problems there. Also note
that "Unused Declaration" does not highlight items in the editor, you
need to "Analyze > Inspect Code".

Bas

0

Please sign in to leave a comment.