You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jf...@apache.org on 2023/06/09 17:04:05 UTC
[tomee] branch main updated: Close Tomee-4031 - attempt to use parameter names from reflection, which should fall back to arg0 syntax if information was not compiled in
This is an automated email from the ASF dual-hosted git repository.
jfisher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/main by this push:
new ea068b4e63 Close Tomee-4031 - attempt to use parameter names from reflection, which should fall back to arg0 syntax if information was not compiled in
new 77bdfa481c Merge pull request #1056 from exabrial/TOMEE-4031_improve-jmx-parameter-names
ea068b4e63 is described below
commit ea068b4e633e81ef730493521fe610ac7e801004
Author: Jonathan S. Fisher <ex...@gmail.com>
AuthorDate: Fri Jun 9 09:23:04 2023 -0500
Close Tomee-4031 - attempt to use parameter names from reflection, which should fall back to arg0 syntax if information was not compiled in
---
.../java/org/apache/openejb/monitoring/DynamicMBeanWrapper.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/monitoring/DynamicMBeanWrapper.java b/container/openejb-core/src/main/java/org/apache/openejb/monitoring/DynamicMBeanWrapper.java
index e52ce320dd..eb696d5d8e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/monitoring/DynamicMBeanWrapper.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/monitoring/DynamicMBeanWrapper.java
@@ -33,6 +33,7 @@ import java.lang.reflect.InvocationHandler;
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;
@@ -243,12 +244,12 @@ public class DynamicMBeanWrapper implements DynamicMBean, MBeanRegistration {
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;
@@ -256,7 +257,7 @@ public class DynamicMBeanWrapper implements DynamicMBean, MBeanRegistration {
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))) {