luomuqinghan / weibo4j

Automatically exported from code.google.com/p/weibo4j
Other
0 stars 1 forks source link

thread blocking hint should be avoided #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
if you have an unkown browser like "chromium" installed, the codes of 
BareBonesBrowserLaunch.java cannot recognize it, hence an exception will be 
thrown.

[code]
    public static void openURL(String url) {
        try {
            browse(url);
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Error attempting to launch web browser:\n" + e.getLocalizedMessage());
        }
    }
[/code]

What is the expected output? What do you see instead?
the exception should keep in silent mode, but it launches a heavy 
JOptionPane.showMessageDialog(...) which blocked the main thread.
The user cannot type the pin code if he/she don't close that exception dialog.

[code]              BareBonesBrowserLaunch.openURL(requestToken.getAuthorizationURL());
System.out.print("Hit enter when it's done.[Enter]:");
[/code]

What version of the product are you using? On what operating system?
OS: Ubuntu 10.10 

Please provide any additional information below.

Original issue reported on code.google.com by syncforw...@gmail.com on 30 Sep 2011 at 1:29