Java: Fix .class accessibility flags for inner classes

Bryce McKinlay bryce@waitaki.otago.ac.nz
Wed Aug 7 23:06:00 GMT 2002


GCJ did not put the correct accessibility flags on the bytecode 
generated for private and protected inner classes.

For example:

class A
{
  private class X {}
}

Running jcf-dump on A$X.class we see:

Attribute "InnerClasses", length:10
  class: 2=A$X (21="X"), access flags: 0x0, outer class: 20=A

But with javac:

Attribute "InnerClasses", length:10
  class: 2=A$X (21="X"), access flags: 0x2 private, outer class: 20=A

This would cause incorrect accessibility errors when, for example, 
trying to access a protected inner class from another package when the 
class file is produced by GCJ.

regards

Bryce.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: java-innerclass-acc-flags.patch
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20020807/1019550e/attachment.ksh>


More information about the Java-patches mailing list