diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index 61abc55501..4424a3796b 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -891,8 +891,11 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self => * This method returns such list of internal names. */ def getExceptions(excs: List[AnnotationInfo]): List[String] = - for (ThrownException(exc) <- excs.distinct) - yield javaName(exc) + for (ThrownException(tp) <- excs.distinct) + yield { + val erased = enteringErasure(erasure.erasure(tp.typeSymbol)(tp)) + javaName(erased.typeSymbol) + } def getCurrentCUnit(): CompilationUnit @@ -995,10 +998,14 @@ abstract class GenASM extends SubComponent with BytecodeWriters { self => * Invoked from genMethod() and addForwarder(). */ def addRemoteExceptionAnnot(isRemoteClass: Boolean, isJMethodPublic: Boolean, meth: Symbol) { + def hasThrowsRemoteException = meth.annotations.exists { + case ThrownException(exc) => exc.typeSymbol == definitions.RemoteExceptionClass + case _ => false + } val needsAnnotation = ( ( isRemoteClass || isRemote(meth) && isJMethodPublic - ) && !(meth.throwsAnnotations contains RemoteExceptionClass) + ) && !hasThrowsRemoteException ) if (needsAnnotation) { val c = Constant(RemoteExceptionClass.tpe) |