>>>>> "Dimitris" == Dimitris Vyzovitis <[EMAIL PROTECTED]> writes:

    Dimitris> If you try to compile those files with jikes or ibm's
    Dimitris> javac,

"IBM's javac" is somewhat misleading, javac is written in Java and most
implementations based on Sun's code use it without modifications.  So
the differences between Sun's/Blackdown's/IBM's javac should be very
small to non-existent (when using the same Java2 SDK version).

    Dimitris> everything works smoothly.  However, if your do
    Dimitris> so with blackdown's 1.2.2RC4, the following error
    Dimitris> occurs: [dimitris@gauss bugs]$ javac a.java c.java
    Dimitris> c.java:4: Undefined variable or class name: b
    Dimitris>         System.out.println( b.test );
    Dimitris>                             ^
    Dimitris> 1 error

javac from 1.1/1.2 has many problems with nested classes/interfaces.
The new javac from 1.3 fixes most of them.


BTW, jikes has some problems with this stuff too:

interface I
{
    abstract class C
    {
        static C c = new C() {
            interface InnerI {}
        };
    }
}

According to the JLS2Draft this code is illegal, interfaces are not
allowed in inner classes:
It looks like the 'static' confuses jikes and it thinks 'static C c =
new C() {..}' defines a new top-level class (or according to the new
terminology: a static member class) but it actually defines an
anonymous class inside a static context (JLS2 8.1.2).  Also JLS 15.9.5
says: "An anonymous class is always an inner class; it is never static
(§8.5.2)."
So "new C() {...}" defines an inner class.  But inner classes cannot
have member interfaces (JLS2 8.1.2) so this code should not compile.

javac (1.2.2 and 1.3) reports an error but jikes-1.10 (I haven't tried
newer versions) compiles this code.


        Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html
JVM'01: http://www.usenix.org/events/jvm01/


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to