classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Native library class loader fixes


From: Archie Cobbs
Subject: Re: [cp-patches] Native library class loader fixes
Date: Sat, 01 Jan 2005 15:15:37 -0600
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041129

Archie Cobbs wrote:
   /**
    * Get a list of all the classes currently executing methods on the
-   * Java stack.  getClassContext()[0] is the currently executing method, ie.
-   * the method which called SecurityManager.getClassContext().  (Hint: you
-   * may need to pop off one or more frames: don't include SecurityManager
-   * or VMSecurityManager.getClassContext in your result. Also, be sure that
-   * you correctly handle the context if SecurityManager.getClassContext
-   * was invoked by reflection).
+   * Java stack. <code>getClassContext()[0]</code> is the class associated
+   * with the currently executing method, i.e., the method that called
+   * <code>SecurityManager.getClassContext()</code> or
+   * <code>VMSecurityManager.getClassContext()</code> (possibly through
+   * reflection). So you must be careful to pop off any of these stack
+   * frames from the top of the stack if present:
+   * <ul>
+   * <li><code>SecurityManager.getClassContext()</code>
+   * <li><code>VMSecurityManager.getClassContext()</code>
+   * <li><code>Method.invoke()</code>
+   * <li><code>Constructor.newInstance()</code>
+   * </ul>

Oops, minor glitch: Constructor.newInstance() is not supposed to be listed there (i.e., none of Classpath's constructors invoke getClassContext()).

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]