struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-3743) XWorkMapPropertyAccessor calls getProperty twice if the value is null
Date Tue, 17 Jan 2012 19:04:40 GMT

    [ https://issues.apache.org/jira/browse/WW-3743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187890#comment-13187890
] 

Hudson commented on WW-3743:
----------------------------

Integrated in Struts2 #408 (See [https://builds.apache.org/job/Struts2/408/])
    WW-3743 - removes unnecessary second call to getProperty() and removes some unused code

lukaszlenart : 
Files : 
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessor.java

                
> XWorkMapPropertyAccessor calls getProperty twice if the value is null
> ---------------------------------------------------------------------
>
>                 Key: WW-3743
>                 URL: https://issues.apache.org/jira/browse/WW-3743
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Value Stack
>    Affects Versions: 2.3.1.1
>            Reporter: Pelladi Gabor
>            Assignee: Lukasz Lenart
>            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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message