-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
6u16
-
x86
-
windows_xp
FULL PRODUCT VERSION :
jdk6 version 16
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP Professional Version 2002 Service Pack 3, 32bit English
A DESCRIPTION OF THE PROBLEM :
javax.swing.filechooser.FileSystemView's isDrive() function is bugged. Returns always true for all computerChildren's children even they are not a drive such as "My Documents" folder etc.
javax.swing.filechooser.FileSystemView's isComputerNode() function is bugged. Returns always false, even the node is "My Computer" node.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.swing.filechooser.FileSystemView;
public class Test {
public static void main(String[] args) {
FileSystemView systemView = FileSystemView.getFileSystemView();
File desktop[] = systemView.getRoots();
File desktopFiles[] = desktop[0].listFiles();
File computerNode = desktopFiles[0]; // Windows XP's my computer node
if (systemView.isComputerNode(computerNode)) {
//isComputer is bugged. Returns always false.
System.out.println("It says this IS 'My Computer' node: " + computerNode.getPath());
}else {
System.out.println("It says this IS NOT 'My Computer' node: " + computerNode.getPath());
//::{20D04FE0-3AEA-1069-A2D8-08002B30309D} copy the path see what happens in Windows Explorer
}
File computerChildren[] = computerNode.listFiles();
for (int i = 0; i < computerChildren.length; i++) {
// isDrive is bugged. Returns always true for computerChildren's children
if (systemView.isDrive(computerChildren[i])) {
System.err.println(computerChildren[i] + " is a drive? 'YES' it says");
} else {
System.err.println(computerChildren[i] + " is a drive? 'NO' it says");
}
}
}
}
---------- END SOURCE ----------
jdk6 version 16
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP Professional Version 2002 Service Pack 3, 32bit English
A DESCRIPTION OF THE PROBLEM :
javax.swing.filechooser.FileSystemView's isDrive() function is bugged. Returns always true for all computerChildren's children even they are not a drive such as "My Documents" folder etc.
javax.swing.filechooser.FileSystemView's isComputerNode() function is bugged. Returns always false, even the node is "My Computer" node.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.File;
import javax.swing.filechooser.FileSystemView;
public class Test {
public static void main(String[] args) {
FileSystemView systemView = FileSystemView.getFileSystemView();
File desktop[] = systemView.getRoots();
File desktopFiles[] = desktop[0].listFiles();
File computerNode = desktopFiles[0]; // Windows XP's my computer node
if (systemView.isComputerNode(computerNode)) {
//isComputer is bugged. Returns always false.
System.out.println("It says this IS 'My Computer' node: " + computerNode.getPath());
}else {
System.out.println("It says this IS NOT 'My Computer' node: " + computerNode.getPath());
//::{20D04FE0-3AEA-1069-A2D8-08002B30309D} copy the path see what happens in Windows Explorer
}
File computerChildren[] = computerNode.listFiles();
for (int i = 0; i < computerChildren.length; i++) {
// isDrive is bugged. Returns always true for computerChildren's children
if (systemView.isDrive(computerChildren[i])) {
System.err.println(computerChildren[i] + " is a drive? 'YES' it says");
} else {
System.err.println(computerChildren[i] + " is a drive? 'NO' it says");
}
}
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-6829543 FileSystemView isComputerNode and other is* methods do not work.
- Open