langtools/test/tools/javac/T8020997/CannotCompileRepeatedAnnoTest.java
author sogoel
Thu, 05 Jun 2014 10:57:10 -0700
changeset 24797 850ebd4d80a7
parent 19251 c3b7abd43bc0
child 27850 d27ca106daa4
permissions -rw-r--r--
8044072: Group 2: create .out files for OverrideChecks tests in tools/javac dir Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19251
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     1
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     2
/*
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     3
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     5
 *
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     8
 * published by the Free Software Foundation.
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
     9
 *
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    14
 * accompanied this code).
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    15
 *
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    19
 *
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    22
 * questions.
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    23
 */
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    24
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    25
/*
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    26
 * @test
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    27
 * @bug 8020997
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    28
 * @summary Cannot compile class with repeating annotation
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    29
 * @compile CannotCompileRepeatedAnnoTest.java
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    30
 */
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    31
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    32
import java.lang.annotation.*;
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    33
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    34
@Anno(req = true)
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    35
@Anno()
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    36
public class CannotCompileRepeatedAnnoTest {
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    37
}
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    38
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    39
@Repeatable(Container.class)
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    40
@interface Anno {
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    41
    boolean req() default false;
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    42
}
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    43
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    44
@interface Container{
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    45
    Anno[] value();
c3b7abd43bc0 8020997: TreeMaker.AnnotationBuilder creates broken element literals with repeating annotations
vromero
parents:
diff changeset
    46
}