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 227687 - javax.swing.text.BadLocationException: Invalid (offset=437 + length=140)=577 > (docLen+1)=575
Summary: javax.swing.text.BadLocationException: Invalid (offset=437 + length=140)=577 ...
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 07:21 UTC by Vladimir Riha
Modified: 2013-06-18 14:48 UTC (History)
12 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 199288


Attachments
stacktrace (3.69 KB, text/plain)
2013-03-20 07:21 UTC, Vladimir Riha
Details
sample file (574 bytes, application/x-php)
2013-03-20 07:25 UTC, Vladimir Riha
Details
stacktrace (3.70 KB, text/plain)
2013-04-22 09:13 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2013-03-20 07:21:52 UTC
This issue was reported manually by vriha.
It already has 7 duplicates 


Build: NetBeans IDE Dev (Build web-main-10115-on-20130319)
VM: Java HotSpot(TM) Client VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_17-b02
OS: Linux

User Comments:
vriha: I was typing in PHP code (line 24 in to be attached file):

24| $e = var_export($this->data, true); err|

code completion at "|", select error_log and press enter:

24|        $e = var_export($this->data, true);
25|             error_log($message)

and BLE

GUEST: using auto complete

GUEST: Used autocomplete to complete a php classname.




Stacktrace: 
javax.swing.text.BadLocationException: Invalid (offset=437 + length=140)=577 > (docLen+1)=575
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.checkBoundsInContent(EditorDocumentContent.java:310)
   at org.netbeans.modules.editor.lib2.document.EditorDocumentContent.getChars(EditorDocumentContent.java:231)
   at javax.swing.text.AbstractDocument.getText(AbstractDocument.java:812)
   at org.netbeans.editor.BaseDocument.find(BaseDocument.java:1248)
   at org.netbeans.editor.Utilities.getFirstNonWhiteBwd(Utilities.java:551)
   at org.netbeans.editor.Utilities.getFirstNonWhiteBwd(Utilities.java:537)
Comment 1 Vladimir Riha 2013-03-20 07:21:54 UTC
Created attachment 132816 [details]
stacktrace
Comment 2 Vladimir Riha 2013-03-20 07:25:32 UTC
Created attachment 132817 [details]
sample file

File where it happened with http://statistics.netbeans.org/exceptions/exception.do?id=665743
Comment 3 Vladimir Riha 2013-04-22 09:13:15 UTC
Created attachment 133653 [details]
stacktrace

just typing in PHP file
Comment 4 Exceptions Reporter 2013-04-22 09:13:19 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=199288
Comment 5 Exceptions Reporter 2013-06-17 00:49:46 UTC
This bug already has 50 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=199288
Comment 6 Svata Dedic 2013-06-17 08:02:32 UTC
I've extracted report http://statistics.netbeans.org/exceptions/exception.do?id=669940, the rest seems to come from TooManyLines hint from PHP. Reassinging.
Comment 7 Ondrej Brejla 2013-06-17 08:13:50 UTC
Fixed in web-main #db7ceca9dd63

Lado, can you test it? Thanks.
Comment 8 Vladimir Riha 2013-06-17 08:20:57 UTC
I'll try, steps from description are not reproducing it in build from yesterday :/
Comment 9 Ondrej Brejla 2013-06-17 08:22:14 UTC
Hehe :)) Ok, you will see, but imho no BLE should occur from now.
Comment 10 Vladimir Riha 2013-06-17 13:12:55 UTC
Well I cannot reproduce it anymore :) Thanks




Product Version: NetBeans IDE Dev (Build 20130617-df01a675e2d7)
Updates: Updates available
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.2.0-45-generic-pae running on i386; UTF-8; en_US (nb)
Comment 11 Ondrej Brejla 2013-06-17 14:02:25 UTC
Transplanted to 7.4 beta branch in releases #560fdfdad0a3
Comment 12 sjzurek 2013-06-18 12:26:33 UTC
Good work guys!
Many thanks!
Comment 13 Quality Engineering 2013-06-18 14:04:54 UTC
Integrated into 'releases', will be available in build *201306181053* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/560fdfdad0a3
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #227687 - javax.swing.text.BadLocationException: Invalid (offset=437 + length=140)=577 > (docLen+1)=575
(transplanted from db7ceca9dd63fda4c9bd44357d243f01f69e0cb0)
Comment 14 Quality Engineering 2013-06-18 14:48:15 UTC
Integrated into 'main-golden', will be available in build *201306181109* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/db7ceca9dd63
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #227687 - javax.swing.text.BadLocationException: Invalid (offset=437 + length=140)=577 > (docLen+1)=575