jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java
changeset 18220 1d724730bd2c
parent 5506 202f599c92aa
child 23010 6dadb192ad81
equal deleted inserted replaced
18219:d4cd832b9802 18220:1d724730bd2c
    31 
    31 
    32 import javax.management.Descriptor;
    32 import javax.management.Descriptor;
    33 import javax.management.MBeanException;
    33 import javax.management.MBeanException;
    34 import javax.management.openmbean.OpenDataException;
    34 import javax.management.openmbean.OpenDataException;
    35 import javax.management.openmbean.OpenType;
    35 import javax.management.openmbean.OpenType;
       
    36 import sun.reflect.misc.MethodUtil;
    36 
    37 
    37 final class ConvertingMethod {
    38 final class ConvertingMethod {
    38     static ConvertingMethod from(Method m) {
    39     static ConvertingMethod from(Method m) {
    39         try {
    40         try {
    40             return new ConvertingMethod(m);
    41             return new ConvertingMethod(m);
   187             // probably can't happen
   188             // probably can't happen
   188             final String msg = methodName() + ": cannot convert parameters " +
   189             final String msg = methodName() + ": cannot convert parameters " +
   189                 "from open values: " + e;
   190                 "from open values: " + e;
   190             throw new MBeanException(e, msg);
   191             throw new MBeanException(e, msg);
   191         }
   192         }
   192         final Object javaReturn = method.invoke(obj, javaParams);
   193         final Object javaReturn = MethodUtil.invoke(method, obj, javaParams);
   193         try {
   194         try {
   194             return returnMapping.toOpenValue(javaReturn);
   195             return returnMapping.toOpenValue(javaReturn);
   195         } catch (OpenDataException e) {
   196         } catch (OpenDataException e) {
   196             // probably can't happen
   197             // probably can't happen
   197             final String msg = methodName() + ": cannot convert return " +
   198             final String msg = methodName() + ": cannot convert return " +