@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
/** * Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards. * * @param map the given map * @return an immutable map */ public static <K, V> Map<K, V> copyOf(Map<K, V> map) { Preconditions.checkNotNull(map); return ImmutableMap.<K, V> builder().putAll(map).build(); }
/** * Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards. * * @param map the given map * @return an immutable map */ public static <K, V> Map<K, V> copyOf(Map<K, V> map) { Preconditions.checkNotNull(map); return ImmutableMap.<K, V> builder().putAll(map).build(); }
/** * Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards. * * @param map the given map * @return an immutable map */ public static <K, V> Map<K, V> copyOf(Map<K, V> map) { Preconditions.checkNotNull(map); return ImmutableMap.<K, V> builder().putAll(map).build(); }
/** * Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards. * * @param map the given map * @return an immutable map */ public static <K, V> Map<K, V> copyOf(Map<K, V> map) { Preconditions.checkNotNull(map); return ImmutableMap.<K, V> builder().putAll(map).build(); }
/** * Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards. * * @param map the given map * @return an immutable map */ public static <K, V> Map<K, V> copyOf(Map<K, V> map) { Preconditions.checkNotNull(map); return ImmutableMap.<K, V> builder().putAll(map).build(); }
/** * Creates an immutable map. A copy of the given map is used. As a result, it is safe to modify the source map afterwards. * * @param map the given map * @return an immutable map */ public static <K, V> Map<K, V> copyOf(Map<K, V> map) { Preconditions.checkNotNull(map); return ImmutableMap.<K, V> builder().putAll(map).build(); }