struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pelladi Gabor (Commented) (JIRA)" <>
Subject [jira] [Commented] (WW-3743) XWorkMapPropertyAccessor calls getProperty twice if the value is null
Date Tue, 17 Jan 2012 16:57:39 GMT


Pelladi Gabor commented on WW-3743:

I have tested it locally. I am developing a business application with struts2 frontend, related
to consumer loans, for banks.
To avoid modifying the original struts2 jar, I have done the following: I have created a copy
of XWorkMapPropertyAccessor class in my code, with the above modification. I have also created
a copy of struts-default.xml, and replaced the two occurrences of XWorkMapPropertyAccessor
with my modified class. In web.xml, I have configured StrutsPrepareAndExecuteFilter to use
my modified struts-default.xml.
I made sure using breakpoints that my class was used. The profiler also confirmed that OgnlValueStack.findString
was called less times. The application is working like before, at least me, the testers and
the customer did not notice any problems with this application.
> XWorkMapPropertyAccessor calls getProperty twice if the value is null
> ---------------------------------------------------------------------
>                 Key: WW-3743
>                 URL:
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Value Stack
>    Affects Versions:
>            Reporter: Pelladi Gabor
>            Priority: Minor
>              Labels: patch, performance
>             Fix For: 2.3.2
>         Attachments: WW-3743.diff
> If you evaluate an OGNL expression which has null value, XWorkMapPropertyAccessor does
the evaluation twice.
> First in line 81: result = super.getProperty(context, target, name);
> Second in line 91: return super.getProperty(context, target, name);
> Performance can be improved by removing the second evaluation.
> Line 91: return null;
> This saves an extra evaluation, and at this point we can be sure that the result can
only be null.
> Patch is attached.
> Please review it.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message