This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug java/27812] New: Classpath AWT Demo: anonymous class call miscompilation
- From: "mckinlay at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 29 May 2006 22:39:50 -0000
- Subject: [Bug java/27812] New: Classpath AWT Demo: anonymous class call miscompilation
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
GCJ miscompiles part of the classpath AWT demo application in:
classpath/examples/gnu/classpath/examples/awt/Demo.java
In an anonoymous inner class ActionListener implementation, an unqualified call
to a superclass of the outer class is called on "this" instead of the outer
class.
This happens with either source->native or source->bytecode compilation.
class Super
{
void dispose()
{
System.out.println("OK");
}
}
public class PR27812
{
public static void main(String[] args)
{
Y y = new Y();
y.y();
}
static interface I
{
abstract void actionPerformed();
}
static class Y extends Super
{
void y()
{
new I () {
public void actionPerformed () {
dispose();
}
}.actionPerformed();
}
}
}
$ gcj -C PR27812.java
$ gij PR27812
Exception in thread "main" java.lang.NoSuchMethodError: method
PR27812$Y$1.dispose with signature ()V was not found.
at PR27812$Y$1.actionPerformed (PR27812.java:28)
at PR27812$Y.y (PR27812.java:30)
at PR27812.main (PR27812.java:14)
--
Summary: Classpath AWT Demo: anonymous class call miscompilation
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mckinlay at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27812