diff options
Diffstat (limited to 'src/main/javassist/CtClassType.java')
-rw-r--r-- | src/main/javassist/CtClassType.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java index 7ed43759..ef3a2f77 100644 --- a/src/main/javassist/CtClassType.java +++ b/src/main/javassist/CtClassType.java @@ -676,7 +676,20 @@ class CtClassType extends CtClass { } catch (ClassNotFoundException e) { ClassLoader cl2 = cp.getClass().getClassLoader(); - return anno.toAnnotationType(cl2, cp); + try { + return anno.toAnnotationType(cl2, cp); + } + catch (ClassNotFoundException e2){ + try { + Class<?> clazz = cp.get(anno.getTypeName()).toClass(); + return javassist.bytecode.annotation.AnnotationImpl.make( + clazz.getClassLoader(), + clazz, cp, anno); + } + catch (Throwable e3) { + throw new ClassNotFoundException(anno.getTypeName()); + } + } } } |