This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Illegal Package-Private Accesses Yet Again!


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]