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.
After recent changes in synchronization of CES.getUndoRedo() I was able to get a deadlock during UndoRedo.canUndo. If the canUndo method then decided to access the document, it could deadlock.
Created attachment 16595 [details] Threaddump
The solution is in my opinion similar to changes made to undo() and redo(), lock the document before the super method is being called.
Yes, agreed. Maybe we should do it mechanically like 1. search for 'synchronized' keyword in UndoManager. 2. verify that the particular method is present in the UndoRedo. 3. wrap it by document lock.
Created attachment 16599 [details] Patch for canUndo and canRedo
Created attachment 16605 [details] Test to check whether all UndoManager methods can be called from a document lock, test to verify that
Checking in src/org/openide/text/CloneableEditorSupport.java; /cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v <-- CloneableEditorSupport.java new revision: 1.128; previous revision: 1.127 done Processing log script arguments... More commits to come... Checking in test/unit/src/org/openide/text/UndoRedoTest.java; /cvs/openide/test/unit/src/org/openide/text/UndoRedoTest.java,v <-- UndoRedoTest.java new revision: 1.2; previous revision: 1.1
verified in [nb_dev](200408091800)