Is There An Inspection For Duplicate Public Constants?

Answered

Whilst going through some legacy code I found some constants in different classes with the same content.

e.g.

Class1:

public static final String LOCATION  = "Area-Location";

Class2:

public static final String LOCATION_ATTR  = "Area-Location";

Is there an inspection that I can run to search for more of these?

The "Duplicate String Literal" is more for finding potential strings that could be refactored rather than looking for duplicate constants.

0

Please sign in to leave a comment.