aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPrashant Sharma <prashant.s@imaginea.com>2014-07-30 22:46:30 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-07-30 22:46:30 -0700
commit5a110da25f15694773d6f7c6ee63c5b08ada4eb0 (patch)
tree5846aa16f53dced0db159b8b0d7220b4c9f93b7f /tools
parent4fb259353f616822c32537e3f031944a6d2a09a8 (diff)
downloadspark-5a110da25f15694773d6f7c6ee63c5b08ada4eb0.tar.gz
spark-5a110da25f15694773d6f7c6ee63c5b08ada4eb0.tar.bz2
spark-5a110da25f15694773d6f7c6ee63c5b08ada4eb0.zip
[SPARK-2497] Included checks for module symbols too.
Author: Prashant Sharma <prashant.s@imaginea.com> Closes #1463 from ScrapCodes/SPARK-2497/mima-exclude-all and squashes the following commits: 72077b1 [Prashant Sharma] Check separately for module symbols. cd96192 [Prashant Sharma] SPARK-2497 Produce "member excludes" irrespective of the fact that class itself is excluded or not.
Diffstat (limited to 'tools')
-rw-r--r--tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala20
1 files changed, 9 insertions, 11 deletions
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 566983675b..16ff89a8a9 100644
--- a/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala
+++ b/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala
@@ -68,12 +68,11 @@ object GenerateMIMAIgnore {
for (className <- classes) {
try {
val classSymbol = mirror.classSymbol(Class.forName(className, false, classLoader))
- val moduleSymbol = mirror.staticModule(className) // TODO: see if it is necessary.
+ val moduleSymbol = mirror.staticModule(className)
val directlyPrivateSpark =
isPackagePrivate(classSymbol) || isPackagePrivateModule(moduleSymbol)
- val developerApi = isDeveloperApi(classSymbol)
- val experimental = isExperimental(classSymbol)
-
+ val developerApi = isDeveloperApi(classSymbol) || isDeveloperApi(moduleSymbol)
+ val experimental = isExperimental(classSymbol) || isExperimental(moduleSymbol)
/* Inner classes defined within a private[spark] class or object are effectively
invisible, so we account for them as package private. */
lazy val indirectlyPrivateSpark = {
@@ -87,10 +86,9 @@ object GenerateMIMAIgnore {
}
if (directlyPrivateSpark || indirectlyPrivateSpark || developerApi || experimental) {
ignoredClasses += className
- } else {
- // check if this class has package-private/annotated members.
- ignoredMembers ++= getAnnotatedOrPackagePrivateMembers(classSymbol)
}
+ // check if this class has package-private/annotated members.
+ ignoredMembers ++= getAnnotatedOrPackagePrivateMembers(classSymbol)
} catch {
case _: Throwable => println("Error instrumenting class:" + className)
@@ -115,8 +113,9 @@ object GenerateMIMAIgnore {
}
private def getAnnotatedOrPackagePrivateMembers(classSymbol: unv.ClassSymbol) = {
- classSymbol.typeSignature.members
- .filter(x => isPackagePrivate(x) || isDeveloperApi(x) || isExperimental(x)).map(_.fullName) ++
+ classSymbol.typeSignature.members.filterNot(x =>
+ x.fullName.startsWith("java") || x.fullName.startsWith("scala"))
+ .filter(x => isPackagePrivate(x) || isDeveloperApi(x) || isExperimental(x)).map(_.fullName) ++
getInnerFunctions(classSymbol)
}
@@ -137,8 +136,7 @@ object GenerateMIMAIgnore {
name.endsWith("$class") ||
name.contains("$sp") ||
name.contains("hive") ||
- name.contains("Hive") ||
- name.contains("repl")
+ name.contains("Hive")
}
/**