Illegal Package-Private Accesses in 3.4

Mark Wielaard mark@klomp.org
Sun Aug 10 23:26:00 GMT 2003


Hi (discussion moved from java to java-patches),

On Wed, 2003-07-09 at 21:35, Ranjit Mathew wrote:
>     I applied my package-private access checking patch/kludge to 
> the 3.4 snapshot from 2007-07-02 and found that some of the 
> issues I had reported earlier in 3.3 have been resolved while 
> a new one has been added.
> 
> The issues still present are:
> 
>  2. java.lang.VMThrowable illegally calls "stackTraceAddrs( )"
>     in gnu.gcj.runtime.StackTrace.

It seems to me that the best thing to do is to move StackTrace to the
java.lang package and make it package private to prevent any 'illegal'
access to this class by user code.

>  3. gnu.gcj.runtime.NameFinder illegally uses the constructor
>     in java.lang.StackTraceElement.

Here a simple native method seems to be in place for creating the
StackTraceElement. Which was already done in a couple of other places in
this class.

2003-08-10  Mark Wielaard  <mark@klomp.org>

        * Makefile.am: Move StackTrace.java, natStackTrace.cc and MethodRef
        from gnu/gcj/runtime to java/lang.
        * Makeefile.in: Regenerated.
        * gcj/javaprims.h: Regenerated.
        * gnu/gcj/runtime/NameFinder.java (newStackTraceElement): New method.
        * gnu/gcj/runtime/natNameFinder.cc (newStackTraceElement): Likewise.
        * gnu/gcj/runtime/MethodRef.java: Removed.
        * gnu/gcj/runtime/StackTrace.java: Likewise.
        * gnu/gcj/runtime/natStackTrace.cc: Likewise.
        * java/lang/MethodRef.java: New class moved from gnu/gcj/runtime.
        * java/lang/StackTrace.java: Likewise.
        * java/lang/natStackTrace.cc: Likewise.
        * include/java-interp.h: Use StackTrace from java/lang, not
        gnu/gcj/runtime.
        * java/lang/Class.h: Likewise.
        * java/lang/VMThrowable.java: Likewise.
        * java/lang/natClass.cc: Likewise.
        * java/lang/natRuntime.cc: Likewise.
        * java/lang/natVMSecurityManager.cc: Likewise.
        * java/lang/reflect/natArray.cc: Likewise.
        * java/lang/reflect/natConstructor.cc: Likewise.
        * java/lang/reflect/natField.cc: Likewise.
        * java/lang/reflect/natMethod.cc: Likewise.
        * java/util/natResourceBundle.cc: Likewise.

OK to commit?
Make check on x86 does not show regressions.

Note that gcj/javaprims.h also got the new java.util logging and prefs
subpackages classes included. Makefile.in is not included since it is
long and boring.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StackTrace.patch
Type: text/x-patch
Size: 38277 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20030810/6e57fdbd/attachment.bin>


More information about the Java-patches mailing list