Source:
<code>private void prepareEvaluationContext() { StandardEvaluationContext context = getEvaluationContext(false); Class<?> targetType = AopUtils.getTargetClass(this.targetObject); ReflectiveMethodResolver declaredMethodResolver = new ReflectiveMethodResolver() { @Override protected Method[] getMethods(Class<?> type) { return type.getDeclaredMethods(); } }; if (this.method != null) { FixedMethodFilter fixedMethodFilter = new FixedMethodFilter(this.method); context.registerMethodFilter(targetType, fixedMethodFilter); declaredMethodResolver.registerMethodFilter(targetType, fixedMethodFilter); if (this.expectedType != null) { Assert.state(context.getTypeConverter() .canConvert(TypeDescriptor.valueOf((this.method).getReturnType()), TypeDescriptor.valueOf(this.expectedType)), "Cannot convert to expected type (" + this.expectedType + ") from " + this.method); } } else { AnnotatedMethodFilter annotatedMethodFilter = new AnnotatedMethodFilter(this.annotationType, this.methodName, this.requiresReply); Assert.state(canReturnExpectedType(annotatedMethodFilter, targetType, context.getTypeConverter()), "Cannot convert to expected type (" + this.expectedType + ") from " + this.method); context.registerMethodFilter(targetType, annotatedMethodFilter); declaredMethodResolver.registerMethodFilter(targetType, annotatedMethodFilter); } context.setVariable("target", this.targetObject); <START> context.addMethodResolver(declaredMethodResolver); <END> }</code><technical_language>Needs like... context.addMethodResolver(declaredMethodResolver); if (methodResolvers.size() == 2 && methodResolvers.get(1).getClass().equals(ReflectiveMethodResolver.class)) { methodResolvers.remove(methodResolvers.get(1)); } Otherwise, caching is disabled - MethodReference line 175</technical_language>

Target:
private void prepareEvaluationContext() { StandardEvaluationContext context = getEvaluationContext(false); Class<?> targetType = AopUtils.getTargetClass(this.targetObject); ReflectiveMethodResolver declaredMethodResolver = new ReflectiveMethodResolver() { @Override protected Method[] getMethods(Class<?> type) { return Stream.of(type.getMethods(), type.getDeclaredMethods()) .flatMap(Stream::of) .distinct() .toArray(Method[]::new); } }; if (this.method != null) { FixedMethodFilter fixedMethodFilter = new FixedMethodFilter(this.method); context.registerMethodFilter(targetType, fixedMethodFilter); declaredMethodResolver.registerMethodFilter(targetType, fixedMethodFilter); if (this.expectedType != null) { Assert.state(context.getTypeConverter() .canConvert(TypeDescriptor.valueOf((this.method).getReturnType()), TypeDescriptor.valueOf(this.expectedType)), "Cannot convert to expected type (" + this.expectedType + ") from " + this.method); } } else { AnnotatedMethodFilter annotatedMethodFilter = new AnnotatedMethodFilter(this.annotationType, this.methodName, this.requiresReply); Assert.state(canReturnExpectedType(annotatedMethodFilter, targetType, context.getTypeConverter()), "Cannot convert to expected type (" + this.expectedType + ") from " + this.method); context.registerMethodFilter(targetType, annotatedMethodFilter); declaredMethodResolver.registerMethodFilter(targetType, annotatedMethodFilter); } context.setVariable("target", this.targetObject); context.addMethodResolver(declaredMethodResolver); for (Iterator<MethodResolver> iterator = context.getMethodResolvers().iterator(); iterator.hasNext();) { MethodResolver methodResolver = iterator.next(); if (methodResolver.getClass().equals(ReflectiveMethodResolver.class)) { iterator.remove(); } } }