apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.23k stars 2.08k forks source link

split only in JDK1.4, not earlier #969

Closed asfimport closed 21 years ago

asfimport commented 21 years ago

J (Bug 14771): Being hit by https://github.com/apache/jmeter/issues/959 and https://github.com/apache/jmeter/issues/962, I tried to apply the suggested patch and recompile. javac complained in src/jorphan/org/apache/jorphan/test/AllTests.java:223 src/jorphan/org/apache/jorphan/collections/Data.java about an unknown method split of the String class String:split is only in JDK1.4 - yet you claim compatibility downto 1.2 or so.

Peeking around the sources, I found a workaround as follows. In both .java files, add: import org.apache.jmeter.util.JMeterUtils; Additionaly in Help.java: Iterator classes = ClassFinder.findClassesThatExtend(JMeterUtils.split(searchPaths,","), and in Data.java: setHeaders(JMeterUtils.split(contents[0],delimiter)); setLine(JMeterUtils.split(contents[x++],delimiter)); E.g. use split() from the JMeterUtils package

After doing so, I managed to compile using JDK1.3.1. After channging Help.java to say file:///..., I managed to start JMeter1.8 on MS-W2k.

Regards, Jörg Höhle. BTW, you ought to add version 1.8 to Bugzilla's selection options.

Version: Nightly Severity: minor OS: All

asfimport commented 21 years ago

Jordi Salvat i Alabart (migrated from Bugzilla): I've applied the proposed fix and checked it actually compiles and tests under JDK 1.3.

To avoid creating a dependency from jorphan into jmeter's JMeterUtils, I've created a new jorphan.util.JOrphanUtils to contain the split method, which I've removed from JMeterUtils. Looks like generic enough functionality to live within jorphan...

asfimport commented 21 years ago

Jordi Salvat i Alabart (migrated from Bugzilla): Bulk-editing to close all bugs reported fixed by 1.8.1.