From: kkhan Date: Tue, 18 Jul 2006 09:35:36 +0000 (+0000) Subject: Handle Annotation.annotationType() calls X-Git-Tag: rel_3_17_1_ga~335 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=da847bf6bf5634044a7f2acc07c839aa4f090721;p=javassist.git Handle Annotation.annotationType() calls git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@297 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/bytecode/annotation/AnnotationImpl.java b/src/main/javassist/bytecode/annotation/AnnotationImpl.java index 63d89f9c..be66df4f 100644 --- a/src/main/javassist/bytecode/annotation/AnnotationImpl.java +++ b/src/main/javassist/bytecode/annotation/AnnotationImpl.java @@ -85,6 +85,11 @@ public class AnnotationImpl implements InvocationHandler { else if ("hashCode".equals(name)) return new Integer(hashCode()); } + else if ("annotationType".equals(name) && method.getParameterTypes().length == 0) + { + return classLoader.loadClass(getTypeName()); + } + MemberValue mv = annotation.getMemberValue(name); if (mv == null)