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.
Intermittently while pressing newlines I'm getting the following exception; I don't exactly know how to reproduce it since it happens only occasionally. One thing which -may- be related is that I've pressed return twice rapidly when it was busy doing something else so it didn't immediately process the first newline - perhaps some kind of race condition? Also note that this is on a Ruby file with my own IndentTask. My indent task doesn't call lock anywhere; it simply responds to the reindent() method and updates the source by calling doc.getFormatter().changeRowIndent() under a document write lock. If that is not the right way to do it let me know. Given that this bug is so intermittent I assumed it was related to a problem in the FormatterImpl or IndentImpl's handling of the indentation lock. (My indentLock method returns null.) java.lang.AssertionError: Not locked. Use Indent.lock() at org.netbeans.modules.editor.indent.IndentImpl.reindent(IndentImpl.java:130) at org.netbeans.modules.editor.indent.FormatterImpl.indentLine(FormatterImpl.java:75) at org.netbeans.modules.editor.indent.FormatterImpl.indentNewLine(FormatterImpl.java:96) at org.netbeans.editor.BaseKit$SplitLineAction.actionPerformed(BaseKit.java:1177) at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:266) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1576) at javax.swing.JComponent.processKeyBinding(JComponent.java:2763) at javax.swing.JComponent.processKeyBindings(JComponent.java:2798) at javax.swing.JComponent.processKeyEvent(JComponent.java:2726) at java.awt.Component.processEvent(Component.java:5331) at java.awt.Container.processEvent(Container.java:2010) at java.awt.Component.dispatchEventImpl(Component.java:4021) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Component.dispatchEvent(Component.java:3869) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636) at java.awt.Component.dispatchEventImpl(Component.java:3907) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Window.dispatchEventImpl(Window.java:1774) at java.awt.Component.dispatchEvent(Component.java:3869) [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Milo, any ideas?
Tor you've probably pressed Ctrl+Enter so that SplitLineAction was invoked. Unfortunately I did not wrap this one by the locking (I had to miss it when I've searched for the usages). I'll fix it together with others that I possibly find.
Yes, that's quite possible...
Code templates seem to be broken. When I open a Ruby file and type "class" followed by Tab I get this exception: java.lang.AssertionError: Not locked. Use Reformat.lock() at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:176) at org.netbeans.modules.editor.indent.FormatterImpl.reformat(FormatterImpl.java:117) at org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.insertTemplate(CodeTemplateInsertHandler.java:320) at org.netbeans.lib.editor.codetemplates.CodeTemplateInsertHandler.processTemplate(CodeTemplateInsertHandler.java:237) at org.netbeans.lib.editor.codetemplates.CodeTemplateManagerOperation.insert(CodeTemplateManagerOperation.java:222) at org.netbeans.lib.editor.codetemplates.api.CodeTemplate.insert(CodeTemplate.java:78) at org.netbeans.lib.editor.codetemplates.CodeTemplateAbbrevExpander.expand(CodeTemplateAbbrevExpander.java:48) at org.netbeans.lib.editor.codetemplates.AbbrevDetection.expand(AbbrevDetection.java:330) at org.netbeans.lib.editor.codetemplates.AbbrevDetection.checkExpansionKeystroke(AbbrevDetection.java:234) at org.netbeans.lib.editor.codetemplates.AbbrevDetection.keyPressed(AbbrevDetection.java:196) at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:191) at java.awt.AWTEventMulticaster.keyPressed(AWTEventMulticaster.java:191)
Bumping to P2 - the abbreviation problem is more serious than the original intermittent problem I was seeing (possibly accidentally typing shift-return)
Checking in libsrc/org/netbeans/editor/BaseKit.java; /cvs/editor/libsrc/org/netbeans/editor/BaseKit.java,v <-- BaseKit.java new revision: 1.171; previous revision: 1.170 done Checking in libsrc/org/netbeans/editor/Abbrev.java; /cvs/editor/libsrc/org/netbeans/editor/Abbrev.java,v <-- Abbrev.java new revision: 1.31; previous revision: 1.30 done Checking in libsrc/org/netbeans/editor/ActionFactory.java; /cvs/editor/libsrc/org/netbeans/editor/ActionFactory.java,v <-- ActionFactory.java new revision: 1.87; previous revision: 1.86 done Checking in codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateInsertHandler.java; /cvs/editor/codetemplates/src/org/netbeans/lib/editor/codetemplates/CodeTemplateInsertHandler.java,v <-- CodeTemplateInsertHandler.java new revision: 1.11; previous revision: 1.10
*** Issue 111993 has been marked as a duplicate of this issue. ***
*** Issue 112998 has been marked as a duplicate of this issue. ***