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.
Build: NetBeans IDE Dev (Build 200710181200) VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05 OS: Linux, 2.6.22-14-386, i386 User comments: I tried to search for a string using F3 key, just after I edited post-init code for a JPanel. STACKTRACE: (first 10 lines) avax.swing.text.BadLocationException: end=35624 > length()=4741 at org.netbeans.lib.editor.util.swing.DocumentUtilities.getText(DocumentUtilities.java:328) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:232) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceResult(DocumentFinder.java:312) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findReplaceInBlock(EditorFindSupport.java:589) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findReplaceImpl(EditorFindSupport.java:518) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.find(EditorFindSupport.java:563) at org.netbeans.editor.ActionFactory$FindNextAction.actionPerformed(ActionFactory.java:1061) at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:291) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571) at javax.swing.JComponent.processKeyBinding(JComponent.java:2772) at javax.swing.JComponent.processKeyBindings(JComponent.java:2807)
Is this reproducible? I tried in my dev build and it seemed to work. Actually where exactly did you do the search - in the file editor or in the post-init code editor?
I searched in the file editor, I should have said that. Unfortunately, I did not manage to reproduce the issue. I know it wont probably help too much, but what I basically did: Property editor for border generates an incorrect code for "Matte" border (it is known form issue 145316). So I created a new form, searched for the incorrect code (I used the "Matte" for the search), I copied that incorrect line of code, corrected it (fix was simple, just semicolon placed behind "//NOI18N" comment, not behind the method call) and I placed the code in the post-init code (I did it in the customizer you see when you click "..." in the Code tab). Resulting codes were the same except for the semicolons position... Then I pressed F3 (I assume there was "Matte" from the previous search that I performed in the incorrectly generated code in previous form) and this exception was thrown.
Ok, thanks.
I just got this exception when I did the following: 1) Searched in one file 2) Opened another file 3) Hit F3, exception was thrown I suspect the code is retaining state from the old file.
Build: NetBeans IDE Dev (Build 200903250219) VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04 OS: Linux, 2.6.27-14-generic, i386 User Comments: Changing field values within a Find/Replace dialog. I accidentally pressed a | and a } when I we to press the backspace key Stacktrace: javax.swing.text.BadLocationException: end=2685 > length()=2684 at org.netbeans.lib.editor.util.swing.DocumentUtilities.getText(DocumentUtilities.java:333) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:232) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceResult(DocumentFinder.java:312) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findReplaceInBlock(EditorFindSupport.java:596) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findInBlock(EditorFindSupport.java:660) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.incSearch(EditorFindSupport.java:375)
Created attachment 78948 [details] stacktrace
Build: NetBeans IDE Dev (Build 200903250219) VM: Java HotSpot(TM) Client VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04 OS: Linux, 2.6.27-14-generic, i386 User Comments: Caused by pressing | and backspace while find/replace dialog is active. Stacktrace: javax.swing.text.BadLocationException: end=2684 > length()=2663 at org.netbeans.lib.editor.util.swing.DocumentUtilities.getText(DocumentUtilities.java:333) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceImpl(DocumentFinder.java:232) at org.netbeans.modules.editor.lib2.search.DocumentFinder.findReplaceResult(DocumentFinder.java:312) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findReplaceInBlock(EditorFindSupport.java:596) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.findInBlock(EditorFindSupport.java:660) at org.netbeans.modules.editor.lib2.search.EditorFindSupport.incSearch(EditorFindSupport.java:375)
Created attachment 78949 [details] stacktrace
I improved the exceptions logging - b83475176631
From the log of exception reporter it looks like this issue does not happen any more. Last report is from 2009