Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 150103 - javax.swing.text.BadLocationException: Invalid offset=-14
javax.swing.text.BadLocationException: Invalid offset=-14
Product: javascript
Classification: Unclassified
Component: Editor
All All
: P2 (vote)
: 6.x
Assigned To: Torbjorn Norbye
Depends on:
  Show dependency treegraph
Reported: 2008-10-14 15:15 UTC by Petr Dvorak
Modified: 2009-02-27 14:26 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT

stacktrace (2.89 KB, text/plain)
2009-01-08 18:10 UTC, Petr Dvorak

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Dvorak 2008-10-14 15:15:52 UTC

> editting a JSP file in editor. I added /* */ in javascript block. placed cursor inside the comment and pressed Enter 
> key several times. error occurred.
Comment 1 Petr Dvorak 2009-01-08 18:10:33 UTC
Build: NetBeans IDE Dev (Build 200901060201)
VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26
OS: Linux, 2.6.27-11-generic, i386

User Comments: 
1. Create a new JS file
2. type "/*" (without ") and press enter
3. Delete the middle asterisk (press backspace 2x)
4. Press Enter

javax.swing.text.BadLocationException: Invalid offset=-1
        at org.netbeans.editor.DocumentContent.checkBounds(
        at org.netbeans.editor.DocumentContent.getString(
        at javax.swing.text.AbstractDocument.getText(
        at org.netbeans.modules.javascript.editing.JsKeystrokeHandler.beforeBreak(
        at org.netbeans.modules.gsf.GsfEditorKitFactory$GsfEditorKit$GsfInsertBreakAction.beforeBreak(
        at org.netbeans.editor.BaseKit$InsertBreakAction$
Comment 2 Petr Dvorak 2009-01-08 18:10:43 UTC
Created attachment 75597 [details]
Comment 3 Petr Dvorak 2009-01-08 18:11:22 UTC
Product Version: NetBeans IDE Dev (Build 200901060201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13
System: Linux version 2.6.27-11-generic running on i386; UTF-8; en_US (nb)

129 duplicates so far, easily reproducible...
Comment 4 Torbjorn Norbye 2009-01-09 03:47:25 UTC
Fixed in changeset a6122611b9e0.

Comment 5 pgebauer 2009-01-14 09:51:11 UTC
The issue hasn't passed the nomination process for 65patch2 by cut-off date. It has been moved to 65patch3.
Comment 6 Petr Dvorak 2009-01-15 10:05:41 UTC
Verified in 200901150201
Comment 7 pslechta 2009-01-15 13:52:06 UTC
The fix was ported into release65_fixes repository.
Comment 8 Petr Dvorak 2009-01-15 13:54:39 UTC
> The fix was ported into release65_fixes repository.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo