From: chiba Date: Mon, 29 May 2006 09:34:15 +0000 (+0000) Subject: fixed JIRA JASSIST-19. X-Git-Tag: rel_3_17_1_ga~355 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=03944658109fedee06decddde63e1e5269f43cbe;p=javassist.git fixed JIRA JASSIST-19. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@276 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/CtBehavior.java b/src/main/javassist/CtBehavior.java index 5eaa1e58..10dda556 100644 --- a/src/main/javassist/CtBehavior.java +++ b/src/main/javassist/CtBehavior.java @@ -166,7 +166,7 @@ public abstract class CtBehavior extends CtMember { ParameterAnnotationsAttribute ainfo2 = (ParameterAnnotationsAttribute) mi.getAttribute(ParameterAnnotationsAttribute.visibleTag); return CtClassType.toAnnotationType(getDeclaringClass().getClassPool(), - ainfo, ainfo2); + ainfo, ainfo2, mi); } /** @@ -324,7 +324,7 @@ public abstract class CtBehavior extends CtMember { * method returns null. * *

Note that an attribute is a data block specified by - * the class file format. + * the class file format. It is not an annotation. * See {@link javassist.bytecode.AttributeInfo}. * * @param name attribute name @@ -341,7 +341,7 @@ public abstract class CtBehavior extends CtMember { * Adds an attribute. The attribute is saved in the class file. * *

Note that an attribute is a data block specified by - * the class file format. + * the class file format. It is not an annotation. * See {@link javassist.bytecode.AttributeInfo}. * * @param name attribute name diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java index ed3d9051..372e2b22 100644 --- a/src/main/javassist/CtClassType.java +++ b/src/main/javassist/CtClassType.java @@ -447,7 +447,7 @@ class CtClassType extends CtClass { } static Object[][] toAnnotationType(ClassPool cp, ParameterAnnotationsAttribute a1, - ParameterAnnotationsAttribute a2) + ParameterAnnotationsAttribute a2, MethodInfo minfo) throws ClassNotFoundException { int numParameters = 0; @@ -456,7 +456,7 @@ class CtClassType extends CtClass { else if (a2 != null) numParameters = a2.numParameters(); else - return new Object[0][]; + numParameters = Descriptor.numOfParameters(minfo.getDescriptor()); Object[][] result = new Object[numParameters][]; for (int i = 0; i < numParameters; i++) {