Bug 55056 - wasted work in Data.append()
wasted work in Data.append()
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.9
PC Linux
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
: PatchAvailable
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-06-04 14:45 UTC by Adrian Nistor
Modified: 2013-06-04 15:59 UTC (History)
1 user (show)



Attachments
patch (530 bytes, patch)
2013-06-04 14:45 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-04 14:45:12 UTC
Created attachment 30386 [details]
patch

The problem appears in version 2.9 and in revision 1489451.  I
attached a one-line patch that fixes it.

In method "Data.append", the loop over "dHeaders" should break
immediately after "valid" is set to "false".  All the iterations after
"valid" is set to "false" do not perform any useful work, at best they
just set "valid" again to "false".

Method "include" in class "ClassFilter" has a similar loop (over
"pkgs"), and this loop breaks immediately after "inc" is set to
"true", just like in the proposed patch.  Other methods (e.g.,
"Copy.keepOnlyAncestors", "JMeterThread.getSampleListeners",
"HTTPSamplerBase.getSendParameterValuesAsPostBody",
"LogFilter.incFile") also have similar loops with similar breaks, just
like in the proposed patch.
Comment 1 Sebb 2013-06-04 15:59:54 UTC
Well spotted; thanks for the patch!

URL: http://svn.apache.org/r1489490
Log:
wasted work in Data.append()
Bugzilla Id: 55056

Modified:
    jmeter/trunk/src/jorphan/org/apache/jorphan/collections/Data.java
    jmeter/trunk/xdocs/changes.xml