-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Martin Frey opened SPR-12014 and commented
I just did a test run today with RC1 and an expression that was before does throw now an NPE during the evaluation.
I'm using Thymeleaf and the expression is using a "toplevel" variable cols which is optional and resolves to null in the current case.
${cols ?: 80}
In SPEL this resolves into the structure that i have attached as an image. As you can see the result is resolved properly, but the expression finally fails with an NPE in the class Elvis on line 59 as the testDescriptor is null at this point.
Probably it has something to do with the introduction of the class CompilablePropertyAccessor? I have found this code in the class PropertyOrFieldReference.
// line 366
if (ref.cachedReadAccessor instanceof CompilablePropertyAccessor) {
CompilablePropertyAccessor accessor = (CompilablePropertyAccessor)this.ref.cachedReadAccessor;
this.ref.exitTypeDescriptor = CodeFlow.toDescriptor(accessor.getPropertyType());
}
And on the Thymleaf side:
public class VariablesMapPropertyAccessor extends ReflectivePropertyAccessor {...}
Let me know if you need more info.
Affects: 4.1 RC1
Attachments:
- Screen Shot 2014-07-21 at 15.56.18.png (194.47 kB)
Referenced from: commits 4b09fcc