jdk/src/java.management/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java
changeset 33279 ddef2c0a5c2a
parent 32034 05676cfd40b5
child 33286 71c4bed3de03
equal deleted inserted replaced
33278:b963d5ce87c5 33279:ddef2c0a5c2a
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    43 import javax.management.Descriptor;
    43 import javax.management.Descriptor;
    44 import javax.management.DescriptorRead;
    44 import javax.management.DescriptorRead;
    45 import javax.management.ImmutableDescriptor;
    45 import javax.management.ImmutableDescriptor;
    46 import javax.management.MBeanAttributeInfo;
    46 import javax.management.MBeanAttributeInfo;
    47 import com.sun.jmx.remote.util.EnvHelp;
    47 import com.sun.jmx.remote.util.EnvHelp;
    48 import sun.reflect.misc.ConstructorUtil;
       
    49 import sun.reflect.misc.MethodUtil;
    48 import sun.reflect.misc.MethodUtil;
    50 import sun.reflect.misc.ReflectUtil;
    49 import sun.reflect.misc.ReflectUtil;
    51 
    50 
    52 /**
    51 /**
    53  * Describes an attribute of an open MBean.
    52  * Describes an attribute of an open MBean.
   690     }
   689     }
   691 
   690 
   692     private static <T> T convertFromString(String s, OpenType<T> openType) {
   691     private static <T> T convertFromString(String s, OpenType<T> openType) {
   693         Class<T> c;
   692         Class<T> c;
   694         try {
   693         try {
   695             ReflectUtil.checkPackageAccess(openType.safeGetClassName());
   694             String className = openType.safeGetClassName();
   696             c = cast(Class.forName(openType.safeGetClassName()));
   695             ReflectUtil.checkPackageAccess(className);
       
   696             c = cast(Class.forName(className));
   697         } catch (ClassNotFoundException e) {
   697         } catch (ClassNotFoundException e) {
   698             throw new NoClassDefFoundError(e.toString());  // can't happen
   698             throw new NoClassDefFoundError(e.toString());  // can't happen
   699         }
   699         }
   700 
   700 
   701         // Look for: public static T valueOf(String)
   701         // Look for: public static T valueOf(String)