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 text was updated successfully, but these errors were encountered:
ebussieres
changed the title
MustacheEnvironmentCollector with nullValue compiler option no longer works
MustacheEnvironmentCollector with nullValue compiler option no longer works in version 2.3.1
Jun 20, 2020
Still, I think that something has been broken since the javadoc of the nullValue method specifies this :
/** Returns a compiler that will use the given value for any variable that resolves to
* null, but will still raise an exception for variables for which an accessor cannot be
* found. This is like {@link #defaultValue} except that it differentiates between missing
* accessors, and accessors that exist but return null.
* <ul>
* <li>In the case of a Java object being used as a context, if no field or method can be
* found for a variable, an exception will be raised.</li>
* <li>In the case of a {@link Map} being used as a context, if the map does not contain
* a mapping for a variable, an exception will be raised. If the map contains a mapping
* which maps to {@code null}, then {@code nullValue} is used.</li>
* </ul> */
In my case, the accessor does exist, so it shouldn't throw an error.
I've found a regression that is caused by #21060, Everything works with version 2.3.0 and it no longer works with version 2.3.1.
If you define the nullValue compiler option in mustache, it no longer works and throw an exception telling that the field is not found:
I've made a simple project with a test case to demonstrate it. It can be found here. https://github.com/ebussieres/regression-21060
The text was updated successfully, but these errors were encountered: