Skip to content
Snippets Groups Projects
Commit 5a110da2 authored by Prashant Sharma's avatar Prashant Sharma Committed by Patrick Wendell
Browse files

[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.
parent 4fb25935
No related branches found
No related tags found
No related merge requests found
...@@ -68,12 +68,11 @@ object GenerateMIMAIgnore { ...@@ -68,12 +68,11 @@ object GenerateMIMAIgnore {
for (className <- classes) { for (className <- classes) {
try { try {
val classSymbol = mirror.classSymbol(Class.forName(className, false, classLoader)) 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 = val directlyPrivateSpark =
isPackagePrivate(classSymbol) || isPackagePrivateModule(moduleSymbol) isPackagePrivate(classSymbol) || isPackagePrivateModule(moduleSymbol)
val developerApi = isDeveloperApi(classSymbol) val developerApi = isDeveloperApi(classSymbol) || isDeveloperApi(moduleSymbol)
val experimental = isExperimental(classSymbol) val experimental = isExperimental(classSymbol) || isExperimental(moduleSymbol)
/* Inner classes defined within a private[spark] class or object are effectively /* Inner classes defined within a private[spark] class or object are effectively
invisible, so we account for them as package private. */ invisible, so we account for them as package private. */
lazy val indirectlyPrivateSpark = { lazy val indirectlyPrivateSpark = {
...@@ -87,10 +86,9 @@ object GenerateMIMAIgnore { ...@@ -87,10 +86,9 @@ object GenerateMIMAIgnore {
} }
if (directlyPrivateSpark || indirectlyPrivateSpark || developerApi || experimental) { if (directlyPrivateSpark || indirectlyPrivateSpark || developerApi || experimental) {
ignoredClasses += className 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 { } catch {
case _: Throwable => println("Error instrumenting class:" + className) case _: Throwable => println("Error instrumenting class:" + className)
...@@ -115,8 +113,9 @@ object GenerateMIMAIgnore { ...@@ -115,8 +113,9 @@ object GenerateMIMAIgnore {
} }
private def getAnnotatedOrPackagePrivateMembers(classSymbol: unv.ClassSymbol) = { private def getAnnotatedOrPackagePrivateMembers(classSymbol: unv.ClassSymbol) = {
classSymbol.typeSignature.members classSymbol.typeSignature.members.filterNot(x =>
.filter(x => isPackagePrivate(x) || isDeveloperApi(x) || isExperimental(x)).map(_.fullName) ++ x.fullName.startsWith("java") || x.fullName.startsWith("scala"))
.filter(x => isPackagePrivate(x) || isDeveloperApi(x) || isExperimental(x)).map(_.fullName) ++
getInnerFunctions(classSymbol) getInnerFunctions(classSymbol)
} }
...@@ -137,8 +136,7 @@ object GenerateMIMAIgnore { ...@@ -137,8 +136,7 @@ object GenerateMIMAIgnore {
name.endsWith("$class") || name.endsWith("$class") ||
name.contains("$sp") || name.contains("$sp") ||
name.contains("hive") || name.contains("hive") ||
name.contains("Hive") || name.contains("Hive")
name.contains("repl")
} }
/** /**
......
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