Bug 57310 - Replace System.getProperty("file.separator") with File.separator throughout
Summary: Replace System.getProperty("file.separator") with File.separator throughout
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.12
Hardware: PC Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-04 14:19 UTC by Sebb
Modified: 2014-12-05 17:33 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebb 2014-12-04 14:19:53 UTC
Most of JMeter uses File.separator, but there are a few instances of System.getProperty("file.separator")

The two can be different, but still allow the JVM to start up.
I found the following worked:

java -Dfile.separator=/xyz

for Unix or the equivalent \xyz on Windows.

Using a different first character does not work - the JVM usually throws an exception as it cannot find some required files if the sep. is incorrect.

It looks like only the first character of the property is used by the JVM. However, this is not done by the application code I have seen, which means that there could be a discrepancy between the two methods.

File.separator has the additional benefit that it is not subject to a privilege check.

The same applies to "path.separator" => File.pathSeparator
Comment 1 Sebb 2014-12-05 17:33:56 UTC
URL: http://svn.apache.org/r1643364
Log:
Replace System.getProperty("file.separator") with File.separator throughout (Also "path.separator" with File.pathSeparator)
Bugzilla Id: 57310

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/NewDriver.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/FileDialoger.java
    jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
    jmeter/trunk/xdocs/changes.xml