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,17 +93,21 @@
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 {
+
+ // 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,11 +3053,11 @@
if (sm != null) {
final ClassLoader callerClassLoader = (caller != null) ?
caller.getClassLoader() :
null;
if (needsClassLoaderPermissionCheck(callerClassLoader, FXMLLoader.class.getClassLoader())) {
- sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
+ sm.checkPermission(GET_CLASSLOADER_PERMISSION);
}
}
return Thread.currentThread().getContextClassLoader();
}
return defaultClassLoader;