提交 34a81b60 编写于 作者: J Juergen Hoeller

PropertyOrFieldReference defensively catches Exception instead of just AccessException

Issue: SPR-13247
上级 cad06651
......@@ -187,9 +187,9 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
try {
return accessorToUse.read(evalContext, contextObject.getValue(), name);
}
catch (AccessException ex) {
// this is OK - it may have gone stale due to a class change,
// let's try to get a new one and call it before giving up
catch (Exception ex) {
// This is OK - it may have gone stale due to a class change,
// let's try to get a new one and call it before giving up...
this.cachedReadAccessor = null;
}
}
......@@ -212,7 +212,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
}
}
}
catch (AccessException ex) {
catch (Exception ex) {
throw new SpelEvaluationException(ex, SpelMessage.EXCEPTION_DURING_PROPERTY_READ, name, ex.getMessage());
}
}
......@@ -238,9 +238,9 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
accessorToUse.write(evalContext, contextObject.getValue(), name, newValue);
return;
}
catch (AccessException ex) {
// this is OK - it may have gone stale due to a class change,
// let's try to get a new one and call it before giving up
catch (Exception ex) {
// This is OK - it may have gone stale due to a class change,
// let's try to get a new one and call it before giving up...
this.cachedWriteAccessor = null;
}
}
......@@ -291,7 +291,6 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
return false;
}
// TODO when there is more time, remove this and use the version in AstUtils
/**
* Determines the set of property resolvers that should be used to try and access a property
* on the specified target type. The resolvers are considered to be in an ordered list,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册