Hi!
The patch does:
- remove redundant OS calls (e.g. VMFile.exists());
- optimize list[Files](filter); and
- handle correctly various Win32/DOS path formats (like "\", "\relpath", "c:",
"\c:", "c:\", "\c:\", "c:relpath", "\c:relpath", "file:stream", "c:\path",
"\c:\path", "\\server\share", "\\server\share\", "\\server\share\path") and,
even, NetWare path formats ("\\server\volume:", "\\server\volume:\",
"\\server\volume:path", "\\server\volume:\path", "volume:", "volume:\",
"volume:path", "volume:\path").
ChangeLog entries:
* java/io/File.java:
(canRead()): Call checkRead().
(canRead()): comment out VMFile.exists() call (since redundant
according to the specification of the corresponding VMFile function).
(canWrite()): Likewise.
(canExecute()): Likewise.
(setReadOnly()): Likewise.
(normalizePath(String)): Make private method static; convert the
comment to the documentational one.
(normalizePath(String)): Use isDriveLetter().
(getCanonicalPath()): Likewise.
(normalizePath(String)): Handle various Windows paths correctly.
(File(String,String)): Likewise.
(getParent()): Likewise.
(isDriveLetter(char)): New private method.
(File(String,String)): Refine the documentation.
(isAbsolute()): Likewise.
(File(String,String)): Document NPE.
(File(String,String)): Don't append '/' if the path is already
terminated with it.
(toURI()): Likewise.
(getParent()): Use PlatformHelper.beginWithRootPathPrefix(); update
the comments.
(list(FilenameFilter)): Remove exists() call; call
VMFile.isDirectory() instead of isDirectory() and only if
VMFile.list() returns null.
(list(FilenameFilter)): Don't create a copy of the resulting array if
no file names are filtered out.
(listFiles(FileFilter)): Likewise.
(toURI()): Handle Windows UNC paths.
(createTempFile(String,String,File)): Insert a space between message
parts of the thrown IllegalArgumentException.
Regards.
classpath-ivmai-35.diff
Description: Binary data
