Bug 55158 - Wasted work in AttributeNamesEnumerator constructor
Wasted work in AttributeNamesEnumerator constructor
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
PC Linux
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
: PatchAvailable
Depends on:
  Show dependency tree
Reported: 2013-06-29 18:55 UTC by Adrian Nistor
Modified: 2013-07-01 12:42 UTC (History)
1 user (show)

patch (771 bytes, patch)
2013-06-29 18:55 UTC, Adrian Nistor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Nistor 2013-06-29 18:55:30 UTC
Created attachment 30498 [details]

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.