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

void.class crashes compiler

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • tools
    • None
    • sparc
    • solaris_9



      Name: ss24420 Date: 03/26/2004


      Compiling this code:

          @interface A {
      Class value() default void.class;
          }

      leads to:

          An exception has occurred in the compiler (1.5.0-beta2).
          Please file a bug...
          java.lang.NullPointerException
      at com.sun.tools.javac.code.Types.erasure(Types.java:1722)
      at com.sun.tools.javac.code.Symbol$ClassSymbol.erasure(Symbol.java:561)
      at com.sun.tools.javac.code.Attribute$Class.makeClassType(Attribute.java:61)
      at com.sun.tools.javac.code.Attribute$Class.<init>(Attribute.java:57)
      at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:195)
      at com.sun.tools.javac.comp.MemberEnter.enterDefaultValue(MemberEnter.java:721)
              ...


      ClassSymbol.erasure(Types) makes the assumption that type.outer() isn't
      null. It is null in this case. (Who'd have thought we'd be erasing void?)


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

            Unassigned Unassigned
            sseligmasunw Scott Seligman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: