langtools/test/tools/javac/annotations/repeatingAnnotations/MultiLevelRepeatableAnno.java
author jjg
Mon, 14 Jan 2013 13:50:01 -0800
changeset 15356 cf312dc54c60
parent 14371 5652321f1ae4
permissions -rw-r--r--
8006119: update javac to follow latest spec for repeatable annotations Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14371
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     1
/*
15356
cf312dc54c60 8006119: update javac to follow latest spec for repeatable annotations
jjg
parents: 14371
diff changeset
     2
 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
14371
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     4
 *
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     8
 *
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    13
 * accompanied this code).
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    14
 *
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    18
 *
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    21
 * questions.
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    22
 */
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    23
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    24
/**
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    25
 * @test
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    26
 * @bug     7169362
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    27
 * @author  sogoel
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    28
 * @summary ContainerType can have its own container
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    29
 * @compile MultiLevelRepeatableAnno.java
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    30
 */
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    31
15356
cf312dc54c60 8006119: update javac to follow latest spec for repeatable annotations
jjg
parents: 14371
diff changeset
    32
import java.lang.annotation.Repeatable;
14371
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    33
15356
cf312dc54c60 8006119: update javac to follow latest spec for repeatable annotations
jjg
parents: 14371
diff changeset
    34
@Repeatable(FooContainer.class)
14371
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    35
@interface Foo {}
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    36
15356
cf312dc54c60 8006119: update javac to follow latest spec for repeatable annotations
jjg
parents: 14371
diff changeset
    37
@Repeatable(FooContainerContainer.class)
14371
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    38
@interface FooContainer {
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    39
    Foo[] value();
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    40
}
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    41
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    42
@interface FooContainerContainer {
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    43
  FooContainer[] value();
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    44
}
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    45
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    46
@Foo @Foo
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    47
public class MultiLevelRepeatableAnno  {}
5652321f1ae4 7169362: JDK8: Write compiler tests for repeating annotations for JDK8
jjg
parents:
diff changeset
    48