JDK-6442847 : j2se/src/solaris/classes/java/io/UnixFileSystem.java ignores file.separator property
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-23
  • Updated: 2012-01-11
  • Resolved: 2006-06-27
Related Reports
Duplicate :  
Description
I'm trying to write a test to expose a problem in javac on Windows.

The broken code in javac was something like:

  dirname + "/" + basename

This was changed to:

  new File(dirname, basename).getPath();

I'm then trying to verify the change by running a test program like this:

  java -Dfile.separator='!' TestProgram

However, the File constructor uses UnixFileSystem.normalize which ignores
the value of UnixFileSystem.slash.  Consequently, my test fails.

Comments
EVALUATION As far as java.io is concerned, file.separator is considered a read-only system property. RFE 4165411 requests that we identify all of these properties.
27-06-2006