modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java

Print this page
rev 8615 : RT-39977: Replace sun.security.util.SecurityConstants with java.lang.RuntimePermission

*** 93,109 **** import sun.reflect.CallerSensitive; import sun.reflect.Reflection; import sun.reflect.misc.ConstructorUtil; import sun.reflect.misc.MethodUtil; import sun.reflect.misc.ReflectUtil; - import sun.security.util.SecurityConstants; /** * Loads an object hierarchy from an XML document. * @since JavaFX 2.0 */ public class FXMLLoader { // Abstract base class for elements private abstract class Element { public final Element parent; public Object value = null; --- 93,113 ---- import sun.reflect.CallerSensitive; import sun.reflect.Reflection; import sun.reflect.misc.ConstructorUtil; import sun.reflect.misc.MethodUtil; import sun.reflect.misc.ReflectUtil; /** * Loads an object hierarchy from an XML document. * @since JavaFX 2.0 */ public class FXMLLoader { + + // Indicates permission to get the ClassLoader + private static final RuntimePermission GET_CLASSLOADER_PERMISSION = + new RuntimePermission("getClassLoader"); + // Abstract base class for elements private abstract class Element { public final Element parent; public Object value = null;
*** 3049,3059 **** if (sm != null) { final ClassLoader callerClassLoader = (caller != null) ? caller.getClassLoader() : null; if (needsClassLoaderPermissionCheck(callerClassLoader, FXMLLoader.class.getClassLoader())) { ! sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION); } } return Thread.currentThread().getContextClassLoader(); } return defaultClassLoader; --- 3053,3063 ---- if (sm != null) { final ClassLoader callerClassLoader = (caller != null) ? caller.getClassLoader() : null; if (needsClassLoaderPermissionCheck(callerClassLoader, FXMLLoader.class.getClassLoader())) { ! sm.checkPermission(GET_CLASSLOADER_PERMISSION); } } return Thread.currentThread().getContextClassLoader(); } return defaultClassLoader;