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

Separate compilation breaks check that elements have a default for the containing annotation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • tools
    • None
    • b61
    • generic
    • generic
    • Verified

      Separate compilation breaks the check that all non-value elements for the containing annotation has a default.

      Compiling this first:

      import java.lang.annotation.ContainedBy;
      import java.lang.annotation.ContainerFor;

      public class ClassReaderDefault {
      }

      @ContainerFor(Foo.class)
      @interface FooContainer {
           Foo[] value();
           int f() default 0;
      }

      @ContainedBy(FooContainer.class)
      @interface Foo {}

      And then in a second file:

      @Foo @Foo
      public class SeparateCompile {
      }

      Results in an error for the second compilation.

            jfranck Joel Borggrén-Franck (Inactive)
            jfranck Joel Borggrén-Franck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: