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

generics: crash after error regarding bounds on type variable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 5.0
    • 5.0
    • tools
    • tiger
    • generic
    • solaris_8

    Description

      frog:~/workspaces/test/New38 $ cat T.java
      public class Crash1 {}

       interface C1GenericInterface {}

      interface C1B1<X> {}

      class Crash1Test<X> {

            // crashes the compiler
              public <M extends C1GenericInterface,N extends M & C1B1<X>> void meth( )
      {}
      }
      frog:~/workspaces/test/New38 $ newjavac -source 1.5 T.java
      /usr/java1.4/bin/javac -J-Xbootclasspath/p:/net/frog/gafter/gjc-work/generics/build/bootstrap2 -bootclasspath /net/frog/gafter/gjc-work/generics/build/collections2:/usr/java1.4/jre/lib/stubs.jar:/usr/java1.4/jre/lib/rt.jar -classpath . -source 1.5 T.java
      T.java:1: class Crash1 is public, should be declared in a file named Crash1.java
      public class Crash1 {}
             ^
      T.java:10: compiler message file broken: key=compiler.err.type.var.may.not.be.followed.by.other.bounds arguments=null, null, null, null, null, null, null
              public <M extends C1GenericInterface,N extends M & C1B1<X>> void meth( )
                                                                     ^
      An exception has occurred in the compiler (1.4.0-rc). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException
              at com.sun.tools.javac.v8.comp.Check$Validator.visitTypeApply(Check.java:548)
              at com.sun.tools.javac.v8.tree.Tree$TypeApply.accept(Tree.java:975)
              at com.sun.tools.javac.v8.comp.Check.validate(Check.java:516)
              at com.sun.tools.javac.v8.comp.Check.validate(Check.java:526)
              at com.sun.tools.javac.v8.comp.Check$Validator.visitTypeParameter(Check.java:570)
              at com.sun.tools.javac.v8.tree.Tree$TypeParameter.accept(Tree.java:1001)
              at com.sun.tools.javac.v8.comp.Check.validate(Check.java:516)
              at com.sun.tools.javac.v8.comp.Check.validateTypeParams(Check.java:534)
              at com.sun.tools.javac.v8.comp.Attr.visitMethodDef(Attr.java:364)
              at com.sun.tools.javac.v8.tree.Tree$MethodDef.accept(Tree.java:422)
              at com.sun.tools.javac.v8.comp.Attr.attribTree(Attr.java:212)
              at com.sun.tools.javac.v8.comp.Attr.attribStat(Attr.java:246)
              at com.sun.tools.javac.v8.comp.Attr.attribClassBody(Attr.java:2006)
              at com.sun.tools.javac.v8.comp.Attr.attribClass(Attr.java:1951)
              at com.sun.tools.javac.v8.comp.Attr.attribClass(Attr.java:1915)
              at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:345)
              at com.sun.tools.javac.v8.Main.compile(Main.java:480)
              at com.sun.tools.javac.Main.compile(Main.java:33)
              at com.sun.tools.javac.Main.main(Main.java:24)
      frog:~/workspaces/test/New38 $

      Attachments

        Activity

          People

            gafter Neal Gafter
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: