|
|
|
@ -19,6 +19,7 @@ package org.springframework.expression.spel.ast; |
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.lang.reflect.Modifier; |
|
|
|
import java.lang.reflect.Modifier; |
|
|
|
|
|
|
|
import java.lang.reflect.Proxy; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
@ -260,7 +261,8 @@ public class MethodReference extends SpelNodeImpl { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean isCompilable() { |
|
|
|
public boolean isCompilable() { |
|
|
|
CachedMethodExecutor executorToCheck = this.cachedExecutor; |
|
|
|
CachedMethodExecutor executorToCheck = this.cachedExecutor; |
|
|
|
if (executorToCheck == null || !(executorToCheck.get() instanceof ReflectiveMethodExecutor)) { |
|
|
|
if (executorToCheck == null || executorToCheck.hasProxyTarget() || |
|
|
|
|
|
|
|
!(executorToCheck.get() instanceof ReflectiveMethodExecutor)) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -274,8 +276,7 @@ public class MethodReference extends SpelNodeImpl { |
|
|
|
if (executor.didArgumentConversionOccur()) { |
|
|
|
if (executor.didArgumentConversionOccur()) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
Method method = executor.getMethod(); |
|
|
|
Class<?> clazz = executor.getMethod().getDeclaringClass(); |
|
|
|
Class<?> clazz = method.getDeclaringClass(); |
|
|
|
|
|
|
|
if (!Modifier.isPublic(clazz.getModifiers()) && executor.getPublicDeclaringClass() == null) { |
|
|
|
if (!Modifier.isPublic(clazz.getModifiers()) && executor.getPublicDeclaringClass() == null) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -400,6 +401,10 @@ public class MethodReference extends SpelNodeImpl { |
|
|
|
ObjectUtils.nullSafeEquals(this.target, target) && this.argumentTypes.equals(argumentTypes)); |
|
|
|
ObjectUtils.nullSafeEquals(this.target, target) && this.argumentTypes.equals(argumentTypes)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean hasProxyTarget() { |
|
|
|
|
|
|
|
return (this.target != null && Proxy.isProxyClass(this.target.getType())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public MethodExecutor get() { |
|
|
|
public MethodExecutor get() { |
|
|
|
return this.methodExecutor; |
|
|
|
return this.methodExecutor; |
|
|
|
} |
|
|
|
} |
|
|
|
|