Great., Jeroen.

Jeroen Frijters wrote:

Please add the following method to gnu/classpath/VMStackWalker.java and
use that.

/**
* Returns the first user defined class loader on the call stack, or
* null when no non-null class loader was found.
*/
public static ClassLoader getUserClassLoader()
{
   Class[] ctx = getClassContext();
   for (int i = 0; i < ctx.length; i++)
   {
       // Since we live in a class loaded by the bootstrap
       // class loader, getClassLoader is safe to call without
       // needing to be wrapped in a privileged action.
       ClassLoader cl = ctx[i].getClassLoader();
       if (cl != null)
              return cl;
   }
   return null;
}




_______________________________________________
Classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to