static boolean isCallerSensitive(Executable method) { Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { switch (annotation.annotationType().getName()) { case "sun.reflect.CallerSensitive": case "jdk.internal.reflect.CallerSensitive": return true; } } return false; }
static boolean isCallerSensitive(Executable method) { Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { switch (annotation.annotationType().getName()) { case "sun.reflect.CallerSensitive": case "jdk.internal.reflect.CallerSensitive": return true; } } return false; }
private boolean methodRequiresExplicitParamInjection(ParameterContext pc) { for (Annotation annotation : pc.getDeclaringExecutable().getAnnotations()) { if (annotation.annotationType().equals(ExplicitParamInjection.class)) { return true; } } return false; }
private boolean methodRequiresExplicitParamInjection(ParameterContext pc) { for (Annotation annotation : pc.getDeclaringExecutable().getAnnotations()) { if (annotation.annotationType().equals(ExplicitParamInjection.class)) { return true; } } return false; }
private void warnAllMethods(MetaAccessProvider metaAccess, Class<?> clazz) { for (Executable m : clazz.getDeclaredMethods()) { /* * Filter out methods that are, e.g., only present on a certain platform. We do not need * all methods in the warning list, just enough to trigger the warnings. Accessors are * generally allowed too. */ if (m.getAnnotations().length == 0 && !m.getName().startsWith("get") && !m.getName().startsWith("set")) { warnMethods.add(metaAccess.lookupJavaMethod(m)); } } for (Executable m : clazz.getDeclaredConstructors()) { if (m.getAnnotations().length == 0) { warnMethods.add(metaAccess.lookupJavaMethod(m)); } } }
/** * Builds Key from parameter's parameterized type and and qualifying annotations * found on the parameter and its declaring executable (e.g. Method) * * @param parameter parameter for deriving type and annotations from * @return instance of a key */ public static Key<?> of(Parameter parameter) { return new Key(parameter.getParameterizedType(), qualifiers(parameter.getAnnotations(), parameter.getDeclaringExecutable().getAnnotations())); }
methods.addAll(Arrays.asList(clazz.getDeclaredConstructors())); for (Executable m : methods) { NullableKind nullable = getNullable(m.getAnnotations()); Type mType; String mName; methodNode.addExceptionType(getType(e,gTypeMap, e, NullableKind.NONNULL)); for(Annotation a:m.getAnnotations()){ methodNode.addAnnotation(transAnnotation(a));