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

Andrew Haley aph@redhat.com
Thu Apr 22 13:25:00 GMT 2004


Ranjit Mathew writes:
 > Andrew Haley wrote:
 > > Ranjit Mathew writes:
 > >  > 
 > >  >   15.12.2.1-accessibility-method-3 PASSED
 > >  >   15.12.2.1-accessibility-method-5 PASSED
 >                                         ^^^^^^
 > Sorry, I should clarify that these are remanants
 > from my botched attempt to cut-paste the testcase
 > names from the log diffs - these cases really FAIL
 > with the patched GCJ, as could be made out from
 > the context.
 > 
 > > Javac says:
 > > 
 > > ./p1/T151221am3c.java:8: m() in p1.T151221am3a cannot implement m() in p1.T151221am3b; attempting to assign weaker access privileges; was public
 > > public abstract class T151221am3c extends T151221am3a implements T151221am3b {
 > >                 ^
 > > 1 error
 > 
 > Huh? With Sun's JDK 1.4.2.03 on Linux, this compiles
 > just fine (I compiled T151221am3d.java, just to clarify).
 > 
 > Perhaps you're using an older/buggier JDK?

Probably.  I guess this was a change from 1.4.1 ->  1.4.2.03.

The fact that we allowed this corner case isn't a reason to reject
your patch.  We allowed this access, but for the wrong reasons.

Andrew.



More information about the Java-patches mailing list