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.

Bug 150103 - javax.swing.text.BadLocationException: Invalid offset=-14
Summary: javax.swing.text.BadLocationException: Invalid offset=-14
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Torbjorn Norbye
URL: http://statistics.netbeans.org/analyt...
Keywords:
Depends on:
Blocks:
 
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
Exception Reporter:


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

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
adam_myatt:

> editting a JSP file in editor. I added /* */ in javascript block. placed cursor inside the comment and pressed Enter 
> key several times. error occurred.

http://statistics.netbeans.org/analytics/detail.do?id=127779
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

Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=-1
        at org.netbeans.editor.DocumentContent.checkBounds(DocumentContent.java:334)
        at org.netbeans.editor.DocumentContent.getString(DocumentContent.java:168)
        at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:757)
        at org.netbeans.modules.javascript.editing.JsKeystrokeHandler.beforeBreak(JsKeystrokeHandler.java:320)
        at org.netbeans.modules.gsf.GsfEditorKitFactory$GsfEditorKit$GsfInsertBreakAction.beforeBreak(GsfEditorKitFactory.java:351)
        at org.netbeans.editor.BaseKit$InsertBreakAction$1.run(BaseKit.java:1214)
Comment 2 Petr Dvorak 2009-01-08 18:10:43 UTC
Created attachment 75597 [details]
stacktrace
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.

http://hg.netbeans.org/release65_fixes/rev/186eda700475
Comment 8 Petr Dvorak 2009-01-15 13:54:39 UTC
> The fix was ported into release65_fixes repository.

Thanks