aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/java/lang
diff options
context:
space:
mode:
authorAndrew Haley <aph@gcc.gnu.org>2007-01-29 13:43:22 +0000
committerAndrew Haley <aph@gcc.gnu.org>2007-01-29 13:43:22 +0000
commitff5157e57978d68c74437841651937e08ae45b98 (patch)
tree7e333ebd882ddda37043e2df9a18e85feea524c8 /libjava/classpath/java/lang
parentb70b9fc3eefde61c2d6d7398c8605bbc7ac1a0d8 (diff)
downloadgcc-ff5157e57978d68c74437841651937e08ae45b98.zip
gcc-ff5157e57978d68c74437841651937e08ae45b98.tar.gz
gcc-ff5157e57978d68c74437841651937e08ae45b98.tar.bz2
SecurityManager.java: Load and initialize java.security.Security.
2007-01-26 Andrew Haley <aph@redhat.com> * java/lang/SecurityManager.java: Load and initialize java.security.Security. From-SVN: r121287
Diffstat (limited to 'libjava/classpath/java/lang')
-rw-r--r--libjava/classpath/java/lang/SecurityManager.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/libjava/classpath/java/lang/SecurityManager.java b/libjava/classpath/java/lang/SecurityManager.java
index 61b4612..ff84d95 100644
--- a/libjava/classpath/java/lang/SecurityManager.java
+++ b/libjava/classpath/java/lang/SecurityManager.java
@@ -167,6 +167,18 @@ public class SecurityManager
*/
public SecurityManager()
{
+ /* "When there is security manager installed, the security manager
+ need to check the package access. However, if the security
+ manager itself uses any unloaded class, it will trigger the
+ classloading, which causes infinite loop. There is no easy
+ legal solution. The workaround will be that security manager
+ can not depend on any unloaded class. In the constructor of
+ security manager, it must transitively load all classes it
+ refers to." Sun bug #4242924. */
+
+ // Load and initialize java.security.Security
+ java.security.Security.getProvider((String)null);
+
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkPermission(new RuntimePermission("createSecurityManager"));