Original issue created by matt.nathan on 2013-12-18 at 04:55 PM
I've just started to make use of ClassPath to find and load classes in a package. Unfortunately this means that my IDE reports the classes I load via reflection as unused symbols.
What I thought would be a good idea would be a hint annotation @UsedViaReflection (similar to @VisibleForTesting) that could be added to the classes (and fields, methods, constructors) that get called as part of reflection which I can then configure my IDE to ignore uses annotated with that class.
I've added this to my project and it's working out well though it would be nice if it were part of Guava.
The alternative is to add a @SuppressWarning("Unused") which has the downside of suppressing all inspections below that scope, not just on that scope explicitly, resulting in real unused symbols going unnoticed.
Original issue created by matt.nathan on 2013-12-18 at 04:55 PM
I've just started to make use of ClassPath to find and load classes in a package. Unfortunately this means that my IDE reports the classes I load via reflection as unused symbols.
What I thought would be a good idea would be a hint annotation @UsedViaReflection (similar to @VisibleForTesting) that could be added to the classes (and fields, methods, constructors) that get called as part of reflection which I can then configure my IDE to ignore uses annotated with that class.
I've added this to my project and it's working out well though it would be nice if it were part of Guava.
The alternative is to add a @SuppressWarning("Unused") which has the downside of suppressing all inspections below that scope, not just on that scope explicitly, resulting in real unused symbols going unnoticed.