classpath
[Top][All Lists]
Advanced

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

RE: Implementation details of VMStackWalker


From: Jeroen Frijters
Subject: RE: Implementation details of VMStackWalker
Date: Mon, 25 Jul 2005 10:16:55 +0200

Ingo Prötel wrote:
> I just implemented VMStackWalker for our VM and have some questions.
> 
> The reference implementation of 'getCallingClass()' and
> 'getCallingClassLoader()' just look at the third entry in the class
> context. Would it not be better to return the first class that is not
> assignable to the class in context[0] ? That way we could cope with
> classes that first call some private or protected classes an then ends
> up calling the stack walker.

I'm *very* strongly opposed to this. It makes auditing the code for correctness 
of VMStackWalker *much* harder and it adds no value.

> The next thing I would like to have is a method to get the calling
> method name. This would be good for logging. 

Yeah, we should probably add a method to get the calling method and maybe 
another one to get the entire stack trace (as a java.lang.reflect.Method[]).

> For the security part: Is it enough to check if the class loader of
> context[0] is the boot classloader?

You don't need to enforce that, the documentation is just intended to point out 
that this is a privileged call that is not available to untrusted code. The 
security model will be used to enforce that untrusted code cannot call code in 
the gnu.classpath.* package.

Regards,
Jeroen




reply via email to

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