Skip to content
Snippets Groups Projects
Commit 8e950813 authored by Michael Armbrust's avatar Michael Armbrust Committed by Patrick Wendell
Browse files

SPARK-1494 Don't initialize classes loaded by MIMA excludes.

[WIP]  Just seeing how Jenkins likes this...

Author: Michael Armbrust <michael@databricks.com>

Closes #494 from marmbrus/mima and squashes the following commits:

6eec616 [Michael Armbrust] Force hive tests to run.
acaf682 [Michael Armbrust] Don't initialize loaded classes.
parent aa77f8a6
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ object GenerateMIMAIgnore {
private def classesPrivateWithin(packageName: String): Set[String] = {
val classes = getClasses(packageName, classLoader)
val classes = getClasses(packageName)
val privateClasses = mutable.HashSet[String]()
def isPackagePrivate(className: String) = {
......@@ -108,8 +108,7 @@ object GenerateMIMAIgnore {
* Scans all classes accessible from the context class loader which belong to the given package
* and subpackages both from directories and jars present on the classpath.
*/
private def getClasses(packageName: String,
classLoader: ClassLoader = Thread.currentThread().getContextClassLoader): Set[String] = {
private def getClasses(packageName: String): Set[String] = {
val path = packageName.replace('.', '/')
val resources = classLoader.getResources(path)
......@@ -128,7 +127,7 @@ object GenerateMIMAIgnore {
val jar = new JarFile(new File(jarPath))
val enums = jar.entries().map(_.getName).filter(_.startsWith(packageName))
val classes = for (entry <- enums if entry.endsWith(".class"))
yield Class.forName(entry.replace('/', '.').stripSuffix(".class"))
yield Class.forName(entry.replace('/', '.').stripSuffix(".class"), false, classLoader)
classes
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment