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

False negative "name clash" when method has a different type argument in param

XMLWordPrintable

    • generic
    • generic
    • Not verified

      ADDITIONAL SYSTEM INFORMATION :
      This bug can be replicated in all Java distributions versions.

      A DESCRIPTION OF THE PROBLEM :
      The compiler should report a "name clash" on the following code:
      ```java
      public abstract class A0<T> {
          public abstract Object func(A0<Object> arg0, T arg1);
      }
      public abstract class A1 extends A0<A1> {
          public void func(A0<A1> arg1, A1 arg2) {
          }
      }
      ```
      If you change "extends A0<A1>" into "extends A0<Object>", the bug disappear (which means compiler reported a "name clash" as we expected).


      FREQUENCY : always


        1. A0.java
          0.1 kB
        2. A1.java
          0.1 kB

            vromero Vicente Arturo Romero Zaldivar
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: