Skip to content

Commit 9c274ac

Browse files
dongjoon-hyunrxin
authored andcommitted
[SPARK-13627][SQL][YARN] Fix simple deprecation warnings.
## 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 <[email protected]> Closes apache#11479 from dongjoon-hyun/SPARK-13627.
1 parent b60b813 commit 9c274ac

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

examples/src/main/scala/org/apache/spark/examples/mllib/AbstractParams.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ abstract class AbstractParams[T: TypeTag] {
3838
*/
3939
override def toString: String = {
4040
val tpe = tag.tpe
41-
val allAccessors = tpe.declarations.collect {
41+
val allAccessors = tpe.decls.collect {
4242
case m: MethodSymbol if m.isCaseAccessor => m
4343
}
4444
val mirror = runtimeMirror(getClass.getClassLoader)

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -774,17 +774,17 @@ trait ScalaReflection {
774774
}
775775

776776
protected def constructParams(tpe: Type): Seq[Symbol] = {
777-
val constructorSymbol = tpe.member(nme.CONSTRUCTOR)
777+
val constructorSymbol = tpe.member(termNames.CONSTRUCTOR)
778778
val params = if (constructorSymbol.isMethod) {
779-
constructorSymbol.asMethod.paramss
779+
constructorSymbol.asMethod.paramLists
780780
} else {
781781
// Find the primary constructor, and use its parameter ordering.
782782
val primaryConstructorSymbol: Option[Symbol] = constructorSymbol.asTerm.alternatives.find(
783783
s => s.isMethod && s.asMethod.isPrimaryConstructor)
784784
if (primaryConstructorSymbol.isEmpty) {
785785
sys.error("Internal SQL error: Product object did not have a primary constructor.")
786786
} else {
787-
primaryConstructorSymbol.get.asMethod.paramss
787+
primaryConstructorSymbol.get.asMethod.paramLists
788788
}
789789
}
790790
params.flatten

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/package.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ package object codegen {
5151
val classLoader =
5252
generatedClass
5353
.getClassLoader
54-
.asInstanceOf[scala.tools.nsc.interpreter.AbstractFileClassLoader]
54+
.asInstanceOf[scala.reflect.internal.util.AbstractFileClassLoader]
5555
val generatedBytes = classLoader.classBytes(generatedClass.getName)
5656

5757
val packageDir = new java.io.File(dumpDirectory, generatedClass.getPackage.getName)

tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ object GenerateMIMAIgnore {
4444

4545

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

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

5252

5353
private def isPackagePrivate(sym: unv.Symbol) =

yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMasterArguments.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class ApplicationMasterArguments(val args: Array[String]) {
8787
System.exit(-1)
8888
}
8989

90-
userArgs = userArgsBuffer.readOnly
90+
userArgs = userArgsBuffer.toList
9191
}
9292

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

0 commit comments

Comments
 (0)