@ -53,7 +55,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
@@ -53,7 +55,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
privateMap<Class<?>,MethodFilter>filters=null;
// Using distance will ensure a more accurate match is discovered,
// Using distance will ensure a more accurate match is discovered,
// more closely following the Java rules.
privatebooleanuseDistance=false;
@ -66,7 +68,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
@@ -66,7 +68,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
@ -90,7 +92,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
@@ -90,7 +92,7 @@ public class ReflectiveMethodResolver implements MethodResolver {
@ -197,6 +199,16 @@ public class ReflectiveMethodResolver implements MethodResolver {
@@ -197,6 +199,16 @@ public class ReflectiveMethodResolver implements MethodResolver {
@ -48,7 +48,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -48,7 +48,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -71,7 +71,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -71,7 +71,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
// The readerCache will only contain gettable properties (let's not worry about setters for now)
@ -82,10 +82,10 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -82,10 +82,10 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -112,7 +112,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -112,7 +112,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
// TODO remove the duplication here between canRead and read
// Treat it like a property
@ -138,7 +138,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -138,7 +138,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -168,7 +168,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -168,7 +168,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -178,7 +178,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -178,7 +178,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -211,7 +211,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -211,7 +211,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -232,7 +232,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -232,7 +232,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -252,7 +252,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -252,7 +252,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
thrownewAccessException("Neither setter nor field found for property '"+name+"'");
@ -281,6 +281,30 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -281,6 +281,30 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -340,22 +364,22 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -340,22 +364,22 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -387,9 +411,9 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -387,9 +411,9 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -410,7 +434,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -410,7 +434,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -438,10 +462,10 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -438,10 +462,10 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -449,13 +473,13 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -449,13 +473,13 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -468,7 +492,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -468,7 +492,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
publicClass[]getSpecificTargetClasses(){
thrownewUnsupportedOperationException("Should not be called on an OptimalPropertyAccessor");
@ -504,7 +528,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -504,7 +528,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
catch(Exceptionex){
thrownewAccessException("Unable to access property '"+name+"' through getter",ex);
}
}
}
if(memberinstanceofField){
try{
if(needsToBeMadeAccessible){
@ -523,7 +547,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@@ -523,7 +547,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
@ -89,7 +91,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -89,7 +91,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
evaluate("new String('hello 2.0 to you').startsWith(7.0d)",false,Boolean.class);
@ -97,7 +99,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -97,7 +99,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
// On 2 it will throw a RuntimeException
// On 3 it will exit normally
// In each case it increments the Inventor field 'counter' when invoked
@ -115,18 +117,18 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -115,18 +117,18 @@ public class MethodInvocationTests extends ExpressionTestCase {
o=expr.getValue(eContext);
Assert.assertEquals("London",o);
// That confirms the logic to mark the cached reference stale and retry is working
// Now let's cause the method to exit via exception and ensure it doesn't cause
@ -157,7 +159,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -157,7 +159,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
// If counter is 5 then the method got called twice!
@ -168,10 +170,10 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -168,10 +170,10 @@ public class MethodInvocationTests extends ExpressionTestCase {
// On 2 it will throw a RuntimeException
// On 3 it will exit normally
// In each case it increments the Inventor field 'counter' when invoked
@ -184,7 +186,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -184,7 +186,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@ -192,10 +194,10 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -192,10 +194,10 @@ public class MethodInvocationTests extends ExpressionTestCase {
// On 2 it will throw a RuntimeException
// On 3 it will exit normally
// In each case it increments the Inventor field 'counter' when invoked
@ -207,7 +209,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -207,7 +209,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
}
Assert.fail("Should not be a SpelEvaluationException");
@ -215,13 +217,13 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -215,13 +217,13 @@ public class MethodInvocationTests extends ExpressionTestCase {
// Filter will now remove non @Anno annotated methods
filter.removeIfNotAnnotated=true;
filter.filterCalled=false;
@ -229,7 +231,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -229,7 +231,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
result=expr.getValue(context,String.class);
Assert.assertEquals("double 1.0",result);
Assert.assertTrue(filter.filterCalled);
// check not called for other types
filter.filterCalled=false;
context.setRootObject(newString("abc"));
@ -237,7 +239,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -237,7 +239,7 @@ public class MethodInvocationTests extends ExpressionTestCase {
@ -247,14 +249,14 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -247,14 +249,14 @@ public class MethodInvocationTests extends ExpressionTestCase {
Assert.assertEquals("1",result);
Assert.assertFalse(filter.filterCalled);
}
// Simple filter
staticclassLocalFilterimplementsMethodFilter{
publicbooleanremoveIfNotAnnotated=false;
publicbooleanfilterCalled=false;
privatebooleanisAnnotated(Methodm){
Annotation[]annos=m.getAnnotations();
if(annos==null){
@ -282,53 +284,53 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -282,53 +284,53 @@ public class MethodInvocationTests extends ExpressionTestCase {
@ -355,10 +357,16 @@ public class MethodInvocationTests extends ExpressionTestCase {
@@ -355,10 +357,16 @@ public class MethodInvocationTests extends ExpressionTestCase {
@ -65,9 +67,9 @@ public class PropertyAccessTests extends ExpressionTestCase {
@@ -65,9 +67,9 @@ public class PropertyAccessTests extends ExpressionTestCase {
@ -132,29 +134,36 @@ public class PropertyAccessTests extends ExpressionTestCase {
@@ -132,29 +134,36 @@ public class PropertyAccessTests extends ExpressionTestCase {