History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: OGNL-14
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jesse Kuhnert
Reporter: Manri Offermann
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OGNL

Ternary expression, NPE

Created: 14/Mar/07 02:42 AM   Updated: 23/Mar/07 12:34 PM
Component/s: ExpressionCompiler
Affects Version/s: 2.7
Fix Version/s: 2.7

Environment:
Tapestry 4.1.2-SNAPSHOT (latest)
OGNL 2.7-SNAPSHOT


 Description  « Hide
The following throws a NPE in OGNL 2.7 but not in previous versions:

test.html:
<span jwcid="@Insert" value="ognl:(text1 == null) ? 'Empty' : text1.length()"/><br/>
<span jwcid="@Insert" value="ognl:(text2 == null) ? 'Empty' : text2.length()"/> <------- text2 is null

test.page:
<page-specification>
<property name="text1" initial-value="'text1'"/>
<property name="text2"/> <------- text2 is null
</page-specification>

exception:
java.lang.NullPointerException: target is null for method length
at ognl.OgnlRuntime.callMethod(OgnlRuntime.java:963)
at ognl.ASTMethod.getValueBody(ASTMethod.java:90)
etc.

Another thing I noticed is that:

<span jwcid="@Insert" value="ognl:(text1 == null) ? '1' : text1.length()"/><br/>

works for the previous OGNL, but not for 2.7


Best Regards,

Manri Offermann

 All   Comments   Change History      Sort Order:
Jesse Kuhnert - [23/Mar/07 12:34 PM ]
Should be fixed in release today.