diff options
-rw-r--r-- | src/main/javassist/CtBehavior.java | 6 | ||||
-rw-r--r-- | src/main/javassist/CtClassType.java | 4 |
2 files changed, 5 insertions, 5 deletions
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. * * <p>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. * * <p>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++) { |