Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
val ps = Set("scala.collection", "scala.collection.convert", "scala.collection.immutable", "scala.collection.mutable")
val cp =[List[_]].getClassLoader)
import scala.collection.JavaConverters._
val topLevel = ps.flatMap(p => cp.getTopLevelClasses(p).asScala)
val all = topLevel.flatMap(c => {
val cl = c.load
cl.getDeclaredClasses.toSet + cl
val ser = classOf[]
def isSer(c: Class[_]): Boolean = ser.isAssignableFrom(c)
def id(c: Class[_]): Long =
all.foreach(c => if (isSer(c)) println(s"$c : ${id(c)}"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment