jfranck@1445: /* jfranck@1445: * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. jfranck@1445: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jfranck@1445: * jfranck@1445: * This code is free software; you can redistribute it and/or modify it jfranck@1445: * under the terms of the GNU General Public License version 2 only, as jfranck@1445: * published by the Free Software Foundation. jfranck@1445: * jfranck@1445: * This code is distributed in the hope that it will be useful, but WITHOUT jfranck@1445: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jfranck@1445: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jfranck@1445: * version 2 for more details (a copy is included in the LICENSE file that jfranck@1445: * accompanied this code). jfranck@1445: * jfranck@1445: * You should have received a copy of the GNU General Public License version jfranck@1445: * 2 along with this work; if not, write to the Free Software Foundation, jfranck@1445: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jfranck@1445: * jfranck@1445: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jfranck@1445: * or visit www.oracle.com if you need additional information or have any jfranck@1445: * questions. jfranck@1445: */ jfranck@1445: jfranck@1445: /** jfranck@1445: * @test jfranck@1445: * @summary Container annotation is not checked for semantic correctness jfranck@1445: * @bug 8001114 jfranck@1445: * jfranck@1445: * @compile/fail/ref=RepeatingTargetNotAllowed.out -XDrawDiagnostics RepeatingTargetNotAllowed.java jfranck@1445: */ jfranck@1445: jfranck@1445: import java.lang.annotation.*; jfranck@1445: jfranck@1445: @ContainedBy(Foos.class) jfranck@1445: @interface Foo {} jfranck@1445: jfranck@1445: @ContainerFor(Foo.class) jfranck@1445: @Target(ElementType.ANNOTATION_TYPE) jfranck@1445: @interface Foos { jfranck@1445: Foo[] value(); jfranck@1445: } jfranck@1445: jfranck@1445: public class RepeatingTargetNotAllowed { jfranck@1445: @Foo @Foo int f = 0; jfranck@1445: }