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

StackOverFlowError for Cyclic inheritance in TypeParameters with ArrayType Bounds

    XMLWordPrintable

Details

    • b40
    • generic
    • generic
    • Not verified

    Description

      Description:
      Compiler goes into infinite loop for the following Cyclic inheritance in TypeParameter bounds Negative test case .TypeParameters with ArrayType bounds are not allowed and the compiler should be reporting unexpected type and cyclic inheritance error respectively.


      <code>
      bash-3.00$ cat TypeParamsWithArrayBounds.java
      class TypeParamWithArrayBounds<R extends S[],S extends R[]>{
      }



      </code>
      Compilation result is :
      <output>
      TypeParamsWithArrayBounds.java:1: unexpected type
      found : S[]
      required: class
      class TypeParamWithArrayBounds<R extends S[],S extends R[]>{
                                                ^
      TypeParamsWithArrayBounds.java:1: unexpected type
      found : R[]
      required: class
      class TypeParamWithArrayBounds<R extends S[],S extends R[]>{
                                                              ^


      The system is out of resources.
      Consult the following stack trace for details.
      java.lang.StackOverflowError
              at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visitTypeVar(Types.java:3189)
              at com.sun.tools.javac.code.Type$TypeVar.accept(Type.java:952)
              at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3183)
              at com.sun.tools.javac.code.Types.isSameType(Types.java:556)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1658)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1608)
              at com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:726)
              at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
              at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1661)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1608)
              at com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:726)
              at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
              at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1661)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1608)
              at com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:726)
              at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
              at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1661)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1608)
              at com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:726)
              at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
              at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1661)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1608)
              at com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:726)
              at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
              at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1661)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1608)
              at com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:726)
              at com.sun.tools.javac.code.Types$UnaryVisitor.visit(Types.java:3240)
              at com.sun.tools.javac.code.Types.supertype(Types.java:1605)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1661)
              at com.sun.tools.javac.code.Types$18.visitArrayType(Types.java:1608)
              at com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:726)

      </output>
      <version>
       /net/koori.sfbay/onestop/jdk/7/nightly/binaries/solaris-i586/b25-2008-03-25/jdk1.7.0/bin/java -version
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b25)
      Java HotSpot(TM) Server VM (build 12.0-b01, mixed mode)

      bash-3.2$ uname -a
      SunOS bonsai 5.11 snv_77 i86pc i386 i86pc

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: