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.
To reproduce this problem: 1) Open file editor (I tried this with empty file, XML file and also Java source file) 2) the file must contain at least 2 characters 3) select all "ctrl+a" 4) press "ctrl+enter" (Split Line Action) ... and the editor throws ... javax.swing.text.BadLocationException: Invalid offset=3, docLength=0 at org.netbeans.editor.DocumentContent.checkOffset(DocumentContent.java:325) at org.netbeans.editor.DocumentContent.createPosition(DocumentContent.java:116) at javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:816) at org.netbeans.modules.editor.indent.TaskHandler.setCaretOffset(TaskHandler.java:120) at org.netbeans.modules.editor.indent.IndentImpl.reindent(IndentImpl.java:193) at org.netbeans.modules.editor.indent.FormatterImpl.indentLine(FormatterImpl.java:138) Caused: java.lang.IllegalStateException at org.netbeans.modules.editor.indent.FormatterImpl.indentLine(FormatterImpl.java:142) at org.netbeans.modules.editor.indent.FormatterImpl.indentNewLine(FormatterImpl.java:133) at org.netbeans.editor.BaseKit$SplitLineAction.actionPerformed(BaseKit.java:1201) at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:290) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636) at javax.swing.JComponent.processKeyBinding(JComponent.java:2844) at javax.swing.JComponent.processKeyBindings(JComponent.java:2879) at javax.swing.JComponent.processKeyEvent(JComponent.java:2807) at java.awt.Component.processEvent(Component.java:5815) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4410) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4240) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:693) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:958) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:830) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:657) at java.awt.Component.dispatchEventImpl(Component.java:4282) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Window.dispatchEventImpl(Window.java:2429) at java.awt.Component.dispatchEvent(Component.java:4240) [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Yeah, it seems to crash always when there is a selection.
Created attachment 53531 [details] Fix for this issue, also fixes erornous behaviour when selection was started above the current caret location
Created attachment 57058 [details] Modified patch for the new mercurial repository structure.
Modified version and target milestone, because the bug is still not fixed.
Oh, thanks for the patch. Please do not change the version field. If the defect was discovered in 6.0 then unless marked as fixed with target milestone referring to 6.1 we automatically assume the defect also exists in 6.1. If you changed the version as you did, it would appear that the defect was introduced in 6.1 and that maybe the action worked in 6.0. Anyway, thanks for the patch, I'll have a look and apply it.
Patch applied, I'm sorry that it took so long. changeset f6e5d197a4aa in main details: http://hg.netbeans.org/main?cmd=changeset;node=f6e5d197a4aa