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

Assertion error is thrown when an annotation class cannot be found.

XMLWordPrintable

    • b40
    • x86
    • windows_xp



      Name: rmT116609 Date: 12/03/2003


      FULL PRODUCT VERSION :
      > java -version
      java version "1.5.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b28)
      Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      A DESCRIPTION OF THE PROBLEM :
      In some cases, an assertion error is thrown when an annotation class cannot be found.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      create file, run javac on it

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      an error message about Marker being not found
      ACTUAL -
      an assertion error

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      An exception has occurred in the compiler (1.5.0-beta). 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.AssertionError
      at com.sun.tools.javac.comp.Attr.visitTree(Attr.java:2167)
      at com.sun.tools.javac.tree.Tree$Visitor.visitAnnotation(Tree.java:1250)
      at com.sun.tools.javac.tree.Tree$Annotation.accept(Tree.java:1104)
      at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:258)
      at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:273)
      at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:166)
      at com.sun.tools.javac.comp.MemberEnter.enterDefaultValue(MemberEnter.java:516)
      at com.sun.tools.javac.comp.MemberEnter.access$100(MemberEnter.java:36)
      at com.sun.tools.javac.comp.MemberEnter$2.enterAnnotation(MemberEnter.java:504)
      at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:81)
      at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:679)
      at com.sun.tools.javac.code.Symbol.complete(Symbol.java:331)
      at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:591)
      at com.sun.tools.javac.comp.Enter.complete(Enter.java:406)
      at com.sun.tools.javac.comp.Enter.main(Enter.java:385)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:384)
      at com.sun.tools.javac.main.Main.compile(Main.java:598)
      at com.sun.tools.javac.main.Main.compile(Main.java:546)
      at com.sun.tools.javac.Main.compile(Main.java:41)
      at com.sun.tools.javac.Main.main(Main.java:32)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      @interface MyAnnotation {
       String value();
       Marker marker() default @Marker;
       Marker markerToo();
      }

      public interface MyBean {
         @MyAnnotation (value="baz", markerToo="not default")
         public String getFoo();
      }

      ---------- END SOURCE ----------
      (Incident Review ID: 227802)
      ======================================================================

            gafter Neal Gafter (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: