langtools/test/tools/javac/annotations/repeatingAnnotations/SelfRepeatingAnnotations.java
changeset 15356 cf312dc54c60
parent 13689 4d519199a6aa
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.
    31  * @run main SelfRepeatingAnnotations
    31  * @run main SelfRepeatingAnnotations
    32  */
    32  */
    33 
    33 
    34 import java.lang.annotation.*;
    34 import java.lang.annotation.*;
    35 
    35 
    36 @ContainerFor(SelfRepeatingAnno.class)
       
    37 @Retention(RetentionPolicy.RUNTIME)
    36 @Retention(RetentionPolicy.RUNTIME)
    38 @interface Foos {
    37 @interface Foos {
    39     SelfRepeatingAnno[] value();
    38     SelfRepeatingAnno[] value();
    40 }
    39 }
    41 
    40 
    42 @SelfRepeatingAnno
    41 @SelfRepeatingAnno
    43 @Retention(RetentionPolicy.RUNTIME)
    42 @Retention(RetentionPolicy.RUNTIME)
    44 @SelfRepeatingAnno
    43 @SelfRepeatingAnno
    45 @ContainedBy(Foos.class)
    44 @Repeatable(Foos.class)
    46 @interface SelfRepeatingAnno {}
    45 @interface SelfRepeatingAnno {}
    47 
    46 
    48 public class SelfRepeatingAnnotations {
    47 public class SelfRepeatingAnnotations {
    49     public static void  main(String[] args) throws Exception {
    48     public static void  main(String[] args) throws Exception {
    50         Annotation a = SelfRepeatingAnno.class.getAnnotation(Foos.class);
    49         Annotation a = SelfRepeatingAnno.class.getAnnotation(Foos.class);