Name: tb29552 Date: 07/30/97
References to inner member class fail when the outer
class' name is same as the package name.
(I.e. references to class B declared within class A in
package A fail).
Compiler output:
bug.java:9: Class bug.bug. bug not found in type declaration.
public class bug extends Frame
^
1 error
----Example code------
package bug;
// package bugPkg; /* javac compiles okay if use this statement */
import java.awt.*;
import java.awt.event.*;
public class bug extends Frame
{
private int data;
public bug()
{
super();
Button b = new Button("Quit");
b.addActionListener(new handleQuit());
this.add(b);
data = 0;
}
class handleQuit implements ActionListener
{
public void actionPerformed(ActionEvent evt)
{
data = 1;
System.exit(0);
}
}
public static void main(String[] args)
{
bug the_bug = new bug();
the_bug.pack();
the_bug.setVisible(true);
}
}
company - Jet Propulsion Laboratory , email - ###@###.###
======================================================================
- relates to
-
JDK-4053302 compilation error with 1.1 compiler, 1.0.2 works fine.
-
- Closed
-