Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace System.getProperty("file.separator") with File.separator throughout #3493

Closed
asfimport opened this issue Dec 4, 2014 · 1 comment

Comments

@asfimport
Copy link
Collaborator

Sebb (Bug 57310):
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

Severity: normal
OS: Mac OS X 10.4

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
URL: http://svn.apache.org/r1643364
Log:
Replace System.getProperty("file.separator") with File.separator throughout (Also "path.separator" with File.pathSeparator)
#3493

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant