Skip to content

Commit

Permalink
if superclass is not found, delegate to type solver
Browse files Browse the repository at this point in the history
  • Loading branch information
daans committed Jul 30, 2018
1 parent bb99ed8 commit b13a056
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@
import javassist.CtField;
import javassist.CtMethod;
import javassist.NotFoundException;
import javassist.bytecode.AccessFlag;
import javassist.bytecode.BadBytecode;
import javassist.bytecode.SignatureAttribute;
import javassist.bytecode.SyntheticAttribute;
import javassist.bytecode.*;

import java.lang.reflect.Modifier;
import java.util.*;
Expand Down Expand Up @@ -302,7 +299,12 @@ public ResolvedReferenceType getSuperClass() {
SignatureAttribute.ClassSignature classSignature = SignatureAttribute.toClassSignature(ctClass.getGenericSignature());
return JavassistUtils.signatureTypeToType(classSignature.getSuperClass(), typeSolver, this).asReferenceType();
} catch (NotFoundException e) {
throw new RuntimeException(e);
SymbolReference<ResolvedReferenceTypeDeclaration> reference = typeSolver.tryToSolveType(ctClass.getClassFile().getSuperclass());
if (reference.isSolved()) {
return new ReferenceTypeImpl(reference.getCorrespondingDeclaration(), typeSolver);
} else {
throw new RuntimeException(e);
}
} catch (BadBytecode e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit b13a056

Please sign in to comment.