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 258271 - javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=20091
Summary: javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=20091
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: CSL (API & infrastructure) (show other bugs)
Version: 8.2
Hardware: All All
: P1 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-07 12:23 UTC by legitalk
Modified: 2016-08-27 02:19 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 220654


Attachments
stacktrace (2.93 KB, text/plain)
2016-03-07 12:23 UTC, legitalk
Details
stacktrace (2.93 KB, text/plain)
2016-08-03 14:37 UTC, Martin Fousek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description legitalk 2016-03-07 12:23:40 UTC
Build: NetBeans IDE Dev (Build 201602290002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.60-b23, Java(TM) SE Runtime Environment, 1.8.0_60-b27
OS: Windows 7

User Comments:
GUEST: PHP Format Code

legitalk: Just editing code.

legitalk: Writing PHP.

GUEST: Same old shit - scanning forever

GUEST: Nothing to add

GUEST: editando arquivos

GUEST: This error showed up while I was reporting an error

GUEST: i have no idea




Stacktrace: 
javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=20091
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.checkOffsetNonNegative(EditorDocumentContent.java:271)
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.checkBoundsInContent(EditorDocumentContent.java:307)
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.getChars(EditorDocumentContent.java:231)
   at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:810)
   at org.netbeans.editor.DocumentUtilities.copyText(DocumentUtilities.java:97)
   at org.netbeans.editor.BaseDocument.getChars(BaseDocument.java:1169)
Comment 1 legitalk 2016-03-07 12:23:42 UTC
Created attachment 158765 [details]
stacktrace
Comment 2 Exceptions Reporter 2016-04-06 15:35:39 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=220654
Comment 3 Martin Fousek 2016-08-03 14:37:21 UTC
Created attachment 161550 [details]
stacktrace

Closed all documents in the IDE
Comment 4 Miloslav Metelka 2016-08-15 14:59:01 UTC
IMHO GsfCompletionProvider.java:722 can be reached with caretOffset == -1 since JavaCompletionQuery(int queryType, int caretOffset) constructor is has usages that pass -1.
Comment 5 Milutin Kristofic 2016-08-22 11:52:34 UTC
Thank you Mila, I added one more condition. http://hg.netbeans.org/jet-main/rev/d7dc808bbf21
Comment 6 Quality Engineering 2016-08-27 02:19:04 UTC
Integrated into 'main-silver', will be available in build *201608270002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d7dc808bbf21
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #258271 - javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=20091