This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197736 - Dialog must be display within 10 seconds or DialogDisplayer.getDefault().notify will return incorrect result
Summary: Dialog must be display within 10 seconds or DialogDisplayer.getDefault().noti...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Geertjan Wielenga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-14 11:22 UTC by ibeaumont
Modified: 2011-04-14 11:22 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ibeaumont 2011-04-14 11:22:41 UTC
Can we update the documentation on the method 
DialogDisplayer.getDefault().notify

It says "and will block the caller's thread".  However, if this call is being made from a non Event Dispatch Thread and the dialog takes longer than 10 seconds to initialise then it will return NotifyDescriptor.CLOSED_OPTION and the thread will not block, but the dialog will still appear.

...see this code in DialogDisplayerImpl
       synchronized (query) {
            javax.swing.SwingUtilities.invokeLater (query);
            try {
                query.wait (10000);
            } catch (InterruptedException ex) {
                // ok, should not happen and does not matter
            }
            
            if (query.running) {
                while (query.result == null) {
                    try {
                        query.wait ();
                    } catch (InterruptedException ex) {
                        // one more round
                    }
                }
                return query.result;
            } else {
                return NotifyDescriptor.CLOSED_OPTION;
            }
        }



"You have 10 seconds to make this dialog appear or it will self destruct".