Errata in JLS (Overriding)?

Hi, I'm going through JLS Third Edition, page 227. In the first discussion is said that:

[quote]

It is a compile time error if a type declaration T has a member method m1 and there exists a method m2 declared in T or a supertype of T such that all of the following conditions hold:

a) m1 and m2 have the same name

b) m2 is accessible from T

c) The signature of m1 is not a subsignature of m2

d) m1 [...] has the same erasure as m2 [...]

[/quote]

I declared the following two classes:

/*

* C.java

*

* Created on 28 May 2007, 17:12

*

* To change this template, choose Tools | Template Manager

* and open the template in the editor.

*/

package experiments;

/**

*

* @author mtedone

*/

publicclass C<T>{

/** Creates a new instance of C */

public C(){

}

T id (T x){

returnnull;

}

}

and

/*

* D.java

*

* Created on 28 May 2007, 17:13

*

* To change this template, choose Tools | Template Manager

* and open the template in the editor.

*/

package experiments;

/**

*

* @author mtedone

*/

publicclass Dextends C<String>{

/** Creates a new instance of D */

public D(){

}

Object id (Object o){

returnnull;

}

}

But NetBeans doesn't produce any compile-time error.

[2446 byte] By [mtedonea] at [2007-11-27 5:42:35]
# 1
Stinkin' NetBeanz.I ran your code though the jdk's compiler and I get the error:name clash: id(java.lang.Object) in D and id(T) in C<java.lang.String> have the same erasure, yet neither overrides the other
Hippolytea at 2007-7-12 15:21:23 > top of Java-index,Java Essentials,New To Java...
# 2
Apologies. I re-built the entire project and I got the same exception :(
mtedonea at 2007-7-12 15:21:23 > top of Java-index,Java Essentials,New To Java...
# 3
I guess I'll have to find another reason to dislike NetBeanz ;-)
Hippolytea at 2007-7-12 15:21:23 > top of Java-index,Java Essentials,New To Java...
# 4
> I guess I'll have to find another reason to dislike> NetBeanz ;-)Just wait a bit until Netbeans 6 is released. I hate it already because when I try to run a single class it builds the whole flippin project!
sabre150a at 2007-7-12 15:21:23 > top of Java-index,Java Essentials,New To Java...
# 5
> I guess I'll have to find another reason to dislike> NetBeanz ;-)Can't we just hate it because we are NetBeanzophobes? Why do we have to have legitimate reasons to hate it:(
macrules2a at 2007-7-12 15:21:23 > top of Java-index,Java Essentials,New To Java...
# 6

> > I guess I'll have to find another reason to

> dislike

> > NetBeanz ;-)

>

> Can't we just hate it because we are NetBeanzophobes?

> Why do we have to have legitimate reasons to hate it

>:(

why should we indeed? But it helps to carry arguments (at least with people who aren't Netbeanzophiles, they're dumb to anything that's not positive about the abomination).

Performance is always a good one, unintuitive user interface is another, poor refactoring support.

Or just say that it's made in Swing and Swing is ugly. Sure to set them off, funny to watch (especially as you know it's a bogus argument to start with) :)

jwentinga at 2007-7-12 15:21:23 > top of Java-index,Java Essentials,New To Java...