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 6.5 (Build 200811100001) VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_06-b05 OS: SunOS, 5.10, x86 User Comments: pinheiro: Cutting and pasting some JSF code. uncle_bosk: I was replacing text in a jsp file using the editor when this occured. I double clicked on a word to select it then did a paste ([Ctrl]+c) to paste in the replacement text. I had done this 7 times when on the 8th replacement this error occured. uncle_bosk: I was using [Alt}+[Shift]+[Up] to move some text up one line. Stacktrace: javax.swing.text.BadLocationException: Invalid offset=2823 not within <0, 2814> at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1348) at org.netbeans.editor.Utilities.getLineOffset(Utilities.java:614) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager.isOneLineElement(JspFoldManager.java:524) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager.updateFolds(JspFoldManager.java:307) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager.access$100(JspFoldManager.java:48) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager$1$1.run(JspFoldManager.java:111)
Created attachment 76409 [details] stacktrace
Random issue. The cause is JspFoldManager.updateFolds() doesn't run under document readlock, just its part so such inconsistencies may happen. I do not want to fix this issue by locking the whole method since it will have a performance impact and moreover I plan to migrate the whole jsp folding to CSL since we can get rid of 3/4 of the code and solve the locking problem this way.
see my previous comment
Build: NetBeans IDE 6.5 (Build 200811100001) VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03 OS: Windows Vista, 6.0, x86 User Comments: Stacktrace: javax.swing.text.BadLocationException: Invalid offset=3842 not within <0, 3822> at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1348) at org.netbeans.editor.Utilities.getLineOffset(Utilities.java:614) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager.isOneLineElement(JspFoldManager.java:524) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager.updateFolds(JspFoldManager.java:307) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager.access$100(JspFoldManager.java:48) at org.netbeans.modules.web.core.syntax.folding.JspFoldManager$1$1.run(JspFoldManager.java:111)
Created attachment 81488 [details] stacktrace
*** Issue 169499 has been marked as a duplicate of this issue. ***
I'll fix it by locking the document when updating the folds, the issue is not that rare as I thought... JSP editor to CSL migration is not much closer than when I evaluated the issue for the first time ;-)
This issue already has 21 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=11352
fixed in web-main#f655a61f80ff
Integrated into 'main-golden', will be available in build *200909181401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f655a61f80ff User: Marek Fukala <mfukala@netbeans.org> Log: #157706 - javax.swing.text.BadLocationException: Invalid offset=2823 not within <0, 2814>