Skip to content

Commit

Permalink
[SPARK-13627][SQL][YARN] Fix simple deprecation warnings.
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

This PR aims to fix the following deprecation warnings.
  * MethodSymbolApi.paramss--> paramLists
  * AnnotationApi.tpe -> tree.tpe
  * BufferLike.readOnly -> toList.
  * StandardNames.nme -> termNames
  * scala.tools.nsc.interpreter.AbstractFileClassLoader -> scala.reflect.internal.util.AbstractFileClassLoader
  * TypeApi.declarations-> decls

## How was this patch tested?

Check the compile build log and pass the tests.
```
./build/sbt
```

Author: Dongjoon Hyun <dongjoon@apache.org>

Closes #11479 from dongjoon-hyun/SPARK-13627.
  • Loading branch information
dongjoon-hyun authored and rxin committed Mar 3, 2016
1 parent b60b813 commit 9c274ac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class AbstractParams[T: TypeTag] {
*/
override def toString: String = {
val tpe = tag.tpe
val allAccessors = tpe.declarations.collect {
val allAccessors = tpe.decls.collect {
case m: MethodSymbol if m.isCaseAccessor => m
}
val mirror = runtimeMirror(getClass.getClassLoader)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,17 +774,17 @@ trait ScalaReflection {
}

protected def constructParams(tpe: Type): Seq[Symbol] = {
val constructorSymbol = tpe.member(nme.CONSTRUCTOR)
val constructorSymbol = tpe.member(termNames.CONSTRUCTOR)
val params = if (constructorSymbol.isMethod) {
constructorSymbol.asMethod.paramss
constructorSymbol.asMethod.paramLists
} else {
// Find the primary constructor, and use its parameter ordering.
val primaryConstructorSymbol: Option[Symbol] = constructorSymbol.asTerm.alternatives.find(
s => s.isMethod && s.asMethod.isPrimaryConstructor)
if (primaryConstructorSymbol.isEmpty) {
sys.error("Internal SQL error: Product object did not have a primary constructor.")
} else {
primaryConstructorSymbol.get.asMethod.paramss
primaryConstructorSymbol.get.asMethod.paramLists
}
}
params.flatten
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ package object codegen {
val classLoader =
generatedClass
.getClassLoader
.asInstanceOf[scala.tools.nsc.interpreter.AbstractFileClassLoader]
.asInstanceOf[scala.reflect.internal.util.AbstractFileClassLoader]
val generatedBytes = classLoader.classBytes(generatedClass.getName)

val packageDir = new java.io.File(dumpDirectory, generatedClass.getPackage.getName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ object GenerateMIMAIgnore {


private def isDeveloperApi(sym: unv.Symbol) =
sym.annotations.exists(_.tpe =:= unv.typeOf[org.apache.spark.annotation.DeveloperApi])
sym.annotations.exists(_.tree.tpe =:= unv.typeOf[org.apache.spark.annotation.DeveloperApi])

private def isExperimental(sym: unv.Symbol) =
sym.annotations.exists(_.tpe =:= unv.typeOf[org.apache.spark.annotation.Experimental])
sym.annotations.exists(_.tree.tpe =:= unv.typeOf[org.apache.spark.annotation.Experimental])


private def isPackagePrivate(sym: unv.Symbol) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ApplicationMasterArguments(val args: Array[String]) {
System.exit(-1)
}

userArgs = userArgsBuffer.readOnly
userArgs = userArgsBuffer.toList
}

def printUsageAndExit(exitCode: Int, unknownParam: Any = null) {
Expand Down

0 comments on commit 9c274ac

Please sign in to comment.