JDK-8058503 : [macosx] JFileChooser is silently not shown if wrong string is passed to constructor
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7u10,8,9
  • Priority: P5
  • Status: Closed
  • Resolution: Not an Issue
  • OS: os_x
  • Submitted: 2014-09-15
  • Updated: 2022-07-11
  • Resolved: 2022-07-11
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.
Other
tbdResolved
Related Reports
Relates :  
Description
JFileChooser silently not shown if wrong string is passed to constructor

Good on Windows. (if "." - curdir is shown. if "some junk" - home user dir) 

Bad  on OS X.  JFrame is not shown at all! No exception is thrown!

Found with help of test  Swing_DnD/Automated/JFChooser2JTADnDTest

Run this code on OS X:

import java.awt.AWTException;
import java.awt.BorderLayout;
import javax.swing.CellRendererPane;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author ampopov
 */
public class NewClass {

    static CellRendererPane crp;
    static JComponent c45;

    public static void main(String[] args) throws AWTException, InterruptedException, ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        JFrame f = new JFrame();

        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JFileChooser jfc = new JFileChooser(".");
        jfc.setDragEnabled(true);
        JPanel p = new JPanel();
        p.add(jfc);
        f.add(p, BorderLayout.NORTH);
        f.add(new JButton("dffd"));
        f.pack();
        f.setVisible(true);       
        
    }
}
Comments
Should be called in EDT
11-07-2022

ok
05-12-2016

What exception? All swing components should be accessed on EDT, otherwise behavior is undefined. This CR is open to investigate a possibility to workaround this deadlock, but the test should be rewritten anyway
23-09-2014

But why there is no any exception?
16-09-2014

Bug is in the test. The swing component is accessed on non-EDT thread.
15-09-2014

Full thread dump Java HotSpot(TM) 64-Bit Server VM (1.8.0-internal-serb_2014_09_15_21_18-b00 mixed mode): "Aqua L&F File Loading Thread" #19 prio=5 os_prio=31 tid=0x00007fd75e8fc800 nid=0xdb03 waiting for monitor entry [0x0000000133a9c000] java.lang.Thread.State: BLOCKED (on object monitor) at com.apple.laf.AquaFileSystemModel$LoadFilesThread.run(AquaFileSystemModel.java:426) - waiting to lock <0x000000076b5949a8> (a java.lang.Object) "AWT-EventQueue-0" #15 prio=6 os_prio=31 tid=0x00007fd75e0aa800 nid=0xd507 waiting for monitor entry [0x00000001336e1000] java.lang.Thread.State: BLOCKED (on object monitor) at java.awt.Component.invalidate(Component.java:2990) - waiting to lock <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.invalidate(Container.java:1606) at javax.swing.JComponent.revalidate(JComponent.java:4897) at javax.swing.JTable.tableRowsInserted(JTable.java:4507) at javax.swing.JTable.tableChanged(JTable.java:4432) at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:297) at javax.swing.table.AbstractTableModel.fireTableRowsInserted(AbstractTableModel.java:232) at com.apple.laf.AquaFileSystemModel$DoChangeContents.run(AquaFileSystemModel.java:464) - locked <0x000000076b5949a8> (a java.lang.Object) - locked <0x000000076bbbbce0> (a java.lang.Object) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:752) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:705) at java.awt.EventQueue$3.run(EventQueue.java:699) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:722) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:115) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:104) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:100) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92) at java.awt.EventDispatchThread.run(EventDispatchThread.java:81) "Java2D Disposer" #14 daemon prio=10 os_prio=31 tid=0x00007fd75e8a5800 nid=0xce03 in Object.wait() [0x000000013312a000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x000000076b2a4090> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143) - locked <0x000000076b2a4090> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164) at sun.java2d.Disposer.run(Disposer.java:149) at java.lang.Thread.run(Thread.java:745) "Java2D Queue Flusher" #13 daemon prio=10 os_prio=31 tid=0x00007fd75f01c000 nid=0xc107 in Object.wait() [0x0000000131df3000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x000000076b2a0e90> (a sun.java2d.opengl.OGLRenderQueue$QueueFlusher) at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203) - locked <0x000000076b2a0e90> (a sun.java2d.opengl.OGLRenderQueue$QueueFlusher) "AWT-Shutdown" #12 prio=5 os_prio=31 tid=0x00007fd75f83b800 nid=0x820f in Object.wait() [0x000000012f1e1000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x000000076b01f5f0> (a java.lang.Object) at java.lang.Object.wait(Object.java:502) at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:295) - locked <0x000000076b01f5f0> (a java.lang.Object) at java.lang.Thread.run(Thread.java:745) "AppKit Thread" #11 daemon prio=5 os_prio=31 tid=0x00007fd75d94f000 nid=0xd07 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Monitor Ctrl-Break" #10 daemon prio=5 os_prio=31 tid=0x00007fd75e805000 nid=0x5b03 runnable [0x000000012d69c000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at java.net.SocketInputStream.read(SocketInputStream.java:170) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178) - locked <0x000000076aee2188> (a java.io.InputStreamReader) at java.io.InputStreamReader.read(InputStreamReader.java:184) at java.io.BufferedReader.fill(BufferedReader.java:161) at java.io.BufferedReader.readLine(BufferedReader.java:324) - locked <0x000000076aee2188> (a java.io.InputStreamReader) at java.io.BufferedReader.readLine(BufferedReader.java:389) at com.intellij.rt.execution.application.AppMain$1.run(AppMain.java:88) at java.lang.Thread.run(Thread.java:745) "Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007fd75b80c000 nid=0x5703 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C1 CompilerThread3" #8 daemon prio=9 os_prio=31 tid=0x00007fd75f000000 nid=0x5503 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread2" #7 daemon prio=9 os_prio=31 tid=0x00007fd75d824000 nid=0x5303 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread1" #6 daemon prio=9 os_prio=31 tid=0x00007fd75d815000 nid=0x5103 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread0" #5 daemon prio=9 os_prio=31 tid=0x00007fd75d814800 nid=0x4f03 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fd75d822800 nid=0x4d03 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fd75e800000 nid=0x3903 in Object.wait() [0x000000012cae0000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x000000076ab08a48> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143) - locked <0x000000076ab08a48> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209) "Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fd75c808800 nid=0x3703 in Object.wait() [0x000000012c9dd000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x000000076ab06760> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:502) at java.lang.ref.Reference.tryHandlePending(Reference.java:191) - locked <0x000000076ab06760> (a java.lang.ref.Reference$Lock) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153) "main" #1 prio=5 os_prio=31 tid=0x00007fd75e000000 nid=0x1903 waiting for monitor entry [0x00000001110a7000] java.lang.Thread.State: BLOCKED (on object monitor) at com.apple.laf.AquaFileSystemModel.getRowCount(AquaFileSystemModel.java:195) - waiting to lock <0x000000076b5949a8> (a java.lang.Object) at javax.swing.JTable.getRowCount(JTable.java:2685) at javax.swing.plaf.basic.BasicTableUI.createTableSize(BasicTableUI.java:1730) at javax.swing.plaf.basic.BasicTableUI.getPreferredSize(BasicTableUI.java:1771) at javax.swing.JComponent.getPreferredSize(JComponent.java:1664) at javax.swing.ScrollPaneLayout.preferredLayoutSize(ScrollPaneLayout.java:499) at java.awt.Container.preferredSize(Container.java:1815) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.getPreferredSize(Container.java:1799) at javax.swing.JComponent.getPreferredSize(JComponent.java:1666) at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:724) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.preferredSize(Container.java:1815) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.getPreferredSize(Container.java:1799) at javax.swing.JComponent.getPreferredSize(JComponent.java:1666) at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:724) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.preferredSize(Container.java:1815) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.getPreferredSize(Container.java:1799) at javax.swing.JComponent.getPreferredSize(JComponent.java:1666) at javax.swing.BoxLayout.checkRequests(BoxLayout.java:485) at javax.swing.BoxLayout.layoutContainer(BoxLayout.java:426) - locked <0x000000076b441388> (a javax.swing.BoxLayout) at java.awt.Container.layout(Container.java:1529) at java.awt.Container.doLayout(Container.java:1518) at java.awt.Container.validateTree(Container.java:1714) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validate(Container.java:1649) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.validateUnconditionally(Container.java:1686) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Window.pack(Window.java:818) at NewClass.main(NewClass.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) "VM Thread" os_prio=31 tid=0x00007fd75e062000 nid=0x3503 runnable "GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fd75e00d000 nid=0x2503 runnable "GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fd75e00e000 nid=0x2703 runnable "GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fd75e00e800 nid=0x2903 runnable "GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fd75e00f000 nid=0x2b03 runnable "GC task thread#4 (ParallelGC)" os_prio=31 tid=0x00007fd75e00f800 nid=0x2d03 runnable "GC task thread#5 (ParallelGC)" os_prio=31 tid=0x00007fd75e010800 nid=0x2f03 runnable "GC task thread#6 (ParallelGC)" os_prio=31 tid=0x00007fd75e011000 nid=0x3103 runnable "GC task thread#7 (ParallelGC)" os_prio=31 tid=0x00007fd75e011800 nid=0x3303 runnable "VM Periodic Task Thread" os_prio=31 tid=0x00007fd75b8b6800 nid=0x5903 waiting on condition JNI global references: 539 Found one Java-level deadlock: ============================= "Aqua L&F File Loading Thread": waiting to lock monitor 0x00007fd75c87c7c8 (object 0x000000076b5949a8, a java.lang.Object), which is held by "AWT-EventQueue-0" "AWT-EventQueue-0": waiting to lock monitor 0x00007fd75c87b5e8 (object 0x000000076b28cce8, a java.awt.Component$AWTTreeLock), which is held by "main" "main": waiting to lock monitor 0x00007fd75c87c7c8 (object 0x000000076b5949a8, a java.lang.Object), which is held by "AWT-EventQueue-0" Java stack information for the threads listed above: =================================================== "Aqua L&F File Loading Thread": at com.apple.laf.AquaFileSystemModel$LoadFilesThread.run(AquaFileSystemModel.java:426) - waiting to lock <0x000000076b5949a8> (a java.lang.Object) "AWT-EventQueue-0": at java.awt.Component.invalidate(Component.java:2990) - waiting to lock <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.invalidate(Container.java:1606) at javax.swing.JComponent.revalidate(JComponent.java:4897) at javax.swing.JTable.tableRowsInserted(JTable.java:4507) at javax.swing.JTable.tableChanged(JTable.java:4432) at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:297) at javax.swing.table.AbstractTableModel.fireTableRowsInserted(AbstractTableModel.java:232) at com.apple.laf.AquaFileSystemModel$DoChangeContents.run(AquaFileSystemModel.java:464) - locked <0x000000076b5949a8> (a java.lang.Object) - locked <0x000000076bbbbce0> (a java.lang.Object) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:752) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:705) at java.awt.EventQueue$3.run(EventQueue.java:699) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:722) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:115) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:104) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:100) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92) at java.awt.EventDispatchThread.run(EventDispatchThread.java:81) "main": at com.apple.laf.AquaFileSystemModel.getRowCount(AquaFileSystemModel.java:195) - waiting to lock <0x000000076b5949a8> (a java.lang.Object) at javax.swing.JTable.getRowCount(JTable.java:2685) at javax.swing.plaf.basic.BasicTableUI.createTableSize(BasicTableUI.java:1730) at javax.swing.plaf.basic.BasicTableUI.getPreferredSize(BasicTableUI.java:1771) at javax.swing.JComponent.getPreferredSize(JComponent.java:1664) at javax.swing.ScrollPaneLayout.preferredLayoutSize(ScrollPaneLayout.java:499) at java.awt.Container.preferredSize(Container.java:1815) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.getPreferredSize(Container.java:1799) at javax.swing.JComponent.getPreferredSize(JComponent.java:1666) at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:724) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.preferredSize(Container.java:1815) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.getPreferredSize(Container.java:1799) at javax.swing.JComponent.getPreferredSize(JComponent.java:1666) at java.awt.BorderLayout.preferredLayoutSize(BorderLayout.java:724) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.preferredSize(Container.java:1815) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.getPreferredSize(Container.java:1799) at javax.swing.JComponent.getPreferredSize(JComponent.java:1666) at javax.swing.BoxLayout.checkRequests(BoxLayout.java:485) at javax.swing.BoxLayout.layoutContainer(BoxLayout.java:426) - locked <0x000000076b441388> (a javax.swing.BoxLayout) at java.awt.Container.layout(Container.java:1529) at java.awt.Container.doLayout(Container.java:1518) at java.awt.Container.validateTree(Container.java:1714) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validateTree(Container.java:1723) at java.awt.Container.validate(Container.java:1649) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Container.validateUnconditionally(Container.java:1686) - locked <0x000000076b28cce8> (a java.awt.Component$AWTTreeLock) at java.awt.Window.pack(Window.java:818) at NewClass.main(NewClass.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Found 1 deadlock.
15-09-2014