• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 package repeat_annotations;
5 
6 // Simple test of Java 8 repeated annotations.
7 public class RepeatAnnotations {
8 
9   @NumberAnnotation(number = 1)
10   @NumberAnnotation(number = 2)
11   @NumberAnnotation(number = 3)
12   class Inner {
13   }
14 
main(String[] args)15   public static void main(String[] args) {
16     NumberAnnotations annotations = Inner.class.getAnnotation(NumberAnnotations.class);
17     System.out.println(annotations.value().length);
18     for (NumberAnnotation annotation : annotations.value()) {
19       System.out.println("Number annotation value: " + annotation.number());
20     }
21   }
22 }
23