Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close Tomee-4031 - JMX should attempt to use parameter names from reflection #1056

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Parameter;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -243,20 +244,20 @@ private MBeanOperationInfo newMethodDescriptor(final String operationDescr, fina
private static MBeanParameterInfo[] methodSignature(final MBeanOperationInfo jvmInfo, final Method method) {
final Class<?>[] classes = method.getParameterTypes();
final Annotation[][] annots = method.getParameterAnnotations();
return parameters(jvmInfo, classes, annots);
return parameters(jvmInfo, classes, annots, method.getParameters());
}

static MBeanParameterInfo[] parameters(final MBeanOperationInfo jvmInfo,
final Class<?>[] classes,
final Annotation[][] annots) {
final Annotation[][] annots, Parameter[] parameters) {
final MBeanParameterInfo[] params =
new MBeanParameterInfo[classes.length];
assert classes.length == annots.length;

String desc = "";
for (int i = 0; i < classes.length; i++) {
final Descriptor d = jvmInfo.getSignature()[i].getDescriptor();
final String pn = "arg" + i;
final String pn = parameters[i].getName();
for (final Annotation a : annots[i]) {
final Class<? extends Annotation> type = a.annotationType();
if (type.equals(Description.class) || type.equals(OPENEJB_API_TO_JAVAX.get(Description.class))) {
Expand Down