Skip to content

Commit c5c1916

Browse files
marmbruspwendell
authored andcommitted
SPARK-1494 Don't initialize classes loaded by MIMA excludes, attempt 2
[WIP] Looks like scala reflection was invoking the static initializer: ``` ... at org.apache.spark.sql.test.TestSQLContext$.<init>(TestSQLContext.scala:25) at org.apache.spark.sql.test.TestSQLContext$.<clinit>(TestSQLContext.scala) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270) at scala.reflect.runtime.JavaMirrors$JavaMirror.javaClass(JavaMirrors.scala:500) at scala.reflect.runtime.JavaMirrors$JavaMirror.tryJavaClass(JavaMirrors.scala:505) at scala.reflect.runtime.SymbolLoaders$PackageScope.lookupEntry(SymbolLoaders.scala:109) ... ``` Need to make sure that this doesn't change the exclusion semantics before merging. Author: Michael Armbrust <[email protected]> Closes apache#526 from marmbrus/mima and squashes the following commits: 8168dea [Michael Armbrust] Spurious change afba262 [Michael Armbrust] Prevent Scala reflection from running static class initializer.
1 parent bd37509 commit c5c1916

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object GenerateMIMAIgnore {
5050
is a module or class. */
5151

5252
val privateAsClass = mirror
53-
.staticClass(className)
53+
.classSymbol(Class.forName(className, false, classLoader))
5454
.privateWithin
5555
.fullName
5656
.startsWith(packageName)

0 commit comments

Comments
 (0)