langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java
author jfranck
Mon, 03 Dec 2012 11:16:32 +0100
changeset 14804 f93a8d60b9a4
parent 14371 5652321f1ae4
child 15356 cf312dc54c60
permissions -rw-r--r--
8001114: Container annotation is not checked for semantic correctness Reviewed-by: jjg

/**
 * @test    /nodynamiccopyright/
 * @bug     7169362
 * @author  sogoel
 * @summary Default case not specified for other methods in container annotation
 * @compile/fail/ref=MissingDefaultCase1.out -XDrawDiagnostics MissingDefaultCase1.java
 */

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

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

@ContainerFor(Foo.class)
@interface FooContainer {
    Foo[] value();
    String other();  // missing default clause
}

@Foo @Foo
public class MissingDefaultCase1 {}