This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Illegal Package-Private Accesses Yet Again!
- From: Andrew Haley <aph at redhat dot com>
- To: Ranjit Mathew <rmathew at hotmail dot com>
- Cc: java-patches at gcc dot gnu dot org
- Date: Tue, 30 Mar 2004 15:27:18 +0100
- Subject: Re: Illegal Package-Private Accesses Yet Again!
- References: <406870ED.735183B6@hotmail.com><406871C0.74A9025E@hotmail.com><16488.29631.945497.590191@cuddles.cambridge.redhat.com><4069803C.7030907@hotmail.com>
Ranjit Mathew writes:
>
> First, I note that StackTraceElement and NameFinder are in
> the same package and NameFinder.lookup() is called only
> by java.lang.VMThrowable - so I modified lookup( ) to
> directly take in a StackTraceElement.
>
> (BTW, VMThrowable's header indicates that it is a part of
> GNU Classpath, but I could not find it there. :-/)
>
> Second, I created a passthrough native helper method
> in natNameFinder.cc to call the package-private constructor
> in java.lang.StackTraceElement.
>
> Does this look better?
This is fine.
> Index: ChangeLog
> from Ranjit Mathew <rmathew@hotmail.com>
>
> * java/lang/VMThrowable.java (getStackTrace): Pass trace as is to
> modified lookup().
> * gnu/gcj/runtime/NameFinder.java (lookup): Change to take in a
> StackTraceElement directly.
> (newElement): New native helper method to create StackTraceElement
> bypassing Java access control.
> (createStackTraceElement): Use newElement() instead of directly
> calling StackTraceElement's constructor.
> * gnu/gcj/runtime/natNameFinder.cc (newElement): New method.
OK.
Andrew.