Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Inner Class limit with Metrowerks Java 1.1.1d3

0 views
Skip to first unread message

Don Arbow

unread,
Aug 12, 1997, 3:00:00 AM8/12/97
to

In article <cxb-120897...@eridanus.lanl.gov>, c...@lanl.gov (Clay P.
Booker) wrote:

: I checked dejanews before posting this, but I could not find the specific
: problem that I've found with Inner Classes under Metrowerks Java 1.1.1d3.
:
: There seems to be a limit of 2 inner classes per class in 1.1.1d3. I've
: posted an example code below (TestObject.java).
: * If I have only two inner classes, such as r1 and r2 (The body of r3 is
: commented out.), then the code compiles fine with no errors.
: * If I remove the comments about r3 so that there are now 3 inner classes
: in TestObject, then I get the compile errors:
:
: Error : Class TestObject already defined in TestObject.java.
: TestObject.java line 4 public class TestObject extends Object
:
: Error : Class TestObject. r1 already defined in TestObject.java.
: TestObject.java line 6 class r1 implements ActionListener
:
: Error : Class TestObject. r2 already defined in TestObject.java.
: TestObject.java line 10 class r2 implements ActionListener
:
: which don't seem to make much sense!
:
: Has anyone had any success with more than 2 inner classes per class?
:
: ---- TestObject.java ----
: import java.awt.*;
: import java.awt.event.*;
:
: public class TestObject extends Object
: {
: class r1 implements ActionListener
: {
: public void actionPerformed( ActionEvent e ) { }
: }
: class r2 implements ActionListener
: {
: public void actionPerformed( ActionEvent e ) { }
: }
: // /*
: class r3 implements ActionListener
: {
: public void actionPerformed( ActionEvent e ) { }
: }
: // */
:
: public TestObject()
: {
: }
: }

It compiles fine for me, both with and without the r3 class commented
out. I ran into some problems compiling 1.1 sources until I had
everything correctly installed. Do a search on Dejanews for the "So you
want to be a Thrill Seeker" thread from sometime in the middle of July.

Don

--
Don Arbow, Partner, CTO
EveryDay Objects, Inc.
don...@wolfenet.com <-- remove underscore to reply
http://www.edo-inc.com

Clay P. Booker

unread,
Aug 12, 1997, 3:00:00 AM8/12/97
to

{
}
}

--
Clay Booker email: boo...@sgt-york.lanl.gov
Group TSA-3, Mail Stop F607 voice: (505) 665-3065
Los Alamos National Laboratory fax: (505) 665-5283
Los Alamos, NM 87544

Ken Orford

unread,
Aug 13, 1997, 3:00:00 AM8/13/97
to

In article <cxb-120897...@eridanus.lanl.gov>, c...@lanl.gov (Clay P.
Booker) wrote:

: I checked dejanews before posting this, but I could not find the specific


: problem that I've found with Inner Classes under Metrowerks Java 1.1.1d3.
:
: There seems to be a limit of 2 inner classes per class in 1.1.1d3. I've
: posted an example code below (TestObject.java).
: * If I have only two inner classes, such as r1 and r2 (The body of r3 is
: commented out.), then the code compiles fine with no errors.
: * If I remove the comments about r3 so that there are now 3 inner classes
: in TestObject, then I get the compile errors:
:
: Error : Class TestObject already defined in TestObject.java.
: TestObject.java line 4 public class TestObject extends Object
:
: Error : Class TestObject. r1 already defined in TestObject.java.
: TestObject.java line 6 class r1 implements ActionListener
:
: Error : Class TestObject. r2 already defined in TestObject.java.
: TestObject.java line 10 class r2 implements ActionListener
:
: which don't seem to make much sense!
:
: Has anyone had any success with more than 2 inner classes per class?

:
I also cannot compile more than two inner classes (standard event adapters).
Can someone at Metrowerks check this out? Clay, perhaps you could submit a
bug report - I've tossed my code already!

Ken


*********************************
Ken Orford Email: he...@nortel.ca
Nortel - Advanced Terminal Technologies
Ottawa, Canada
*********************************

Clay P. Booker

unread,
Aug 13, 1997, 3:00:00 AM8/13/97
to

In article <don_arb-1208...@sea-ts7-p43.wolfenet.com>,
don...@wolfenet.com (Don Arbow) wrote:

> In article <cxb-120897...@eridanus.lanl.gov>, c...@lanl.gov (Clay P.
> Booker) wrote:
>
> : I checked dejanews before posting this, but I could not find the specific
> : problem that I've found with Inner Classes under Metrowerks Java 1.1.1d3.
> :
> : There seems to be a limit of 2 inner classes per class in 1.1.1d3. I've
> : posted an example code below (TestObject.java).
> : * If I have only two inner classes, such as r1 and r2 (The body of r3 is
> : commented out.), then the code compiles fine with no errors.
> : * If I remove the comments about r3 so that there are now 3 inner classes
> : in TestObject, then I get the compile errors:
> :
> : Error : Class TestObject already defined in TestObject.java.
> : TestObject.java line 4 public class TestObject extends Object
> :
> : Error : Class TestObject. r1 already defined in TestObject.java.
> : TestObject.java line 6 class r1 implements ActionListener
> :
> : Error : Class TestObject. r2 already defined in TestObject.java.
> : TestObject.java line 10 class r2 implements ActionListener
> :
> : which don't seem to make much sense!
> :
> : Has anyone had any success with more than 2 inner classes per class?
> :

> : ---- TestObject.java ----
> : import java.awt.*;
> : import java.awt.event.*;
> :
> : public class TestObject extends Object
> : {
> : class r1 implements ActionListener


> : {
> : public void actionPerformed( ActionEvent e ) { }
> : }
> : class r2 implements ActionListener
> : {
> : public void actionPerformed( ActionEvent e ) { }
> : }
> : // /*
> : class r3 implements ActionListener
> : {
> : public void actionPerformed( ActionEvent e ) { }
> : }
> : // */
> :
> : public TestObject()

> : {
> : }
> : }
>
> It compiles fine for me, both with and without the r3 class commented
> out. I ran into some problems compiling 1.1 sources until I had
> everything correctly installed. Do a search on Dejanews for the "So you
> want to be a Thrill Seeker" thread from sometime in the middle of July.
>
> Don
>
> --
> Don Arbow, Partner, CTO
> EveryDay Objects, Inc.
> don...@wolfenet.com <-- remove underscore to reply
> http://www.edo-inc.com

Sorry, you _must_ also compile the following:

public class TrivialApplication
{
public static void main(String args[])
{
TestObject t = new TestObject();
}
}

I noticed after I posted the article, that the compiler was not producing
the errors when I compiled just TestObject. It was complaining when I
compiled a source file that instantiated TestObject! I had been using
"Bring Up to Date" rather than compiling individual files. It's obvious
that the compiler would point to TestObject while compiling
TrivialApplication isn't it :^) ?!

BTW, I've been pointing others on this list to "So you want to be a Thrill
Seeker". I've got several JDK 1.1 projects up and running under 1.1.1d3
so I'm confident that I've got it installed properly. However, I'm
creating code that I also use on a Sun (JDK 1.1.3) and SGI so I frequently
encounter limitations in 1.1.1d3 in shipping code from the Unix machines
to the Mac. I actually encoutered the above problem in a much larger 1.1
project; so I took it down to the simplest code to isolate the problem.

MW Ron

unread,
Aug 13, 1997, 3:00:00 AM8/13/97
to

In article <cxb-120897...@eridanus.lanl.gov>, c...@lanl.gov (Clay P.
Booker) wrote:

>I checked dejanews before posting this, but I could not find the specific
>problem that I've found with Inner Classes under Metrowerks Java 1.1.1d3.
>
>There seems to be a limit of 2 inner classes per class in 1.1.1d3. I've
>posted an example code below (TestObject.java).

Engineering says this is a bug and it is fixed in the upcoming 1.1.3 Java
compiler.

Ron

--
METROWERKS Ron Liechty
http://www.metrowerks.com MW...@metrowerks.com

Greg Bolsinga

unread,
Aug 15, 1997, 3:00:00 AM8/15/97
to

In article <hello-13089...@bcarm68.ott.bnr.ca>, he...@bnr.ca (Ken
Orford) wrote:

=>In article <cxb-120897...@eridanus.lanl.gov>, c...@lanl.gov (Clay P.
=>Booker) wrote:
=>
=>: I checked dejanews before posting this, but I could not find the specific
=>: problem that I've found with Inner Classes under Metrowerks Java 1.1.1d3.
=>:
=>: There seems to be a limit of 2 inner classes per class in 1.1.1d3. I've
=>: posted an example code below (TestObject.java).
=>: * If I have only two inner classes, such as r1 and r2 (The body of r3 is
=>: commented out.), then the code compiles fine with no errors.
=>: * If I remove the comments about r3 so that there are now 3 inner classes
=>: in TestObject, then I get the compile errors:
=>:
=>: Error : Class TestObject already defined in TestObject.java.
=>: TestObject.java line 4 public class TestObject extends Object
=>:
=>: Error : Class TestObject. r1 already defined in TestObject.java.
=>: TestObject.java line 6 class r1 implements ActionListener
=>:
=>: Error : Class TestObject. r2 already defined in TestObject.java.
=>: TestObject.java line 10 class r2 implements ActionListener
=>:
=>: which don't seem to make much sense!
=>:
=>: Has anyone had any success with more than 2 inner classes per class?
=>:
=>I also cannot compile more than two inner classes (standard event adapters).
=>Can someone at Metrowerks check this out? Clay, perhaps you could submit a
=>bug report - I've tossed my code already!

I don't know if this has been posted, but it is a known bug that has been
fixed in the latest beta version.

Thanks.

<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
Greg Bolsinga Software Engineer
bols...@metrowerks.com Java Tools
Metrowerks Corporation
"What have the culture wars done for me lately?" - The Baffler
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

0 new messages