Skip to content

Commit 31f9681

Browse files
committed
Remove deprecated remote annotation
1 parent 409ffad commit 31f9681

File tree

5 files changed

+6
-48
lines changed

5 files changed

+6
-48
lines changed

src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,11 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
317317

318318
trait BCForwardersGen extends BCAnnotGen with BCJGenSigGen {
319319

320-
/* Adds a @remote annotation, actual use unknown.
321-
*
322-
* Invoked from genMethod() and addForwarder().
323-
*
324-
* must-single-thread
325-
*/
326-
def addRemoteExceptionAnnot(isRemoteClass: Boolean, isJMethodPublic: Boolean, meth: Symbol): Unit = {
327-
val needsAnnotation = (
328-
( isRemoteClass ||
329-
isRemote(meth) && isJMethodPublic
330-
) && !(meth.throwsAnnotations contains RemoteExceptionClass)
331-
)
332-
if (needsAnnotation) {
333-
meth.addRemoteRemoteExceptionAnnotation
334-
}
335-
}
336-
337320
/* Add a forwarder for method m. Used only from addForwarders().
338321
*
339322
* must-single-thread
340323
*/
341-
private def addForwarder(isRemoteClass: Boolean, jclass: asm.ClassVisitor, module: Symbol, m: Symbol): Unit = {
324+
private def addForwarder(jclass: asm.ClassVisitor, module: Symbol, m: Symbol): Unit = {
342325
val moduleName = internalName(module)
343326
val methodInfo = module.thisType.memberInfo(m)
344327
val paramJavaTypes: List[BType] = methodInfo.paramTypes map toTypeKind
@@ -356,7 +339,6 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
356339

357340
// TODO needed? for(ann <- m.annotations) { ann.symbol.initialize }
358341
val jgensig = getStaticForwarderGenericSignature(m, module)
359-
addRemoteExceptionAnnot(isRemoteClass, hasPublicBitSet(flags), m)
360342
val (throws, others) = m.annotations partition (_.symbol == ThrowsClass)
361343
val thrownExceptions: List[String] = getExceptions(throws)
362344

@@ -400,7 +382,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
400382
*
401383
* must-single-thread
402384
*/
403-
def addForwarders(isRemoteClass: Boolean, jclass: asm.ClassVisitor, jclassName: String, moduleClass: Symbol): Unit = {
385+
def addForwarders(jclass: asm.ClassVisitor, jclassName: String, moduleClass: Symbol): Unit = {
404386
assert(moduleClass.isModuleClass, moduleClass)
405387
debuglog(s"Dumping mirror class for object: $moduleClass")
406388

@@ -420,7 +402,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
420402
log(s"No forwarder for non-public member $m")
421403
else {
422404
log(s"Adding static forwarder for '$m' from $jclassName to '$moduleClass'")
423-
addForwarder(isRemoteClass, jclass, moduleClass, m)
405+
addForwarder(jclass, moduleClass, m)
424406
}
425407
}
426408
}
@@ -515,7 +497,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
515497
mirrorClass.visitAttribute(if (ssa.isDefined) pickleMarkerLocal else pickleMarkerForeign)
516498
emitAnnotations(mirrorClass, moduleClass.annotations ++ ssa)
517499

518-
addForwarders(isRemote(moduleClass), mirrorClass, mirrorName, moduleClass)
500+
addForwarders(mirrorClass, mirrorName, moduleClass)
519501

520502
innerClassBufferASM ++= classBTypeFromSymbol(moduleClass).info.memberClasses
521503
addInnerClassesASM(mirrorClass, innerClassBufferASM.toList)

src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ trait BCodeSkelBuilder extends BCodeHelpers {
6666
var claszSymbol: Symbol = null
6767
var isCZParcelable = false
6868
var isCZStaticModule = false
69-
var isCZRemote = false
7069

7170
/* ---------------- idiomatic way to ask questions to typer ---------------- */
7271

@@ -94,7 +93,6 @@ trait BCodeSkelBuilder extends BCodeHelpers {
9493
claszSymbol = cd.symbol
9594
isCZParcelable = isAndroidParcelableClass(claszSymbol)
9695
isCZStaticModule = claszSymbol.isStaticModuleClass
97-
isCZRemote = isRemote(claszSymbol)
9896
thisName = internalName(claszSymbol)
9997

10098
cnode = new asm.tree.ClassNode()
@@ -175,7 +173,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
175173
val isCandidateForForwarders = lmoc.shouldEmitForwarders
176174
if (isCandidateForForwarders) {
177175
log(s"Adding static forwarders from '$claszSymbol' to implementations in '$lmoc'")
178-
addForwarders(isRemote(claszSymbol), cnode, thisName, lmoc.moduleClass)
176+
addForwarders(cnode, thisName, lmoc.moduleClass)
179177
}
180178
}
181179
}
@@ -519,7 +517,6 @@ trait BCodeSkelBuilder extends BCodeHelpers {
519517
def initJMethod(flags: Int, paramAnnotations: List[List[Annotation]]): Unit = {
520518

521519
val jgensig = getGenericSignature(methSymbol, claszSymbol)
522-
addRemoteExceptionAnnot(isCZRemote, hasPublicBitSet(flags), methSymbol)
523520
val (excs, others) = methSymbol.annotations partition (_.symbol == ThrowsClass)
524521
val thrownExceptions: List[String] = getExceptions(excs)
525522

src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ class BTypesFromSymbols[I <: BackendInterface](val int: I) extends BTypes {
180180
}
181181

182182
// legacy, to be removed when the @remote annotation gets removed
183-
final def isRemote(s: Symbol) = (s hasAnnotation RemoteAttr)
184183
final def hasPublicBitSet(flags: Int) = ((flags & asm.Opcodes.ACC_PUBLIC) != 0)
185184

186185
/**

src/compiler/scala/tools/nsc/backend/jvm/BackendInterface.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,6 @@ abstract class BackendInterfaceDefinitions { self: BackendInterface =>
689689
// Class symbols used in backend.
690690
// Vals becouse they are to frequent in scala programs so that they are already loaded by backend
691691

692-
lazy val RemoteAttr: Symbol = requiredClass[scala.remote]
693-
lazy val BeanInfoAttr: Symbol = requiredClass[scala.beans.BeanInfo]
694692
lazy val NativeAttr: Symbol = requiredClass[scala.native]
695693
lazy val TransientAttr = requiredClass[scala.transient]
696694
lazy val VolatileAttr = requiredClass[scala.volatile]

src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -967,30 +967,13 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
967967
}
968968
}
969969

970-
/** Adds a @remote annotation, actual use unknown.
971-
*
972-
* Invoked from genMethod() and addForwarder().
973-
*/
974-
def addRemoteExceptionAnnot(isRemoteClass: Boolean, isJMethodPublic: Boolean, meth: Symbol) {
975-
val needsAnnotation = (
976-
( isRemoteClass ||
977-
isRemote(meth) && isJMethodPublic
978-
) && !(meth.throwsAnnotations contains RemoteExceptionClass)
979-
)
980-
if (needsAnnotation) {
981-
val c = Constant(RemoteExceptionClass.tpe)
982-
val arg = Literal(c) setType c.tpe
983-
meth.addAnnotation(appliedType(ThrowsClass, c.tpe), arg)
984-
}
985-
}
986-
987970
// -----------------------------------------------------------------------------------------
988971
// Static forwarders (related to mirror classes but also present in
989972
// a plain class lacking companion module, for details see `isCandidateForForwarders`).
990973
// -----------------------------------------------------------------------------------------
991974

992975
/** Add a forwarder for method m. Used only from addForwarders(). */
993-
private def addForwarder(isRemoteClass: Boolean, jclass: asm.ClassVisitor, module: Symbol, m: Symbol) {
976+
private def addForwarder(jclass: asm.ClassVisitor, module: Symbol, m: Symbol) {
994977
val moduleName = javaName(module)
995978
val methodInfo = module.thisType.memberInfo(m)
996979
val paramJavaTypes: List[asm.Type] = methodInfo.paramTypes map javaType
@@ -1008,7 +991,6 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self =>
1008991

1009992
// TODO needed? for(ann <- m.annotations) { ann.symbol.initialize }
1010993
val jgensig = staticForwarderGenericSignature(m, module)
1011-
addRemoteExceptionAnnot(isRemoteClass, hasPublicBitSet(flags), m)
1012994
val (throws, others) = m.annotations partition (_.symbol == ThrowsClass)
1013995
val thrownExceptions: List[String] = getExceptions(throws)
1014996

0 commit comments

Comments
 (0)