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

javac crashes with Wildcard Parameterized TypeBounds while checking for overriden methods

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Description:
      Following test code contains a class and interface having same method signature. When Wildcard parameterized Types of those reference types are used as bounds for a TypeParameter, the compiler crashes.

      <code>
      class Class1<E> {
          public E met1(){
              return null;
          }
      }
      interface I1<E>{
          public E met1();
      }
      class Class2 <T extends Class1 <?> & I1 >{
      }
      </code>


      Compilation result is :
      <output>

      Following is the Error message:
      An exception has occurred in the compiler (1.7.0-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.AssertionError: isSubtype 15
              at com.sun.tools.javac.code.Types$5.visitType(Types.java:361)
              at com.sun.tools.javac.code.Types$5.visitType(Types.java:342)
              at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visitWildcardType(Types.java:3185)
              at com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:430)
              at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3183)
              at com.sun.tools.javac.code.Types.isSubtype(Types.java:338)
              at com.sun.tools.javac.code.Types.isSubtype(Types.java:322)
              at com.sun.tools.javac.code.Types.isSubtypeUnchecked(Types.java:302)
              at com.sun.tools.javac.code.Types.isConvertible(Types.java:271)
              at com.sun.tools.javac.code.Types.isAssignable(Types.java:1489)
              at com.sun.tools.javac.code.Types.covariantReturnType(Types.java:2699)
              at com.sun.tools.javac.code.Types.returnTypeSubstitutable(Types.java:2683)
              at com.sun.tools.javac.comp.Check.checkOverride(Check.java:1135)
              at com.sun.tools.javac.comp.Check.checkImplementations(Check.java:1574)
              at com.sun.tools.javac.comp.Check.checkImplementations(Check.java:1549)
              at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2736)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2666)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2602)
              at com.sun.tools.javac.comp.Attr.attribBounds(Attr.java:480)
              at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2690)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2666)
              at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2602)
              at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1050)
              at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:779)
              at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:744)
              at com.sun.tools.javac.main.Main.compile(Main.java:386)
              at com.sun.tools.javac.main.Main.compile(Main.java:312)
              at com.sun.tools.javac.main.Main.compile(Main.java:303)
              at com.sun.tools.javac.Main.compile(Main.java:82)
              at com.sun.tools.javac.Main.main(Main.java:67)
      </output>
      <version>
      bash-3.00$ /net/sqindia/export/disk09/jdk/7/latest/binaries/solsparc/bin/java -version
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b24)
      Java HotSpot(TM) Client VM (build 12.0-b01, mixed mode)

      bash-3.00$ uname -a
      SunOS hrajan 5.10 Generic_120011-14 sun4u sparc SUNW,Ultra-60

      *** (#1 of 1): 2008-01-17 19:28:00 IST ###@###.###

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mcimadamore Maurizio Cimadamore
              Reporter:
              duke J. Duke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: