Skip to content

Instantly share code, notes, and snippets.

@itang
Created February 23, 2021 11:34
Show Gist options
  • Save itang/e33f2722732f92d2465ff1d7e8bed240 to your computer and use it in GitHub Desktop.
Save itang/e33f2722732f92d2465ff1d7e8bed240 to your computer and use it in GitHub Desktop.
private def print_type_tree(clazz: Class[?], level: Int = 0): Unit =
if clazz != null then
println((" " * level) + clazz)
val nextLevel = level + 2
clazz.getInterfaces.foreach(it => print_type_tree(it, nextLevel))
print_type_tree(clazz.getSuperclass, nextLevel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment