Permalink
Browse files

pullrequest feedback

  • Loading branch information...
1 parent adf50a3 commit 0bcdf71a96d6d0b6276801efbe49081f0ae7749d @xeno-by xeno-by committed Feb 4, 2013
@@ -1042,6 +1042,7 @@ abstract class ClassfileParser {
def parseExceptions(len: Int) {
val nClasses = in.nextChar
for (n <- 0 until nClasses) {
+ // FIXME: this performs an equivalent of getExceptionTypes instead of getGenericExceptionTypes (SI-7065)
val cls = pool.getClassSymbol(in.nextChar.toInt)
sym.addThrowsAnnotation(cls)
}
@@ -33,14 +33,14 @@ trait AnnotationInfos extends api.Annotations { self: SymbolTable =>
case ThrownException(exc) => exc
}
- def addThrowsAnnotation(excSym: Symbol): Self = {
- val excTpe = if (excSym.isMonomorphicType) excSym.tpe else {
- debuglog(s"Encountered polymorphic exception `${excSym.fullName}` while parsing class file.")
+ def addThrowsAnnotation(throwableSym: Symbol): Self = {
+ val throwableTpe = if (throwableSym.isMonomorphicType) throwableSym.tpe else {
+ debuglog(s"Encountered polymorphic exception `${throwableSym.fullName}` while parsing class file.")
// in case we encounter polymorphic exception the best we can do is to convert that type to
// monomorphic one by introducing existentials, see SI-7009 for details
- existentialAbstraction(excSym.typeParams, excSym.tpe)
+ existentialAbstraction(throwableSym.typeParams, throwableSym.tpe)
}
- val throwsAnn = AnnotationInfo(appliedType(definitions.ThrowsClass, excTpe), List(Literal(Constant(excTpe))), Nil)
+ val throwsAnn = AnnotationInfo(appliedType(definitions.ThrowsClass, throwableTpe), List(Literal(Constant(throwableTpe))), Nil)
withAnnotations(List(throwsAnn))
}
@@ -616,7 +616,7 @@ private[reflect] trait JavaMirrors extends internal.SymbolTable with api.JavaUni
*/
private def copyAnnotations(sym: Symbol, jann: AnnotatedElement) {
sym setAnnotations (jann.getAnnotations map JavaAnnotationProxy).toList
- // FIXME: we're not using getGenericExceptionTypes here to be consistent with ClassfileParser
+ // SI-7065: we're not using getGenericExceptionTypes here to be consistent with ClassfileParser
val jexTpes = jann match {
case jm: jMethod => jm.getExceptionTypes.toList
case jconstr: jConstructor[_] => jconstr.getExceptionTypes.toList

0 comments on commit 0bcdf71

Please sign in to comment.