Skip to content

Commit 8e95081

Browse files
marmbruspwendell
authored andcommitted
SPARK-1494 Don't initialize classes loaded by MIMA excludes.
[WIP] Just seeing how Jenkins likes this... Author: Michael Armbrust <[email protected]> Closes apache#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.
1 parent aa77f8a commit 8e95081

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object GenerateMIMAIgnore {
4141

4242
private def classesPrivateWithin(packageName: String): Set[String] = {
4343

44-
val classes = getClasses(packageName, classLoader)
44+
val classes = getClasses(packageName)
4545
val privateClasses = mutable.HashSet[String]()
4646

4747
def isPackagePrivate(className: String) = {
@@ -108,8 +108,7 @@ object GenerateMIMAIgnore {
108108
* Scans all classes accessible from the context class loader which belong to the given package
109109
* and subpackages both from directories and jars present on the classpath.
110110
*/
111-
private def getClasses(packageName: String,
112-
classLoader: ClassLoader = Thread.currentThread().getContextClassLoader): Set[String] = {
111+
private def getClasses(packageName: String): Set[String] = {
113112
val path = packageName.replace('.', '/')
114113
val resources = classLoader.getResources(path)
115114

@@ -128,7 +127,7 @@ object GenerateMIMAIgnore {
128127
val jar = new JarFile(new File(jarPath))
129128
val enums = jar.entries().map(_.getName).filter(_.startsWith(packageName))
130129
val classes = for (entry <- enums if entry.endsWith(".class"))
131-
yield Class.forName(entry.replace('/', '.').stripSuffix(".class"))
130+
yield Class.forName(entry.replace('/', '.').stripSuffix(".class"), false, classLoader)
132131
classes
133132
}
134133
}

0 commit comments

Comments
 (0)