Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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)
Expand All @@ -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)
}

Expand All @@ -137,8 +136,7 @@ object GenerateMIMAIgnore {
name.endsWith("$class") ||
name.contains("$sp") ||
name.contains("hive") ||
name.contains("Hive") ||
name.contains("repl")
name.contains("Hive")
}

/**
Expand Down