Bug 14771 - split only in JDK1.4, not earlier
Summary: split only in JDK1.4, not earlier
Status: CLOSED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: Nightly (Please specify date)
Hardware: All All
: P3 minor (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-22 15:33 UTC by J
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.