Bug 14771

Summary: split only in JDK1.4, not earlier
Product: JMeter - Now in Github Reporter: J <Joerg-Cyril.Hoehle>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: CLOSED FIXED    
Severity: minor    
Priority: P3    
Version: Nightly (Please specify date)   
Target Milestone: ---   
Hardware: All   
OS: All   

Description J 2002-11-22 15:33:43 UTC
Being hit by bugs #13895 and #13995, 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.
Comment 1 Jordi Salvat i Alabart 2002-12-27 15:55:22 UTC
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...
Comment 2 Jordi Salvat i Alabart 2003-03-10 09:40:52 UTC
Bulk-editing to close all bugs reported fixed by 1.8.1.
Comment 3 The ASF infrastructure team 2022-09-24 20:37:28 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/969