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.
In some cases, undoing of hint "Surround with try - catch" may lead to following exception: javax.swing.text.BadLocationException: Invalid offset=700 not within <0, 555> at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1227) at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1222) at org.netbeans.editor.Utilities.getRowStart(Utilities.java:126) ... (whole stack trace added) Steps to reproduce: ------------------- 1) In attached Surround.java file, goto line 28. 2) Invoke the "Surround with try-catch" hint. 3) Invoke Undo (Ctrl-Z) --> exception is typed inside console. I'm not sure if it belongs here, please reasign to editor if otherwise. [200508291800, JDK 1.5.0_05 b03, solaris 10/ sparc]
Created attachment 24353 [details] exc. stack trace
Created attachment 24354 [details] test file
I got the same exception (more or less, see below) when starting up the IDE, which preloaded my previous working tabs in the source editor. After closing a few source file tabs (using the little 'x' on the tabs), the exception dialog popped up. I may have clicked within the source editor panel right before it occurred... can't remember. javax.swing.text.BadLocationException: Invalid offset=6507 not within <0, 1> at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1227) at org.netbeans.editor.Utilities.getLineOffset(Utilities.java:552) at org.netbeans.modules.j2ee.ejbcore.hints.EjbHintsProvider.getHints(EjbHintsProvider.java:56) at org.netbeans.modules.editor.hints.HintsOperator$HintPopupTaskImpl.run(HintsOperator.java:233) at org.openide.util.Task.run(Task.java:207) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:469) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:870)
this exc is little bit different: javax.swing.text.BadLocationException: Invalid offset=700 not within <0, 555> at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1227) at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1222) at org.netbeans.editor.Utilities.getRowStart(Utilities.java:126) at org.netbeans.editor.BaseDocument.processText(BaseDocument.java:497) at org.netbeans.editor.ext.java.JavaSyntaxSupport.getLastCommandSeparator(JavaSyntaxSupport.java:146) at org.netbeans.editor.ext.java.JavaCompletionQuery.tipQuery(JavaCompletionQuery.java:166) Exception you mentioned was already fixed in issue #64283
Fixing the last exception. Checking in lib/src/org/netbeans/editor/ext/java/JavaCompletionQuery.java; /cvs/java/editor/lib/src/org/netbeans/editor/ext/java/JavaCompletionQuery.java,v <-- JavaCompletionQuery.java new revision: 1.10; previous revision: 1.9 done
I haven't seen this for a long time, marking as verified. [200512041900]