public static <T extends AccessibleObject> SetAccessibleAction<T> of(T object) { return of(object, true); }
public static <T extends AccessibleObject> SetAccessibleAction<T> of(T object, boolean value) { return new SetAccessibleAction<T>(object, value); }
/** * Set the {@code accessible} flag for this accessible object. Does not perform {@link PrivilegedAction} unless necessary. * * @param accessibleObject */ static void ensureAccessible(AccessibleObject accessibleObject) { if (accessibleObject != null) { if (!accessibleObject.isAccessible()) { if (System.getSecurityManager() != null) { AccessController.doPrivileged(SetAccessibleAction.of(accessibleObject)); } else { accessibleObject.setAccessible(true); } } } }
if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (!getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e);
public boolean isEqual(Annotation instance, Annotation other, boolean includeNonBindingTypes) { if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (includeNonBindingTypes || !getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; } } catch (IllegalArgumentException e) { throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e); } } } return true; } return false; } }
final QualifierModel<? extends Annotation> model = store.getBindingTypeModel(annotationClass); if (model.getAnnotatedAnnotation().getMethods().size() == 0) { return Collections.emptyMap(); 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) { builder = ImmutableMap.builder(); if (System.getSecurityManager() != null) { methods = AccessController.doPrivileged(new GetDeclaredMethodsAction(annotationClass)); } else { methods = annotationClass.getDeclaredMethods();
/** * Set the {@code accessible} flag for this accessible object. Does not perform {@link PrivilegedAction} unless necessary. * * @param accessibleObject */ static void ensureAccessible(AccessibleObject accessibleObject) { if (accessibleObject != null) { if (!accessibleObject.isAccessible()) { if (System.getSecurityManager() != null) { AccessController.doPrivileged(SetAccessibleAction.of(accessibleObject)); } else { accessibleObject.setAccessible(true); } } } }
if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (!getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e);
public boolean isEqual(Annotation instance, Annotation other, boolean includeNonBindingTypes) { if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (includeNonBindingTypes || !getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; } } catch (IllegalArgumentException e) { throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e); } } } return true; } return false; } }
final QualifierModel<? extends Annotation> model = store.getBindingTypeModel(annotationClass); if (model.getAnnotatedAnnotation().getMethods().size() == 0) { return Collections.emptyMap(); 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) { builder = ImmutableMap.builder(); if (System.getSecurityManager() != null) { methods = AccessController.doPrivileged(new GetDeclaredMethodsAction(annotationClass)); } else { methods = annotationClass.getDeclaredMethods();
/** * Set the {@code accessible} flag for this accessible object. Does not perform {@link PrivilegedAction} unless necessary. * * @param accessibleObject */ static void ensureAccessible(AccessibleObject accessibleObject) { if (accessibleObject != null) { if (!accessibleObject.isAccessible()) { if (System.getSecurityManager() != null) { AccessController.doPrivileged(SetAccessibleAction.of(accessibleObject)); } else { accessibleObject.setAccessible(true); } } } }
if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (!getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e);
public boolean isEqual(Annotation instance, Annotation other, boolean includeNonBindingTypes) { if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (includeNonBindingTypes || !getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; } } catch (IllegalArgumentException e) { throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e); } } } return true; } return false; } }
final QualifierModel<? extends Annotation> model = store.getBindingTypeModel(annotationClass); if (model.getAnnotatedAnnotation().getMethods().size() == 0) { return Collections.emptyMap(); 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) { builder = ImmutableMap.builder(); if (System.getSecurityManager() != null) { methods = AccessController.doPrivileged(new GetDeclaredMethodsAction(annotationClass)); } else { methods = annotationClass.getDeclaredMethods();
public static <T extends AccessibleObject> SetAccessibleAction<T> of(T object) { return of(object, true); }
public static <T extends AccessibleObject> SetAccessibleAction<T> of(T object, boolean value) { return new SetAccessibleAction<T>(object, value); }
/** * Set the {@code accessible} flag for this accessible object. Does not perform {@link PrivilegedAction} unless necessary. * * @param accessibleObject */ static void ensureAccessible(AccessibleObject accessibleObject) { if (accessibleObject != null) { if (!accessibleObject.isAccessible()) { if (System.getSecurityManager() != null) { AccessController.doPrivileged(SetAccessibleAction.of(accessibleObject)); } else { accessibleObject.setAccessible(true); } } } }
if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (!getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e);
public boolean isEqual(Annotation instance, Annotation other, boolean includeNonBindingTypes) { if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType())) { for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMethods()) { if (includeNonBindingTypes || !getNonBindingMembers().contains(annotatedMethod)) { try { AccessController.doPrivileged(SetAccessibleAction.of(annotatedMethod.getJavaMember())); Object thisValue = annotatedMethod.getJavaMember().invoke(instance); Object thatValue = annotatedMethod.getJavaMember().invoke(other); if (!thisValue.equals(thatValue)) { return false; } } catch (IllegalArgumentException e) { throw new WeldException(e); } catch (IllegalAccessException e) { throw new WeldException(e); } catch (InvocationTargetException e) { throw new WeldException(e); } } } return true; } return false; } }
final QualifierModel<? extends Annotation> model = store.getBindingTypeModel(annotationClass); if (model.getAnnotatedAnnotation().getMethods().size() == 0) { return Collections.emptyMap(); 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) { builder = ImmutableMap.builder(); if (System.getSecurityManager() != null) { methods = AccessController.doPrivileged(new GetDeclaredMethodsAction(annotationClass)); } else { methods = annotationClass.getDeclaredMethods();