langtools/test/tools/javac/annotations/repeatingAnnotations/MultiLevelRepeatableAnno.java
changeset 15356 cf312dc54c60
parent 14371 5652321f1ae4
equal deleted inserted replaced
15355:a4757c33cae9 15356:cf312dc54c60
     1 /*
     1 /*
     2  * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    27  * @author  sogoel
    27  * @author  sogoel
    28  * @summary ContainerType can have its own container
    28  * @summary ContainerType can have its own container
    29  * @compile MultiLevelRepeatableAnno.java
    29  * @compile MultiLevelRepeatableAnno.java
    30  */
    30  */
    31 
    31 
    32 import java.lang.annotation.ContainedBy;
    32 import java.lang.annotation.Repeatable;
    33 import java.lang.annotation.ContainerFor;
       
    34 
    33 
    35 @ContainedBy(FooContainer.class)
    34 @Repeatable(FooContainer.class)
    36 @interface Foo {}
    35 @interface Foo {}
    37 
    36 
    38 @ContainedBy(FooContainerContainer.class)
    37 @Repeatable(FooContainerContainer.class)
    39 @ContainerFor(Foo.class)
       
    40 @interface FooContainer {
    38 @interface FooContainer {
    41     Foo[] value();
    39     Foo[] value();
    42 }
    40 }
    43 
    41 
    44 @ContainerFor(FooContainer.class)
       
    45 @interface FooContainerContainer {
    42 @interface FooContainerContainer {
    46   FooContainer[] value();
    43   FooContainer[] value();
    47 }
    44 }
    48 
    45 
    49 @Foo @Foo
    46 @Foo @Foo