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 223495 - javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=2185
Summary: javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=2185
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: All All
: P1 normal with 1 vote (vote)
Assignee: Jan Lahoda
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2012-12-07 16:44 UTC by aldobrucale
Modified: 2013-03-18 16:55 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 196269


Attachments
stacktrace (1.80 KB, text/plain)
2012-12-07 16:44 UTC, aldobrucale
Details
stacktrace (1.80 KB, text/plain)
2012-12-10 13:04 UTC, markiewb
Details
stacktrace (2.87 KB, text/plain)
2012-12-28 09:53 UTC, aldobrucale
Details
stacktrace (1.80 KB, text/plain)
2013-01-02 13:35 UTC, markiewb
Details
stacktrace (1.73 KB, text/plain)
2013-01-04 18:38 UTC, esfand
Details
stacktrace (1.80 KB, text/plain)
2013-01-23 10:22 UTC, Alexander Simon
Details
stacktrace (1.80 KB, text/plain)
2013-02-06 22:07 UTC, markiewb
Details
stacktrace (1.80 KB, text/plain)
2013-03-06 19:15 UTC, MackSix
Details
stacktrace (1.80 KB, text/plain)
2013-03-06 19:27 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aldobrucale 2012-12-07 16:44:43 UTC
Build: NetBeans IDE Dev (Build 201212070001)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.5-b02, Java(TM) SE Runtime Environment, 1.7.0_09-b05
OS: Linux

User Comments:
aldobrucale: Add static import for a @Messages generated string




Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=2185
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.checkOffsetNonNegative(EditorDocumentContent.java:264)
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.checkOffsetInContent(EditorDocumentContent.java:278)
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.createBackwardBiasPosition(EditorDocumentContent.java:199)
   at org.netbeans.editor.BaseDocument.createPosition(BaseDocument.java:1306)
   at org.openide.text.NbDocument.createPosition(NbDocument.java:225)
   at org.netbeans.modules.java.hints.infrastructure.ErrorHintsProvider$1.run(ErrorHintsProvider.java:533)
Comment 1 aldobrucale 2012-12-07 16:44:48 UTC
Created attachment 129059 [details]
stacktrace
Comment 2 markiewb 2012-12-10 13:04:56 UTC
Created attachment 129155 [details]
stacktrace

Search and replace in file
Comment 3 aldobrucale 2012-12-28 09:53:22 UTC
Created attachment 129738 [details]
stacktrace

Created a new class in the default package of a nb module project (with a random name)

Substituted the content of the file with the source code from this post http://blogs.oracle.com/geertjan/entry/file_browser

Clicked on the line numbers bar, beside the constructor declaration to show the editor hints (a class or method breakpoint was created instead)
Comment 4 Exceptions Reporter 2012-12-28 09:53:46 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=196269
Comment 5 markiewb 2013-01-02 13:35:16 UTC
Created attachment 129819 [details]
stacktrace

added 'abstract' modifier to class after refactor-copying
Comment 6 esfand 2013-01-04 18:38:16 UTC
Created attachment 129912 [details]
stacktrace

Just changed the name of a class on the class statement.
Comment 7 jan.kurnatowski 2013-01-11 19:08:06 UTC
 I have changed the name of a class
Comment 8 Exceptions Reporter 2013-01-11 19:08:26 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=196269
Comment 9 Alexander Simon 2013-01-23 10:22:41 UTC
Created attachment 130516 [details]
stacktrace

modifying file - permanent exception
Comment 10 Miloslav Metelka 2013-01-24 09:57:00 UTC
Looks related to java/hints
Comment 11 markiewb 2013-02-06 22:07:19 UTC
Created attachment 131078 [details]
stacktrace
Comment 12 markiewb 2013-02-06 22:11:30 UTC
Reproduction: Create a javahint via wizard. As classname in the last tab choose something invalid like 'de.foo'
Comment 13 MackSix 2013-03-06 19:15:17 UTC
Created attachment 132290 [details]
stacktrace

Trying to make a Generic Class from a non-Geneirc Class in the Java editor. I will try to reproduce it.
Comment 14 MackSix 2013-03-06 19:27:17 UTC
Created attachment 132292 [details]
stacktrace

Repeatable in 7.3. This does not happen in 7.2.1. REGRESSION

Just type "< extends" or "< implements" after the keyword "class" and before the class name in a class declaration and it happens.
Comment 15 Exceptions Reporter 2013-03-06 19:27:22 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=196269
Comment 16 Jan Lahoda 2013-03-07 07:02:47 UTC
Fixed:
http://hg.netbeans.org/jet-main/rev/6ce329c21b58
Comment 17 Quality Engineering 2013-03-08 02:02:24 UTC
Integrated into 'main-golden', will be available in build *201303072300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6ce329c21b58
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #223495: guarding against incorrect error spans/end position, which sometimes occur.
Comment 18 Jiri Prox 2013-03-13 14:03:08 UTC
verified
Comment 19 Jan Lahoda 2013-03-13 21:00:58 UTC
release73:
http://hg.netbeans.org/releases/rev/8507e4bbaff3
Comment 20 Quality Engineering 2013-03-14 21:13:16 UTC
Integrated into 'releases', will be available in build *201303141828* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/8507e4bbaff3
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #223495: guarding against incorrect error spans/end position, which sometimes occur.