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

two inherited methods with same signature

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • tools
    • b40
    • sparc
    • solaris_8
    • Verified



      Name: ngR10089 Date: 01/27/2004


       
      The latest spec of "Adding Generics to the Java Programming Language: Public
      Draft Specification, Version 2.0", 3.2 reads:

          "It is a compile time error if a class inherits more than one concrete
          method with the same signature.
          This can happen, if a superclass is parameteric, and it has two methods
          that were distinct in the generic declaration, but have the same signature
          in the particular instantiation used."


      However javac (jdk1.5.0-b35) successfully compiles test below.


      --------------- clss44001.java-------------
      package javasoft.sqe.tests.lang.clss44.clss44001;
      import java.io.PrintStream;

      class clss44001b<A> {
          
          void method(A v) {
          }

          void method(Integer v) {
          }

      }

      class clss44001a<A> extends clss44001b<Integer> {
      }

      public class clss44001 {
          public static void main(String argv[]) {
              System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
          }
          public static int run(String argv[],PrintStream out) {
              return 0/*STATUS_PASSED*/;
          }
      }
      ---------------------------------------

      New JCK tests
      lang/CLSS/clss440/clss44001/clss44001.html
      lang/CLSS/clss440/clss44002/clss44002.html
      lang/CLSS/clss440/clss44003/clss44003.html
      lang/EXPR/expr684/expr68402/expr68402.html
      fail due to this bug.



      ======================================================================

            gafter Neal Gafter (Inactive)
            nvgsunw Nvg Nvg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: