Bug 55158

Summary: Wasted work in AttributeNamesEnumerator constructor
Product: Tomcat 7 Reporter: Adrian Nistor <nistor1>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: nistor1
Priority: P2 Keywords: PatchAvailable
Version: 7.0.41   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: patch

Description Adrian Nistor 2013-06-29 18:55:30 UTC
Created attachment 30498 [details]
patch

The problem appears in version 7.0.41 and in revision 1497999.  I
attached a two-line patch  that fixes it.

In the "AttributeNamesEnumerator" constructor, the loop over
"specials" keeps overriding "last" with "i".  Therefore, only the last
written value is visible out of the loop and all the other writes and
iterations are not necessary.  The patch iterates from the end of
"specials" and breaks the first time when "last" is set.
Comment 1 Violeta Georgieva 2013-07-01 12:42:16 UTC
Thanks for the report.
Fix is in trunk and 7.0.x and will be included in 7.0.42 onwards.