Created
February 18, 2021 09:50
-
-
Save lrytz/7d033ee7d4bd817b28a23ed038d9ed68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s12 -Ccom.google.guava:guava:30.1-jre | |
val ps = Set("scala.collection", "scala.collection.convert", "scala.collection.immutable", "scala.collection.mutable") | |
val cp = com.google.common.reflect.ClassPath.from(classOf[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[java.io.Serializable] | |
def isSer(c: Class[_]): Boolean = ser.isAssignableFrom(c) | |
def id(c: Class[_]): Long = java.io.ObjectStreamClass.lookup(c).getSerialVersionUID() | |
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