Source:
private static Map<String, Object> createValues(final Annotation instance, final MetaAnnotationStore store) { final Class<? extends Annotation> annotationClass = instance.annotationType(); final QualifierModel<? extends Annotation> model = store.getBindingTypeModel(annotationClass); if (model.getAnnotatedAnnotation().getMethods().size() == 0) { return Collections.emptyMap(); } ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); for (final AnnotatedMethod<?> method : model.getAnnotatedAnnotation().getMethods()) { if (!model.getNonBindingMembers().contains(method)) { try { if (System.getSecurityManager() != null) { AccessController.doPrivileged(SetAccessibleAction.of(method.getJavaMember())); } else { method.getJavaMember().setAccessible(true); } builder.put(method.getJavaMember().getName(), method.getJavaMember().invoke(instance)); } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException e) { Method[] methods; builder = ImmutableMap.builder(); if (System.getSecurityManager() != null) { methods = AccessController.doPrivileged((PrivilegedAction<Method[]>)() -> annotationClass.getDeclaredMethods()); } else { methods = annotationClass.getDeclaredMethods(); } for (Method m : methods) { try { builder.put(m.getName(), m.invoke(instance)); } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException ex) { throw ResolutionLogger.LOG.cannotCreateQualifierInstanceValues(instance, Formats.formatAsStackTraceElement(method.getJavaMember()), ex); } } } } } return builder.build(); }

Target:
private static Map<String, Object> createValues(final Annotation instance, final MetaAnnotationStore store) { final Class<? extends Annotation> annotationClass = instance.annotationType(); final QualifierModel<? extends Annotation> model = store.getBindingTypeModel(annotationClass); if (model.getAnnotatedAnnotation().getMethods().size() == 0) { return Collections.emptyMap(); } ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); for (final AnnotatedMethod<?> method : model.getAnnotatedAnnotation().getMethods()) { if (!model.getNonBindingMembers().contains(method)) { try { if (System.getSecurityManager() != null) { AccessController.doPrivileged(SetAccessibleAction.of(method.getJavaMember())); } else { method.getJavaMember().setAccessible(true); } builder.put(method.getJavaMember().getName(), method.getJavaMember().invoke(instance)); } catch (IllegalArgumentException e) { Method[] methods; builder = ImmutableMap.builder(); if (System.getSecurityManager() != null) { methods = AccessController.doPrivileged(new GetDeclaredMethodsAction(annotationClass)); } else { methods = annotationClass.getDeclaredMethods(); } for (Method m : methods) { if (m.getAnnotation(Nonbinding.class) == null) { try { builder.put(m.getName(), m.invoke(instance)); } catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException ex) { throw ResolutionLogger.LOG.cannotCreateQualifierInstanceValues(instance, Formats.formatAsStackTraceElement(method.getJavaMember()), ex); } } } } catch (InvocationTargetException | IllegalAccessException e) { throw ResolutionLogger.LOG.cannotCreateQualifierInstanceValues(instance, Formats.formatAsStackTraceElement(method.getJavaMember()), e); } } } return builder.build(); }