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 130009 - javax.swing.text.BadLocationException: Invalid offset=-1 not within <0, 6768>
Summary: javax.swing.text.BadLocationException: Invalid offset=-1 not within <0, 6768>
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomasz Slota
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-13 10:14 UTC by Jiri Skrivanek
Modified: 2009-05-18 10:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 29181


Attachments
stacktrace (4.12 KB, text/plain)
2008-03-27 19:57 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2008-03-13 10:14:32 UTC
To reproduce:

- create Rails application
- open new file wizard
- choose Ruby|RHTML file
- finish the wizard
- paste the following at the end of the file

<table border="<%= Time.no

- press CTRL+Space to show code completion
- press Enter to confirm 'now' field and exception appears.

Build: NetBeans IDE Dev (Build 200802110004)
VM: Java HotSpot(TM) Client VM, 1.5.0_11-b03
OS: Windows 2000, 5.0, x86
User comments: while typing "re" in rhtml file. should insert <%= %>
STACKTRACE: (first 10 lines)
javax.swing.text.BadLocationException: Invalid offset=-1 not within <0, 6768>
        at org.netbeans.editor.Utilities.checkOffsetValid(Utilities.java:1331)
        at org.netbeans.editor.Utilities.getLineOffset(Utilities.java:613)
        at
org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.calcIndents_processOpeningTag(TagBasedLexerFormatter.java:508)
        at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.reformat(TagBasedLexerFormatter.java:226)
        at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.reformat(TagBasedLexerFormatter.java:160)
        at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.process(TagBasedLexerFormatter.java:155)
        at org.netbeans.modules.html.editor.indent.HtmlIndentTask.reindent(HtmlIndentTask.java:68)
        at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:502)
        at org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:271)
        at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:293)
Comment 1 Jiri Skrivanek 2008-03-27 19:57:48 UTC
Build: NetBeans IDE Dev (Build 20080327142331)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments: 
To reproduce:

- create Rails project
- create new RHTML file
- type <table border="<%= Time.no
- press Ctrl+space to invoke code completion
- select now, press enter and exception is thrown
Comment 2 Jiri Skrivanek 2008-03-27 19:57:52 UTC
Created attachment 59245 [details]
stacktrace
Comment 3 Exceptions Reporter 2008-06-04 09:05:34 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=29181
Comment 4 jamespb 2008-06-30 20:46:34 UTC
Seems like this is at least a p2, not a p3
Comment 5 Tomasz Slota 2008-07-15 14:33:22 UTC
Fixed.

http://hg.netbeans.org/main/rev/d5346e1b2d18
Comment 6 Quality Engineering 2008-07-17 04:34:59 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #324 build
Changeset: http://hg.netbeans.org/main/rev/d5346e1b2d18
User: Tomasz Slota <tslota@netbeans.org>
Log: #130009: javax.swing.text.BadLocationException: Invalid offset=-1 not within <0, 6768>
Comment 7 Jiri Skrivanek 2008-07-22 13:34:09 UTC
Verified.