[
https://issues.apache.org/jira/browse/SLING-2934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Carsten Ziegeler resolved SLING-2934.
-------------------------------------
Resolution: Fixed
Fix Version/s: Scripting JSP 2.0.30
Assignee: Carsten Ziegeler
Thanks for your patch, it's applied
> Wasted work in ValidateVisitor.checkXmlAttributes()
> ---------------------------------------------------
>
> Key: SLING-2934
> URL: https://issues.apache.org/jira/browse/SLING-2934
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Environment: any
> Reporter: Adrian Nistor
> Assignee: Carsten Ziegeler
> Labels: patch, performance
> Fix For: Scripting JSP 2.0.30
>
> Attachments: patch.diff
>
>
> The problem appears in version 6 and in revision 1495454. I attached
> a one-line patch that fixes it.
> In method "ValidateVisitor.checkXmlAttributes", the loop over "nodes"
> should break immediately after "elExpression" and
> "deferredValueIsLiteral" are set to "true". All the iterations after
> "elExpression" and "deferredValueIsLiteral" are set to "true" do not
> perform any useful work, at best they just set "elExpression" and
> "deferredValueIsLiteral" again to "true".
> Method "isLive" in class "ResourceResolverContext" has a similar loop
> (over "dynamicProviders"), and this loop breaks immediately after
> "result" is set to "false", just like in the proposed patch. Other
> methods (e.g., "FactoryPreconditions.checkPreconditions",
> "JspUtil.checkAttributes", "EclipseJavaCompiler.compile",
> "SecondPassVisitor.appendPageDirective") also have similar loops with
> similar breaks, just like in the proposed patch.
--
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