spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwend...@apache.org
Subject git commit: SPARK-1494 Don't initialize classes loaded by MIMA excludes.
Date Wed, 23 Apr 2014 05:03:21 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-1.0 0e03e6ad4 -> 18b1867a9


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.
(cherry picked from commit 8e950813334dd8545357f59f4ed77c39ee4180b3)

Signed-off-by: Patrick Wendell <pwendell@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/18b1867a
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/18b1867a
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/18b1867a

Branch: refs/heads/branch-1.0
Commit: 18b1867a97b213885195bf9ad0a104ccee6b92fc
Parents: 0e03e6a
Author: Michael Armbrust <michael@databricks.com>
Authored: Tue Apr 22 21:56:15 2014 -0700
Committer: Patrick Wendell <pwendell@gmail.com>
Committed: Tue Apr 22 22:03:16 2014 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/tools/GenerateMIMAIgnore.scala     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/18b1867a/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala
----------------------------------------------------------------------
diff --git a/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala b/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala
index 3fb85e1..d9978b0 100644
--- a/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala
+++ b/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala
@@ -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
   }
 }


Mime
View raw message