You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bugfix treats all null values as of type java.lang.Object (line 90 in org.springframework.expression.spel.ast.MethodReference). Unfortunately Spring can't find a matching method in this case, because generally Object can't be converted to any other type.
Simple example:
public class NullMethodParamConverterBug {
public Integer tryToInvokeWithNull(Integer value) {
return value;
}
org.springframework.expression.spel.SpelException: EL1003E:(pos 28): Method call: Method tryToInvokeWithNull(java.lang.Object) cannot be found on NullMethodParamConverterBug type
at org.springframework.expression.spel.ast.MethodReference.findAccessorForMethod(MethodReference.java:130)
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:76)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:54)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:51)
at org.springframework.expression.spel.SpelExpression.getValue(SpelExpression.java:66)
Oliver Becker opened SPR-5899 and commented
This is a follow-up of #10332
The bugfix treats all null values as of type java.lang.Object (line 90 in org.springframework.expression.spel.ast.MethodReference). Unfortunately Spring can't find a matching method in this case, because generally Object can't be converted to any other type.
Simple example:
public class NullMethodParamConverterBug {
}
and
#{nullMethodParamConverterBug.tryToInvokeWithNull(null)}
causes
org.springframework.expression.spel.SpelException: EL1003E:(pos 28): Method call: Method tryToInvokeWithNull(java.lang.Object) cannot be found on NullMethodParamConverterBug type
at org.springframework.expression.spel.ast.MethodReference.findAccessorForMethod(MethodReference.java:130)
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:76)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:54)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:51)
at org.springframework.expression.spel.SpelExpression.getValue(SpelExpression.java:66)
Affects: 3.0 M3
Referenced from: commits eb69e75
The text was updated successfully, but these errors were encountered: