diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-08-18 23:01:23 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-08-18 23:01:23 +0000 |
commit | 207afbb388401bf3580577cd55497cc2cb20d161 (patch) | |
tree | d505669004970002e6b802bbbd94704c31baaceb /src/compiler | |
parent | 6bddfbb6d3a2dca82e71d0b9f531054c1a06d701 (diff) | |
download | scala-207afbb388401bf3580577cd55497cc2cb20d161.tar.gz scala-207afbb388401bf3580577cd55497cc2cb20d161.tar.bz2 scala-207afbb388401bf3580577cd55497cc2cb20d161.zip |
Fixed some stability problems
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index 3754457319..4086682301 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -586,13 +586,23 @@ abstract class GenJVM extends SubComponent { } private def addRemoteException(jmethod: JMethod, meth: Symbol) { + def isRemoteThrows(ainfo: AnnotationInfo) = ainfo match { + case AnnotationInfo(tp, List(arg), _) if tp.typeSymbol == ThrowsAttr => + arg.intTree match { + case Literal(Constant(tpe: Type)) if tpe.typeSymbol == RemoteException.typeSymbol => true + case _ => false + } + case _ => false + } + if (remoteClass || (meth.hasAttribute(RemoteAttr) && jmethod.isPublic() && !forCLDC)) { val ainfo = AnnotationInfo(ThrowsAttr.tpe, List(new AnnotationArgument(Constant(RemoteException))), List()) - if (!meth.attributes.contains(ainfo)) + if (!meth.attributes.exists(isRemoteThrows)) { meth.attributes = ainfo :: meth.attributes; + } } } |