struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (WW-4116) Wasted work in PackageBasedActionConfigBuilder.checkPackageLocators()
Date Thu, 20 Jun 2013 07:09:24 GMT

     [ https://issues.apache.org/jira/browse/WW-4116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart resolved WW-4116.
-------------------------------

    Resolution: Fixed

Patch applied, thanks!
                
> Wasted work in PackageBasedActionConfigBuilder.checkPackageLocators()
> ---------------------------------------------------------------------
>
>                 Key: WW-4116
>                 URL: https://issues.apache.org/jira/browse/WW-4116
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    Affects Versions: 2.3.14.3
>         Environment: any
>            Reporter: Adrian Nistor
>            Assignee: Lukasz Lenart
>              Labels: patch, performance
>             Fix For: 2.3.16
>
>         Attachments: patch.diff, patchFull.diff
>
>
> The problem appears in version 2.3.14.3 and in revision 1493157.  I
> attached a two-line patch (patch.diff) that fixes it.
> In method "PackageBasedActionConfigBuilder.checkPackageLocators", the
> loop over "packageLocators" should only be executed when
> "classPackageName.length() > 0" is "true", because the loop's only
> side effect (the "return true;" statement) cannot be executed when
> "classPackageName.length() > 0" is "false".  Note that
> "classPackageName" is not modified inside the loop.
> In fact, the loop over "packageLocators" should be executed only when
> the condition of the loop's "if":
> {code:java|borderStyle=solid}
> if (classPackageName.length() > 0
>         && (packageLocatorsBasePackage == null || classPackageName
>         .startsWith(packageLocatorsBasePackage)))
> {code}
> is "true", because the loop's only side effect (the "return true;"
> statement) cannot be executed when this condition is false.  Also, the
> elements inside this condition are not modified inside the loop.  I
> attached a second patch (patchFull.diff) that implements this complete
> solution.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message