We have huge codebase and some classes are often used via reflection all over the code. We can safely remove classes and compiler is happy, but some of them are used dynamically using reflection so I can’t locate them otherwise than searching strings …
Is there some reflection explorer for Java code?
I suggest, using appropriately licensed source for your JRE, modifying the reflection classes to log when classes are used by reflection (use a map/
WeakHashMapto ignore duplicates). Your modified system classes can replace those inrt.jarwith-Xbootclasspath/p:on the command line (on Oracle “Sun” JRE, others will presumably have something similar). Run your program and tests and see what comes up.(Possibly you might have to hack around issues with class loading order in the system classes.)