Get all classes referenced by a class
<p>Let's say I have a java.lang.Class instance, c at runtime.</p>

<p>At runtime, is there anyway to see what classes are used by c? e.g. if c.foo instantiates a B, B is being 'used'.  if c.foo calls static method G.bar(), G is being used. </p>

<p>Note: Only trying to get what classes could be known statically - I'm fine missing ones loaded by reflection.</p>

<p>In python, equivalent functionality is found in modulefinder:
<a href="http://docs.python.org/library/modulefinder.html" rel="nofollow">http://docs.python.org/library/modulefinder.html</a></p>
