JDK-4239752 : FileSystem should be a platform-specific class to avoid native code
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6
  • CPU: generic
  • Submitted: 1999-05-19
  • Updated: 2012-12-25
  • Resolved: 2012-10-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b64Fixed
Related Reports
Relates :  
Description
Subject: Re: FileSystem.getFileSystem()
   Date: Wed, 19 May 1999 15:09:40 -0700
   From: Mark Reinhold <###@###.###>
     To: Dean Long <###@###.###>

> Mark, is there any reason why this couldn't be a Java method that did
> Class.forName/newInstance on a "filesystem.class" property, similar
> to AWT's "awt.toolkit" and java.net's "impl.prefix"?  It would be one
> less native method.  If "impl.prefix" is not meant to be java.net only,
> then I suppose you could also use it as "java.io." + impl_prefix +
> "FileSystem" to get the filesystem class.

Actually we can do even better than that by having the platform-specific
filesystem class just be named java.io.FileSystem in the first place and doing
away with the indirection.  It's a pretty simple set of changes.  File an RFE
and I'll assign someone to do it for Kestrel fcs (it's too late for beta).

- Mark


dean.long@Eng 1999-05-19

If we make this class platform-specific, then I think that we can also
make all the methods static and avoid making an instance of it.

In addition, it would be nice if platform-specific class naming (java.*
vs. sun.*) and lookup (native method vs. property vs. Java file in
src/<platform>/classes) was handled consistently.  For example, consider
the different ways Runtime.execInternal gets a platform Process,
Toolkit.getDefaultToolkit() gets a platform Toolkit, InetAddress and
DatagramSocket get a InetAdressImpl and DatagramSocketImpl.
There are probably more examples, and they are probably all different.

dean.long@Eng 1999-05-21

Comments
The fix has been uploaded at, http://cr.openjdk.java.net/~dxu/4239752/webrev/, for review.
25-10-2012