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 271688

Summary: Netbeans freezes when showing any refactor dialog when running with jdk 1.8.0_152-b16 or later
Product: java Reporter: SirIntellegence
Component: RefactoringAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal CC: oyarzun
Priority: P1    
Version: 8.2   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

Description SirIntellegence 2017-10-23 16:26:59 UTC
This makes it impossible to refactor on a Mac when the refactor logic shows a dialog.
It appears that a lock is obtained on a panel when the dialog is shown, and the AppKit Thread tries to get the lock while trying to add an accessible listener to it.

EDT Stack Trace:
Hidden Source Calls	
Unsafe.park	
LockSupport.park:175	
AbstractQueuedSynchronizer$ConditionObject.await:2039	
EventQueue.getNextEvent:554	
EventDispatchThread.pumpOneEventForFilters:170	
EventDispatchThread.pumpEventsForFilter:116	
EventDispatchThread.pumpEventsForFilter:109	
WaitDispatchSupport$2.run:190	
WaitDispatchSupport$4.run:235	
WaitDispatchSupport$4.run:233	
AccessController.doPrivileged	
WaitDispatchSupport.enter:233	
Dialog.show:1084	
Hidden Source Calls	
NbPresenter.superShow:1086	
NbPresenter.doShow:1136	
NbPresenter.run:1108	
NbPresenter.run:131	
NbMutexEventProvider$Event.doEventAccess:138	
NbMutexEventProvider$Event.readAccess:98	
LazyMutexImplementation.readAccess:94	
Mutex.readAccess:218	
NbPresenter.show:1093	
Component.show:1671	
Component.setVisible:1623	
Window.setVisible:1014	
Dialog.setVisible:1005	
Hidden Source Calls	
ParametersPanel.showDialog:699	
RefactoringPanel.refresh:685	
RefactoringPanel.<init>:169	
UI.openRefactoringUI:86	
ContextAnalyzer$4.show:671	
ContextAnalyzer$TextComponentTask.run:392	
UIUtilities.lambda$runWhenScanFinished$0:1211	
539873605.run	
ScanDialog.runWhenScanFinished:145	
UIUtilities.runWhenScanFinished:1206	
RefactoringActionsProvider.doFullRename:153	
RefactoringActionsProvider.doRename:100	
ActionsImplementationFactory.doRename:91	
RenameAction.performAction:77	
RefactoringGlobalAction$ContextAction.actionPerformed:197	
InstantRenamePerformer.doFullRename:284	
InstantRenamePerformer.invokeInstantRename:267	
InstantRenameAction.actionPerformed:62	
BaseAction.actionPerformed:347	
SwingUtilities.notifyAction:1663	
JComponent.processKeyBinding:2882	
JComponent.processKeyBindings:2929	
JComponent.processKeyEvent:2845	
Component.processEvent:6310	
Container.processEvent:2237	
Component.dispatchEventImpl:4889	
Container.dispatchEventImpl:2295	
Component.dispatchEvent:4711	
KeyboardFocusManager.redispatchEvent:1954	
DefaultKeyboardFocusManager.dispatchKeyEvent:806	
DefaultKeyboardFocusManager.preDispatchKeyEvent:1074	
DefaultKeyboardFocusManager.typeAheadAssertions:945	
DefaultKeyboardFocusManager.dispatchEvent:771	
Component.dispatchEventImpl:4760	
Container.dispatchEventImpl:2295	
Window.dispatchEventImpl:2746	
Component.dispatchEvent:4711	
EventQueue.dispatchEventImpl:758	
EventQueue.access$500:97	
EventQueue$3.run:709	
EventQueue$3.run:703	
AccessController.doPrivileged	
ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege:80	
ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege:90	
EventQueue$4.run:731	
EventQueue$4.run:729	
AccessController.doPrivileged	
ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege:80	
EventQueue.dispatchEvent:728	
Hidden Source Calls	
TimableEventQueue.dispatchEvent:159	
EventDispatchThread.pumpOneEventForFilters:201	
EventDispatchThread.pumpEventsForFilter:116	
EventDispatchThread.pumpEventsForHierarchy:105	
EventDispatchThread.pumpEvents:101	
EventDispatchThread.pumpEvents:93	
EventDispatchThread.run:82	

Appkit Stack Trace:
Container.addContainerListener:2120	
Container$AccessibleAWTContainer.addPropertyChangeListener:3875	
JComponent$AccessibleJComponent.addPropertyChangeListener:3741	
Hidden Source Calls	
CAccessible.addNotificationListeners:116	
CAccessible.<init>:98	
CAccessible.getCAccessible:70
Comment 1 SirIntellegence 2017-10-23 16:28:16 UTC
This is for 8.2
Comment 2 SirIntellegence 2017-10-24 16:36:37 UTC
It happens with the Find Usages dialog as well.
Comment 3 SirIntellegence 2017-10-25 14:57:57 UTC
Added "or later" to the bug since I believe that this bug happens with later versions of java, but I haven't confirmed it.
Comment 4 dgreen 2018-01-29 21:31:20 UTC
I have same problem with NetBeans 8.2, High Sierra, and JDK 8.

I have found that I can start NetBeans from the command line and the problem does not occur (or occurs less frequently and I have not seen it yet).

I use a shell script with this line to start NetBeans

/Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/bin/netbeans
Comment 5 wbertel 2018-02-23 13:32:01 UTC
I have Netbeans 8.2, High Sierra, and JRE 1.8.0_152-b16.

I didn't see this problem until I installed and started using Magnet (2.1.0). (Magnet is a window management utility, available on the App Store.) When I quit Magnet and then start Netbeans, I don't have the problem. If I launch Magnet, I get the problem in Netbeans.
Comment 6 oyarzun 2018-03-06 20:22:43 UTC
(In reply to wbertel from comment #5)
> I have Netbeans 8.2, High Sierra, and JRE 1.8.0_152-b16.
> 
> I didn't see this problem until I installed and started using Magnet
> (2.1.0). (Magnet is a window management utility, available on the App
> Store.) When I quit Magnet and then start Netbeans, I don't have the
> problem. If I launch Magnet, I get the problem in Netbeans.

NB 8.2, macOS 10.13.3, JDK 1.8.0_152+

I am seeing the same issue with Context another window management app https://contexts.co/. If I close the app it works find with the newer JDKs.

Or if I downgrade JDK to 1.8.0_151 it works with Context running.
Comment 7 oyarzun 2018-03-06 20:23:21 UTC
(In reply to wbertel from comment #5)
> I have Netbeans 8.2, High Sierra, and JRE 1.8.0_152-b16.
> 
> I didn't see this problem until I installed and started using Magnet
> (2.1.0). (Magnet is a window management utility, available on the App
> Store.) When I quit Magnet and then start Netbeans, I don't have the
> problem. If I launch Magnet, I get the problem in Netbeans.

NB 8.2, macOS 10.13.3, JDK 1.8.0_152+

I am seeing the same issue with Context another window management app https://contexts.co/. If I close the app it works find with the newer JDKs.

Or if I downgrade JDK to 1.8.0_151 it works with Context running.
Comment 8 michbarsinai 2018-03-31 21:48:20 UTC
I have the same issue, also on "find usages" dialog. (Mac OS 10.13, Java 1.8.0_131).
Comment 9 michbarsinai 2018-04-02 07:26:26 UTC
Interesting: If I'm using the Nimbus LaF the problem goes away.