[Patch] PR java/9685: Fix Catching Illegal Access to Package-Private Fields/Members

Ranjit Mathew rmathew@gmail.com
Thu Apr 22 12:38:00 GMT 2004


Andrew Haley wrote:
> Ranjit Mathew writes:
>  > Hi,
>  > 
>  >     This patch proposes to fix PR java/9685.
>  > 
>  > Tested on i686-pc-linux-gnu by bootstrapping c,c++,java.
>  > No testsuite regressions, except for the known
>  > InvokeInterface failure that's unrelated to this patch.
>  > 
>  > Ok for mainline?
> 
> Looks OK, but I think we should have a test case that fails before
> your patch and passes afterwards.

Oh, just about any simple testcase where someone
accesses a package-private member in another class
in another package (including the default one) would
do. This includes the simple one in the PR:

    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9685

I can put something like that into "libjava.lang" (or
"libjava.compile"?).

For a testcase of this kind, AFAICT I either need to
create a new folder, say "foo", or use one of the
existing sub-folders, say "libjava.compile/support",
to store the class from the "alien" package.

What is preferred?


> Oh, and I guess I agree with Bryce about the function name.  :-)

I think his suggestion of using
"member_accessibility_string" instead of
"java_acc_ctrl_str" is great. Is that OK?

Thanks,
Ranjit.

-- 
Ranjit Mathew          Email: rmathew AT gmail DOT com

Bangalore, INDIA.      Web: http://ranjitmathew.tripod.com/



More information about the Java-patches mailing list