--- /home/cpdev/src/classpath/java/security/AccessController.java	2005-07-02 21:03:40.000000000 +0000
+++ java/security/AccessController.java	2005-06-30 05:34:44.000000000 +0000
@@ -47,6 +47,11 @@
  * And provides a <code>getContext()</code> method which gives the access
  * control context of the current thread that can be used for checking
  * permissions at a later time and/or in another thread.
+ * <p>
+ * XXX - Mostly a stub implementation at the moment. Needs native support
+ * from the VM to function correctly. XXX - Do not forget to think about
+ * how to handle <code>java.lang.reflect.Method.invoke()</code> on the
+ * <code>doPrivileged()</code> methods.
  *
  * @author Mark Wielaard (mark@klomp.org)
  * @since 1.2
@@ -90,15 +95,7 @@
    */
   public static Object doPrivileged(PrivilegedAction action)
   {
-    VMAccessController.pushContext(null);
-    try
-      {
-        return action.run();
-      }
-    finally
-      {
-        VMAccessController.popContext();
-      }
+    return action.run();
   }
 
   /**
@@ -118,15 +115,7 @@
   public static Object doPrivileged(PrivilegedAction action,
                                     AccessControlContext context)
   {
-    VMAccessController.pushContext(context);
-    try
-      {
-        return action.run();
-      }
-    finally
-      {
-        VMAccessController.popContext();
-      }
+    return action.run();
   }
 
   /**
@@ -148,7 +137,6 @@
   public static Object doPrivileged(PrivilegedExceptionAction action)
     throws PrivilegedActionException
   {
-    VMAccessController.pushContext(null);
     try
       {
         return action.run();
@@ -157,10 +145,6 @@
       {
         throw new PrivilegedActionException(e);
       }
-    finally
-      {
-        VMAccessController.popContext();
-      }
   }
 
   /**
@@ -185,7 +169,6 @@
                                     AccessControlContext context)
     throws PrivilegedActionException
   {
-    VMAccessController.pushContext(context);
     try
       {
         return action.run();
@@ -194,28 +177,19 @@
       {
         throw new PrivilegedActionException(e);
       }
-    finally
-      {
-        VMAccessController.popContext();
-      }
   }
 
   /**
    * Returns the complete access control context of the current thread.
-   * The returned object encompasses all {@link ProtectionDomain} objects
-   * for all classes in the current call stack, or the set of protection
-   * domains until the last call to {@link
-   * #doPrivileged(java.security.PrivilegedAction)}.
-   *
-   * <p>Additionally, if a call was made to {@link
-   * #doPrivileged(java.security.PrivilegedAction,java.security.AccessControlContext)}
-   * that supplied an {@link AccessControlContext}, then that context
-   * will be intersected with the calculated one.
-   *
-   * @return The context.
+   * <p>
+   * XXX - Should this include all the protection domains in the call chain
+   * or only the domains till the last <code>doPrivileged()</code> call?
+   * <p>
+   * XXX - needs native support. Currently returns an empty context.
    */
   public static AccessControlContext getContext()
   {
-    return VMAccessController.getContext();
+    // For now just return an new empty context
+    return new AccessControlContext(new ProtectionDomain[0]);
   }
 }
