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

TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • 8
    • 8
    • tools
    • None
    • jdk8 b99 windows

    • b103
    • Verified

    Description

      Given the following test case:

      import java.lang.annotation.*;

      @Anno(req = true)
      @Anno()
      public class CannotCompileRepeatedAnnoTest {
      }

      @Repeatable(Container.class)
      @interface Anno {
          boolean req() default false;
      }

      @interface Container{
          Anno[] value();
      }

      If it's compiled with javac:
      $ javac CannotCompileRepeatedAnnoTest.java

      javac generates the following error:

      CannotCompileRepeatedAnnoTest.java:34: error: incompatible types: int cannot be converted to boolean
      @Anno(req = true)
      ^
      1 error

      Attachments

        Activity

          People

            vromero Vicente Arturo Romero Zaldivar
            anazarov Andrey Nazarov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: