• 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 
5 package multidex002;
6 
7 import java.lang.annotation.Annotation;
8 import multidex002.fakelibrary.MultiDexApplication;
9 
10 @AnnotationWithEnum(ReferencedByAnnotation.B)
11 public class TestApplication extends MultiDexApplication {
12 
13     public static Annotation annotation = getAnnotationWithEnum();
14     public static Annotation annotation2 = getSoleAnnotation(Annotated.class);
15     public static Annotation annotation3 = getSoleAnnotation(Annotated2.class);
16     public static Class<?> interfaceClass = InterfaceWithEnum.class;
17 
getAnnotationWithEnum()18     public static Annotation getAnnotationWithEnum() {
19         return getSoleAnnotation(TestApplication.class);
20     }
21 
getSoleAnnotation(Class<?> annotated)22     public static Annotation getSoleAnnotation(Class<?> annotated) {
23         Annotation[] annot = annotated.getAnnotations();
24         if (annot.length == 1) {
25             return annot[0];
26         }
27 
28         throw new AssertionError();
29     }
30 
31 }
32