This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 14571 - fastjavac and inner classes compilation
Summary: fastjavac and inner classes compilation
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: Ivan Bradac
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-08-20 08:53 UTC by Massimo Scali
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Massimo Scali 2001-08-20 08:53:03 UTC
I found a bug in fastjavac when using inheritance with inner classes.
Here's attached the brief source code which proof what I discovered and
the following is the different output I got using jdk1.3 javac and
netbeans3.2 fastjavac for compiling the 3 source files attached:

JDK 1.3 javac
$ java Test
A.Inner1
B.Inner1
A.Inner1
B.Inner2

Netbeans 3.2 fastjavac
$ java Test
A.Inner1
B.Inner1
A.Inner1
B.Inner1
B.Inner2

The key is inheritance applied to inner classes:
B.Inner1 extends A.Inner1 and B.Inner2 extends A.Inner1, and both call
super.m() from inside the overidden method m() (this is done to discover

which is considered as the superclass). I expected  that B.Inner2.m()
would consider A.Inner1 as superclass, instead, I found that when I
compile with fastjavac the superclass is not A.Inner1 but B.Inner1,
which is different from what I got compiling with jdk1.3 javac.

public class A {
    public static class Inner1 {
      public void m() {
        System.out.println("A.Inner1");
      }
    }
}

public class B {
    public static class Inner1 extends A.Inner1 {
      public void m() {
        super.m();
        System.out.println("B.Inner1");
      }
    }
    
    public static class Inner2 extends A.Inner1 {
      public void m() {
        super.m();
        System.out.println("B.Inner2");
      }
    }
}

public class Test {
    public static void main (String args[]) {
      B.Inner1 obj1 = new  B.Inner1();
      obj1.m();
      B.Inner2 obj2 = new  B.Inner2();
      obj2.m();
    }
}
Comment 1 Ivan Bradac 2001-08-20 11:08:03 UTC
Lowering the priority. There is a workaround : use a different compiler.
Comment 2 Ivan Bradac 2001-08-20 11:11:49 UTC
Has been forwarded to the Sun's fastjavac team.
Comment 3 Quality Engineering 2003-07-01 13:12:18 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 4 Quality Engineering 2003-07-01 13:15:56 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.
Comment 5 Jan Chalupa 2003-10-30 12:07:41 UTC
A mistakenly closed RESOLVED LATER/REMIND issue. Reopening.
Comment 6 Jan Pokorsky 2003-12-05 10:57:13 UTC
Fastjavac is not supported anymore and since it is a close source there is no
reason to keep this as open issue.
Comment 7 Quality Engineering 2007-09-20 12:09:09 UTC
Reorganization of java component