ParameterAnnotationsAttribute ainfo2 = (ParameterAnnotationsAttribute)
mi.getAttribute(ParameterAnnotationsAttribute.visibleTag);
return CtClassType.toAnnotationType(getDeclaringClass().getClassPool(),
- ainfo, ainfo2);
+ ainfo, ainfo2, mi);
}
/**
* 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
* 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
}
static Object[][] toAnnotationType(ClassPool cp, ParameterAnnotationsAttribute a1,
- ParameterAnnotationsAttribute a2)
+ ParameterAnnotationsAttribute a2, MethodInfo minfo)
throws ClassNotFoundException
{
int numParameters = 0;
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++) {