AttributeList attribs = method.getAttributes();
AttRuntimeVisibleParameterAnnotations visible =
(AttRuntimeVisibleParameterAnnotations)
attribs.findFirst(
AttRuntimeVisibleParameterAnnotations.ATTRIBUTE_NAME);
AttRuntimeInvisibleParameterAnnotations invisible =
(AttRuntimeInvisibleParameterAnnotations)
attribs.findFirst(
AttRuntimeInvisibleParameterAnnotations.ATTRIBUTE_NAME);
if (visible == null) {
if (invisible == null) {
return AnnotationsList.EMPTY;
}
return invisible.getParameterAnnotations();
}
if (invisible == null) {
return visible.getParameterAnnotations();
}
// Both are non-null, so combine them.
return AnnotationsList.combine(visible.getParameterAnnotations(),
invisible.getParameterAnnotations());
}