JDK-6358551 : Type checker denies class method implements identically quantified interf. mthd.
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P5
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: linux
  • CPU: x86
  • Submitted: 2005-12-02
  • Updated: 2010-04-02
  • Resolved: 2009-03-13
Related Reports
Relates :  
Description
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux [machine name] 2.6.3-7mdk-i686-up-4GB #1 Wed Mar 17 15:17:23 CET 2004 i686 unknown unknown GNU/Linux


A DESCRIPTION OF THE PROBLEM :
(Referring to code in "Source code for an executable test case" section)

Classes  AA, CC and DD compile just fine.  However BB do not, with the error copied below, even though the method signatures are identical up to consistant renaming of bound variables.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simple compile with 5.0.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compile without error.

ACTUAL -
Error message below.


ERROR MESSAGES/STACK TRACES THAT OCCUR :
BB is not abstract and does not override abstract method <X>m(X) in AA
class BB<U, V extends AA<U, V>> implements AA<U,V> {


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------

interface AA<W, Z extends AA<W, Z>> {
  public <X extends AA<W, X>> boolean m(X that);
}

class BB<U, V extends AA<U, V>> implements AA<U,V> {
  public <T extends AA<U, T>> boolean m(T that) { return false; }
}

interface CC<S extends CC<S>> {
  public <R extends CC<R>> boolean n(R that);
}

class DD<P extends CC<P>> implements CC<P> {
  public <Q extends CC<Q>> boolean n(Q that) { return false; }
}


---------- END SOURCE ----------

Comments
EVALUATION This is not reproducible after jdk 7 b48 (see 6729401)
13-03-2009