MCPcopy Create free account
hub / github.com/LFYSec/MScan / main

Method main

src/test/resources/pta/basic/Annotations.java:9–20  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

7class Annotations {
8
9 public static void main(String[] args) throws Exception {
10 Method foo = A.class.getMethod("foo", String.class, Object.class);
11 Annotation[][] annotations = foo.getParameterAnnotations();
12 System.out.println(Arrays.deepToString(annotations));
13 Annotation a = annotations[0][1];
14 Class<?> annoType = a.annotationType();
15 // System.out.println(annoType);
16 ClassAnno classAnno = annoType.getAnnotation(ClassAnno.class);
17 // System.out.println(classAnno);
18 Class<?> value = classAnno.value();
19 // System.out.println(value);
20 }
21}
22
23class A {

Callers

nothing calls this directly

Calls 4

annotationTypeMethod · 0.80
getMethodMethod · 0.65
getAnnotationMethod · 0.65

Tested by

no test coverage detected