This issue tracks partial implementation of this functionality. See note at end of description.
Given this Java class (note the static inner class):
The inner class can be printed from Java using this:
Note that both the non-static or static version (shown commented out) will work.
For Groovy, the non-static version works:
but the static version doesn't:
instead, it fails with:
NOTE: The initial implementation of functionality for this issue works for external jars/classes on the classpath and for classes included in the same file but doesn't work for the critical case of external groovy files. As that case also doesn't work for attempts to import using a non-static variation of import, I think it is worthy of its own issue and so
GROOVY-4287 has been created to track remaining work.