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 258101 - NbAuthenticator.getPasswordAuthentication should be thread-safe
Summary: NbAuthenticator.getPasswordAuthentication should be thread-safe
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Keyring (show other bugs)
Version: 8.1
Hardware: PC Windows 7 x64
: P3 normal with 1 vote (vote)
Assignee: Libor Fischmeistr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-22 17:12 UTC by matvei
Modified: 2018-02-08 09:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matvei 2016-02-22 17:12:34 UTC
If the first network request that requires authentication is created off the EDT, the NbAuthenticatorPanel and all of its Swing components will also be constructed and initialized off the EDT. The panel would be constructed via the following call chain:

java.net.Authenticator.requestPasswordAuthentication(...) ->
org.netbeans.core.NbAuthenticator.getPasswordAuthentication() ->
org.netbeans.core.NbAuthenticatorPanel.<init>

Constructing Swing components off the EDT may cause unintended side effects (e.g. Nimbus PLAF's UIManager has race conditions related to constructing Swing components in this way) and should be avoided.

More generally, NbAuthenticator.getPasswordAuthentication() should be thread-safe and callable from any thread, since Java's Authenticator has no restrictions on its use from any/multiple threads.
Comment 1 guai 2018-02-08 09:26:17 UTC
It seems I have the same problem. The user reports that netbeans ide's GUI is frozen on start. In the thread dump I see this java.net.Authenticator.requestPasswordAuthentication call in some thread, but there is no credentials dialog.
User have some http proxy with windows' authentication mechanism, I think.

Is there a way to workaround this bug? Set the password via system properties for example so there would be no need for dialog.

Its netbeans 8.2 with some our custom modules