Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6358551

Type checker denies class method implements identically quantified interf. mthd.

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      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 ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: