> From: Jochen Hoenicke
>
> : From: "John Keiser" <[EMAIL PROTECTED]>
> : Date: Mon, 25 Jan 1999 10:59:34 -0700
> :
> : Throwable I plan to move into the VM Integration API pretty soon.
> : gnu.vm.stack.* will go away. It's been on my plate for a while, but I
> : haven't gotten around to it. I'll see about it Wed. night, and
> make sure
> : everything still works (I believe it will work without any changes to
> : Japhar).
>
> I'm currently using gnu.vm.stack.StackTrace in
> java.util.ResourceBundle, to get the ClassLoader of the calling method
> (which might be the system class loader). SUN JDK uses a native
> method getClassContext() for this.
>
> Some suggestion how this should be solved? I think
> VMSecurityManager.getClassContext() does what I need, but it is not
> accessible. (I could extend SecurityManager in an inner class, to use
> getClassContext, but this isn't nice.)
>
I am glad to know someone else found a use for it. What exactly are you
using the ClassLoader of the calling method for, if I might ask? Is it a
purpose that will be served adequately by the 1.2 SecurityManager, or do you
need something special? This will definitely affect design considerations.
What I would like to do in the future is create gnu.jvmdi, a JVMDI
interface, and have things like this use that. Hell, why not gnu.jni too?
They would be entirely VM-independent packages, would solve all of these
sorts of problems, and would allow pure Java debuggers as well.
As long as StackTrace and StackFrame are working right now, we can use
those. Incidentally, I didn't think that StackTrace and such were yet
implemented in Japhar ... are ResourceBundles working?
> BTW: SecurityManager.getClassContext() seems to be wrong. The call of
> VMSecurityManager.getClassContext() changes the stack frame and the
> returned array should be `shifted' by one.
>
I'm not quite sure what you mean. It'll probably be obvious when I look at
the code what's going on, but could you possibly elucidate? Which of the
functions, for example, is returning the wrong value? VMSecurityManager or
SecurityManager?
(Oh, and Stuart ... saw your mail while I was writing this. Take note that
he's trying to call these methods from java.util, not java.lang, so we
simply cannot avoid security risks.)
Jochen, how often will ResourceBundle be called? Is this something we'll
need to put effort into optimizing?
--John Keiser