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.
Unsurprisingly, invoking ...editor.Utilities.reformat() when the document write lock is held gives an exception. But trying the same operation again gives (full exceptions attached): java.lang.IllegalStateException: Already locked at org.netbeans.modules.editor.indent.IndentImpl.reformatLock(IndentImpl.java:128) Which look like an exception handling problem in JavaSource locking code.
Created attachment 46364 [details] exceptions resulting in stuck lock
Seems like a bug in org.netbeans.modules.editor.indent.IndentImpl.reformatLock to me - this method sets flag that it is locked (reformatHandler != null), and then the locking fails because of the exception. The Utilities.reformat then will not unlock it, which is correct, as the reformatLock method should be all or nothing, IMO.
I see. The reformatHandler is always assigned even if one of the items' locking fails. Should be fixed now. Checking in IndentImpl.java; /cvs/editor/indent/src/org/netbeans/modules/editor/indent/IndentImpl.java,v <-- IndentImpl.java new revision: 1.9; previous revision: 1.8 done Checking in TaskHandler.java; /cvs/editor/indent/src/org/netbeans/modules/editor/indent/TaskHandler.java,v <-- TaskHandler.java new revision: 1.8; previous revision: 1.7