From 04f35f6f892104076f34e51700d80b4b580d045a Mon Sep 17 00:00:00 2001 From: Sean Mullan <mullan@openjdk.org> Date: Mon, 19 Jun 2017 08:16:03 -0400 Subject: [PATCH] 8181295: Document that SecurityManager::checkPackageAccess may be called by the VM Reviewed-by: mchung --- .../java.base/share/classes/java/lang/SecurityManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java index b60d63e5f02..ef893b73ec9 100644 --- a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java +++ b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java @@ -1496,7 +1496,10 @@ class SecurityManager { * Throws a {@code SecurityException} if the calling thread is not allowed * to access the specified package. * <p> - * This method is called by the {@code loadClass} method of class loaders. + * During class loading, this method may be called by the {@code loadClass} + * method of class loaders and by the Java Virtual Machine to ensure that + * the caller is allowed to access the package of the class that is + * being loaded. * <p> * This method checks if the specified package starts with or equals * any of the packages in the {@code package.access} Security Property.