< prev index next >
src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
Print this page
rev 17535 : Fixed bug 8175015: FileSystemView.isDrive(File) memory leak on "C:\" file
reference.
*** 441,471 ****
}
public boolean isFileSystemRoot(File dir) {
//Note: Removable drives don't "exist" but are listed in "My Computer"
if (dir != null) {
! Win32ShellFolder2 drives = getDrives();
if (dir instanceof Win32ShellFolder2) {
Win32ShellFolder2 sf = (Win32ShellFolder2)dir;
! if (sf.isFileSystem()) {
! if (sf.parent != null) {
! return sf.parent.equals(drives);
! }
! // else fall through ...
! } else {
! return false;
! }
}
String path = dir.getPath();
if (path.length() != 3 || path.charAt(1) != ':') {
return false;
}
! File[] files = drives.listFiles();
! return files != null && Arrays.asList(files).contains(dir);
}
return false;
}
private static List<Win32ShellFolder2> topFolderList = null;
--- 441,466 ----
}
public boolean isFileSystemRoot(File dir) {
//Note: Removable drives don't "exist" but are listed in "My Computer"
if (dir != null) {
!
if (dir instanceof Win32ShellFolder2) {
Win32ShellFolder2 sf = (Win32ShellFolder2)dir;
!
! return (sf.isFileSystem() && sf.parent != null &&
! sf.parent.equals(Win32ShellFolder2.listRoots()));
}
String path = dir.getPath();
if (path.length() != 3 || path.charAt(1) != ':') {
return false;
}
! File[] roots = Win32ShellFolder2.listRoots();
! return roots != null && Arrays.asList(roots).contains(dir);
}
return false;
}
private static List<Win32ShellFolder2> topFolderList = null;
< prev index next >