blob: 6d2370629e5cc7cf142ad6c4e9baefe8fa3498ee [file] [log] [blame]
Mads Ager418d1ca2017-05-22 09:35:49 +02001// 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.
4package repeat_annotations;
5
6// Simple test of Java 8 repeated annotations using the new getAnnotationsByType
7// API to access them.
8public class RepeatAnnotationsNewApi {
9
10 @NumberAnnotation(number = 1)
11 @NumberAnnotation(number = 2)
12 @NumberAnnotation(number = 3)
13 class Inner {
14 }
15
16 public static void main(String[] args) {
17 NumberAnnotation[] annotations = Inner.class.getAnnotationsByType(NumberAnnotation.class);
18 System.out.println(annotations.length);
19 for (NumberAnnotation annotation : annotations) {
20 System.out.println("Number annotation value: " + annotation.number());
21 }
22 }
23}