jdk/src/share/classes/java/security/AccessController.java
changeset 10336 0bb1999251f8
parent 5506 202f599c92aa
child 14208 fd8e875982e9
equal deleted inserted replaced
10335:3c7eda3ab2f5 10336:0bb1999251f8
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2011, 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
   404          * callerClass[0] = Reflection.getCallerClass
   404          * callerClass[0] = Reflection.getCallerClass
   405          * callerClass[1] = AccessController.preserveCombiner
   405          * callerClass[1] = AccessController.preserveCombiner
   406          * callerClass[2] = AccessController.doPrivileged
   406          * callerClass[2] = AccessController.doPrivileged
   407          * callerClass[3] = caller
   407          * callerClass[3] = caller
   408          */
   408          */
   409         final Class callerClass = sun.reflect.Reflection.getCallerClass(3);
   409         final Class<?> callerClass = sun.reflect.Reflection.getCallerClass(3);
   410         ProtectionDomain callerPd = doPrivileged
   410         ProtectionDomain callerPd = doPrivileged
   411             (new PrivilegedAction<ProtectionDomain>() {
   411             (new PrivilegedAction<ProtectionDomain>() {
   412             public ProtectionDomain run() {
   412             public ProtectionDomain run() {
   413                 return callerClass.getProtectionDomain();
   413                 return callerClass.getProtectionDomain();
   414             }
   414             }
   536                 dumpDebug &= !Debug.isOn("permission=") ||
   536                 dumpDebug &= !Debug.isOn("permission=") ||
   537                     Debug.isOn("permission=" + perm.getClass().getCanonicalName());
   537                     Debug.isOn("permission=" + perm.getClass().getCanonicalName());
   538             }
   538             }
   539 
   539 
   540             if (dumpDebug && Debug.isOn("stack")) {
   540             if (dumpDebug && Debug.isOn("stack")) {
   541                 Thread.currentThread().dumpStack();
   541                 Thread.dumpStack();
   542             }
   542             }
   543 
   543 
   544             if (dumpDebug && Debug.isOn("domain")) {
   544             if (dumpDebug && Debug.isOn("domain")) {
   545                 debug.println("domain (context is null)");
   545                 debug.println("domain (context is null)");
   546             }
   546             }