-
Bug
-
Resolution: Cannot Reproduce
-
P2
-
6u2
-
b01
-
x86
-
windows
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2150806 | 6u4 | Leonid Popov | P2 | Resolved | Fixed | b02 |
JDK-2152732 | OpenJDK6 | Sergey Malenkov | P3 | Resolved | Fixed | b03 |
Initially the synopsis was "JFileChooser's COM thread doesn't stop if a security manager installed", I changed it to reflect the actual issue better.
Run a simple test:
======================
import javax.swing.filechooser.FileSystemView;
public class bug6570445 {
public static void main(String[] args) throws Exception {
System.setSecurityManager(new SecurityManager());
// The next line of code forces FileSystemView to request data from Win32ShellFolder2,
// what causes an exception if a security manager installed
FileSystemView.getFileSystemView().getRoots();
System.out.println("Passed.");
}
}
======================
The test throws an exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.awt.shell.Win32ShellFolder2$ComTask.execute(Win32ShellFolder2.java:1228)
at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Win32ShellFolder2.java:559)
at sun.awt.shell.Win32ShellFolder2.composePathForCsidl(Win32ShellFolder2.java:213)
at sun.awt.shell.Win32ShellFolder2.<init>(Win32ShellFolder2.java:226)
at sun.awt.shell.Win32ShellFolderManager2.getDesktop(Win32ShellFolderManager2.java:87)
at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:187)
at sun.awt.shell.ShellFolder.get(ShellFolder.java:218)
at javax.swing.filechooser.FileSystemView.getRoots(FileSystemView.java:363)
at bug6570445.main(bug6570445.java:6)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission shutdownHooks)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.Runtime.addShutdownHook(Runtime.java:190)
at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor.<init>(Win32ShellFolder2.java:1169)
at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor.<clinit>(Win32ShellFolder2.java:1158)
... 9 more
Run a simple test:
======================
import javax.swing.filechooser.FileSystemView;
public class bug6570445 {
public static void main(String[] args) throws Exception {
System.setSecurityManager(new SecurityManager());
// The next line of code forces FileSystemView to request data from Win32ShellFolder2,
// what causes an exception if a security manager installed
FileSystemView.getFileSystemView().getRoots();
System.out.println("Passed.");
}
}
======================
The test throws an exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.awt.shell.Win32ShellFolder2$ComTask.execute(Win32ShellFolder2.java:1228)
at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Win32ShellFolder2.java:559)
at sun.awt.shell.Win32ShellFolder2.composePathForCsidl(Win32ShellFolder2.java:213)
at sun.awt.shell.Win32ShellFolder2.<init>(Win32ShellFolder2.java:226)
at sun.awt.shell.Win32ShellFolderManager2.getDesktop(Win32ShellFolderManager2.java:87)
at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:187)
at sun.awt.shell.ShellFolder.get(ShellFolder.java:218)
at javax.swing.filechooser.FileSystemView.getRoots(FileSystemView.java:363)
at bug6570445.main(bug6570445.java:6)
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission shutdownHooks)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.Runtime.addShutdownHook(Runtime.java:190)
at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor.<init>(Win32ShellFolder2.java:1169)
at sun.awt.shell.Win32ShellFolder2$ComTaskExecutor.<clinit>(Win32ShellFolder2.java:1158)
... 9 more
- backported by
-
JDK-2150806 Win32ShellFolder2 throws exceptions if security manager installed
- Resolved
-
JDK-2152732 Win32ShellFolder2 throws exceptions if security manager installed
- Resolved
- relates to
-
JDK-6491795 COM should be initialized for Shell API calls in ShellFolder2.cpp
- Closed