This is the mail archive of the
java-prs@sources.redhat.com
mailing list for the Java project.
Re: gcj/283: GCJ fails to compile inner classes which extend another inner class
- To: apbianco at cygnus dot com
- Subject: Re: gcj/283: GCJ fails to compile inner classes which extend another inner class
- From: idstewart at softhome dot net
- Date: 15 Jul 2000 16:40:00 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: idstewart at softhome dot net
The following reply was made to PR gcj/283; it has been noted by GNATS.
From: idstewart@softhome.net
To: mark@klomp.org (Mark Wielaard)
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/283: GCJ fails to compile inner classes which extend another inner class
Date: Sat, 15 Jul 2000 12:48:29 -0400 (EDT)
On Sat Jul 15 06:51:51 2000 Mark Wielaard wrote:
>
> Hi,
>
> > > Note that in your example you try to extend InnerB from a non static
> > > innerclass InnerA which is not legal. Making InnerA a public static class
> > > would be a valid example.
> >
> > That, unfortunately, is not an option. I'm working on a clean-room
> > implementation of Swing. Each of the core classes implement the Accessible
> > interface by returning an inner class which extends
> > JComponent.AccessibleJComponent, a protected abstract inner class.
>
> I see what you are trying to do. You found (another) bug which is different
> from gjc/256 (but which can only be shown when the gcj/256 patch is applied).
>
> So to show this bug you have to not only extend the InnerA from InnerB
> but also OuterB from OuterA:
>
> public class OuterA {
> public class InnerA {
> }
> }
>
> public class OuterB extends OuterA {
> public class InnerB extends OuterA.InnerA {
> }
> }
>
> Now gcj will give the following error:
>
> OuterB.java: In class `OuterB$InnerB':
> OuterB.java: In method `<init>(OuterB)':
> OuterB.java:4: No enclosing instance for inner class `OuterA$InnerA' is in scope; an explicit one must be provided when creating this inner class.
> }
> ^
> 1 error
>
> Which is wrong since OuterB is in scope and is an instance of OuterA.
>
> Note that as Bryce noted you want to make sure that you don't have
> any class files around since that gives yet another obscure error message.
I'm compiling in the parent directory of javax, and sending the resulting
.class files to a seperate directory.
example: gcj -C -I/usr/local/japhar/share/classpath -d /usr/local/japhar/share\
/classpath javax/swing/JLayeredPane.java
Is that what you mean?
> P.S. Please CC java-gnats so your comments will make it into the bug database.
Done.
> P.P.S. Where can I find this Swing clean room implementation?
> Are you going to merge it with Classpath/libgcj?
Well, currently it resides only on my hard-drive. I just accepted a position
with the Maxim Group (I start July 31). At somepoint after that I'll get the
paperwork for FSF into RMS, and then add my source to the libgcj repository.
I was kinda holding off, waiting for the Classpath implementation, but after 3
months with no activity, figured it was time to put up or shutup... ;)
Ian