test/tools/javac/annotations/repeatingAnnotations/MultipleAnnoMixedOrder.java

Fri, 02 Nov 2012 14:35:57 -0700

author
jjg
date
Fri, 02 Nov 2012 14:35:57 -0700
changeset 1386
bf76f4190ef8
child 1492
df694c775e8a
permissions
-rw-r--r--

7169362: JDK8: Write compiler tests for repeating annotations for JDK8
Reviewed-by: darcy, jjg
Contributed-by: sonali.goel@oracle.com

jjg@1386 1 /*
jjg@1386 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
jjg@1386 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jjg@1386 4 *
jjg@1386 5 * This code is free software; you can redistribute it and/or modify it
jjg@1386 6 * under the terms of the GNU General Public License version 2 only, as
jjg@1386 7 * published by the Free Software Foundation.
jjg@1386 8 *
jjg@1386 9 * This code is distributed in the hope that it will be useful, but WITHOUT
jjg@1386 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jjg@1386 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
jjg@1386 12 * version 2 for more details (a copy is included in the LICENSE file that
jjg@1386 13 * accompanied this code).
jjg@1386 14 *
jjg@1386 15 * You should have received a copy of the GNU General Public License version
jjg@1386 16 * 2 along with this work; if not, write to the Free Software Foundation,
jjg@1386 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jjg@1386 18 *
jjg@1386 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jjg@1386 20 * or visit www.oracle.com if you need additional information or have any
jjg@1386 21 * questions.
jjg@1386 22 */
jjg@1386 23
jjg@1386 24 /**
jjg@1386 25 * @test
jjg@1386 26 * @bug 7169362
jjg@1386 27 * @author sogoel
jjg@1386 28 * @summary Repeatable annotations in random order
jjg@1386 29 * @compile MultipleAnnoMixedOrder.java
jjg@1386 30 */
jjg@1386 31
jjg@1386 32 import java.lang.annotation.ContainedBy;
jjg@1386 33 import java.lang.annotation.ContainerFor;
jjg@1386 34
jjg@1386 35 @ContainedBy(FooContainer.class)
jjg@1386 36 @interface Foo {
jjg@1386 37 int getNumbers();
jjg@1386 38 }
jjg@1386 39
jjg@1386 40 @ContainerFor(Foo.class)
jjg@1386 41 @interface FooContainer {
jjg@1386 42 Foo[] value();
jjg@1386 43 }
jjg@1386 44
jjg@1386 45 @ContainedBy(BazContainer.class)
jjg@1386 46 @interface Baz {
jjg@1386 47 String getStr();
jjg@1386 48 }
jjg@1386 49
jjg@1386 50 @ContainerFor(Baz.class)
jjg@1386 51 @interface BazContainer {
jjg@1386 52 Baz[] value();
jjg@1386 53 }
jjg@1386 54
jjg@1386 55 @Foo(getNumbers=1)
jjg@1386 56 @Baz(getStr="hello")
jjg@1386 57 @Foo(getNumbers=2)
jjg@1386 58 @Baz(getStr="world")
jjg@1386 59 public class MultipleAnnoMixedOrder {}
jjg@1386 60

mercurial