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 224347 - IndexOutOfBoundsException: start=-93 < 0
Summary: IndexOutOfBoundsException: start=-93 < 0
Status: RESOLVED DUPLICATE of bug 225394
Alias: None
Product: editor
Classification: Unclassified
Component: Lexer (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-01 08:29 UTC by drazisil
Modified: 2013-05-21 14:02 UTC (History)
14 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 197041


Attachments
stacktrace (1.00 KB, text/plain)
2013-01-01 08:29 UTC, drazisil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description drazisil 2013-01-01 08:29:49 UTC
This bug was originally marked as duplicate of bug 221857, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201212310001)
VM: Java HotSpot(TM) Client VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_10-b18
OS: Windows 7

User Comments:
GUEST: I was removing the template comment lines from a newly created php file.

Stanisov: I just push a "point" button on keyboard in my new PHP file

GUEST: IndexOutOfBoundsException: start=-99 < 0
The error is above.

GUEST: I had just created a new file, selected and deleted the default php content and begun typing. The screen shows a single '<' character.

Eugene_Moshyn: php include

daskasfo: copy paste

GUEST: Try create new file

GUEST: I created new PHP file and started typing :
<?php
print
?>

marqusG: I'm creating a new CodeIgniter controller in a new just created project following this tutorial: http://morshed-iiuc.blogspot.it/2011/11/how-can-i-use-codeigniter-with-netbeans.html
The new file has been created in the IDE but simple deleting first four line (To change this template...) raised the error and now it is raised any two/three seconds moving cursor.

daskasfo: correct code

GUEST: I deleted the phpFile template content

<?php
.  }
.  }    deleted these
.  }

GUEST: Just typed text

GUEST: I created new file.

GUEST: Typing cls [tab] to create the autocomplete class for a php file.

GUEST: when i want to write class, i get this problem. Thanks
<?php

class

GUEST: Try create new file

joseph_ds: Deleted a comment block in PHP.

GUEST: copy code from website to netbeans 7.3 beta2

GUEST: Editting a PHP file, just deleted the default text for a new php file, started to type my own.

GUEST: Cut code snippet from one file in to another file (both tabs open)

GUEST: I selected and deleted everything from the document. It was the default PHP template code.
This appeared right after pressing the backspace button.

GUEST: Deleting a part of a new PHP page.

GUEST: edit code in file PHP

drazisil: Pasting Smarty code

GUEST: just backspacing...

GUEST: I added a new PHP class file

GUEST: Just typed text

GUEST: parse

GUEST: create new php file

GUEST: deleting php file template

GUEST: Open a new file

GUEST: I am using ctrl+space on php file.




Stacktrace: 
java.lang.IndexOutOfBoundsException: start=-93 < 0
   at org.netbeans.lib.editor.util.CharSequenceUtilities.checkIndexesValid(CharSequenceUtilities.java:529)
   at org.netbeans.modules.editor.lib2.document.CharContent.subSequence(CharContent.java:95)
   at org.netbeans.lib.lexer.token.DefaultToken.text(DefaultToken.java:142)
   at org.netbeans.editor.CustomFoldManager.scanToken(CustomFoldManager.java:485)
   at org.netbeans.editor.CustomFoldManager.getMarkList(CustomFoldManager.java:287)
   at org.netbeans.editor.CustomFoldManager.processTokenList(CustomFoldManager.java:305)
Comment 1 drazisil 2013-01-01 08:29:52 UTC
Created attachment 129794 [details]
stacktrace
Comment 2 drazisil 2013-01-01 08:43:46 UTC
I pasted some Smarty code
Comment 3 Debeet 2013-03-02 12:46:36 UTC
Here's another one from me:
http://statistics.netbeans.org/analytics/exception.do?id=662245
Comment 4 Svata Dedic 2013-04-18 13:43:54 UTC
The code on the stack locks the document (((BaseDocument) doc).readLock()), then obtains TokenHierarchy.get(doc). So IMHO no change should be allowed before the document is unlocked - seems the token sequence becomes inconsistent for some reason.

I could never reproduced the defect but the exception reports income is steady (= it really exists)
Comment 5 Marian Mirilovic 2013-04-25 17:02:49 UTC
152 ERs ... too many -> P2 ... all of them came during stabilization phase of 7.3
Comment 6 Miloslav Metelka 2013-05-21 14:02:35 UTC
Marking as dup of issue #225394 since both cases are race conditions in lexer when Token.text() method fails with invalid index bounds.

*** This bug has been marked as a duplicate of bug 225394 ***