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 209019 - StringIndexOutOfBoundsException: String index out of range: 0
Summary: StringIndexOutOfBoundsException: String index out of range: 0
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 7.2
Hardware: All All
: P1 normal with 2 votes (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-29 21:43 UTC by Jesse Glick
Modified: 2012-09-03 12:57 UTC (History)
24 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 185376


Attachments
stacktrace (3.38 KB, text/plain)
2012-02-29 21:43 UTC, Jesse Glick
Details
stacktrace (3.38 KB, text/plain)
2012-03-01 08:49 UTC, Maksim Khramov
Details
stacktrace (3.40 KB, text/plain)
2012-03-01 15:25 UTC, Kenneth Ganfield
Details
stacktrace (3.38 KB, text/plain)
2012-03-04 14:01 UTC, Vladimir Riha
Details
stacktrace (3.40 KB, text/plain)
2012-03-05 14:06 UTC, Petr Jiricka
Details
stacktrace (3.38 KB, text/plain)
2012-03-07 14:17 UTC, Jiri Prox
Details
stacktrace (3.38 KB, text/plain)
2012-03-08 14:26 UTC, Jesse Glick
Details
stacktrace (3.38 KB, text/plain)
2012-03-11 21:20 UTC, williambacchi
Details
stacktrace (3.38 KB, text/plain)
2012-03-12 08:59 UTC, paolosca
Details
stacktrace (3.38 KB, text/plain)
2012-03-12 09:02 UTC, williambacchi
Details
stacktrace (3.40 KB, text/plain)
2012-03-12 09:41 UTC, Martin Fousek
Details
Patch for htmlkit (677 bytes, patch)
2012-03-12 12:27 UTC, Milutin Kristofic
Details | Diff
stacktrace (3.40 KB, text/plain)
2012-03-13 22:47 UTC, David Konecny
Details
stacktrace (3.38 KB, text/plain)
2012-03-14 19:05 UTC, gholmer
Details
stacktrace (3.38 KB, text/plain)
2012-03-15 01:47 UTC, schkovich
Details
stacktrace (3.40 KB, text/plain)
2012-03-19 07:20 UTC, fortruth
Details
stacktrace (3.38 KB, text/plain)
2012-03-22 20:25 UTC, Jiri Prox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2012-02-29 21:43:46 UTC
Build: NetBeans IDE Dev (Build 20120229-c59d1ca31e34)
VM: Java HotSpot(TM) Client VM, 22.1-b02, Java(TM) SE Runtime Environment, 1.7.0_03-b04
OS: Linux

User Comments:
GUEST: Everytime I select text and type over it I get this exception.




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
   at java.lang.String.charAt(String.java:695)
   at org.netbeans.modules.html.editor.api.HtmlKit$HtmlDefaultKeyTypedAction.replaceSelection(HtmlKit.java:462)
   at org.netbeans.editor.BaseKit$DefaultKeyTypedAction$2.run(BaseKit.java:1160)
   at org.netbeans.editor.GuardedDocument.runAtomicAsUser(GuardedDocument.java:347)
   at org.netbeans.editor.BaseKit$DefaultKeyTypedAction.actionPerformed(BaseKit.java:1151)
   at org.netbeans.editor.ext.ExtKit$ExtDefaultKeyTypedAction.actionPerformed(ExtKit.java:1076)
Comment 1 Jesse Glick 2012-02-29 21:43:48 UTC
Created attachment 116219 [details]
stacktrace
Comment 2 Maksim Khramov 2012-03-01 08:49:08 UTC
Created attachment 116226 [details]
stacktrace
Comment 3 Exceptions Reporter 2012-03-01 08:49:14 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=185376
Comment 4 Kenneth Ganfield 2012-03-01 15:25:12 UTC
Created attachment 116252 [details]
stacktrace

typing in html file in editor
Comment 5 Vladimir Riha 2012-03-04 14:01:08 UTC
Created attachment 116326 [details]
stacktrace

editing HTML file (selecting block of code and typing)
Comment 6 Petr Jiricka 2012-03-05 14:06:36 UTC
Created attachment 116351 [details]
stacktrace

Typing HTML code.
Comment 7 Exceptions Reporter 2012-03-06 13:14:16 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=185376
Comment 8 Jiri Prox 2012-03-07 14:17:15 UTC
Created attachment 116431 [details]
stacktrace

SIOOBE when typing in html while some text is selected
Comment 9 Jesse Glick 2012-03-08 14:26:14 UTC
Created attachment 116479 [details]
stacktrace

Selected a short block of HTML text and then tried to type over it.
Comment 10 williambacchi 2012-03-11 21:20:18 UTC
Created attachment 116565 [details]
stacktrace
Comment 11 paolosca 2012-03-12 08:59:16 UTC
Created attachment 116577 [details]
stacktrace

Selected a string of text in a html file then pressed a key to overwrite it. This problem appears only in html files, not in php files.
Comment 12 williambacchi 2012-03-12 09:02:17 UTC
Created attachment 116578 [details]
stacktrace

selected some text and pressed a key
Comment 13 suseu 2012-03-12 09:06:33 UTC
I see lots of comments saying that the problem is in HTML files, but in my case it also affects PHP files.
Comment 14 Martin Fousek 2012-03-12 09:41:17 UTC
Created attachment 116584 [details]
stacktrace

marked text for replacing -> typed char -> exception appeared
Comment 15 Milutin Kristofic 2012-03-12 12:27:45 UTC
Created attachment 116603 [details]
Patch for htmlkit

Marek, I fixed this issue in csl. Bug #208931

Here is a patch for this one, if you want to push it into web-main, or I can push it to jet-main.
Comment 16 David Konecny 2012-03-13 22:47:15 UTC
Created attachment 116692 [details]
stacktrace

I was typing fast
Comment 17 gholmer 2012-03-14 19:05:15 UTC
Created attachment 116749 [details]
stacktrace

Select string surrounded by quotes, then try to delete.
Comment 18 schkovich 2012-03-15 01:47:15 UTC
Created attachment 116755 [details]
stacktrace

overtyping selected text in html editor
Comment 19 fortruth 2012-03-19 07:20:16 UTC
Created attachment 116845 [details]
stacktrace

When some text selected, the keyboard can't work except the backspace key.

for example, in demo.html

 <body>
        <div>TODO write content</div>
    </body>

when TODO is selected.

any charactory key can't been pressed, just must press backspace to delete the TODO. then you can type any new things.
Comment 20 Exceptions Reporter 2012-03-21 08:22:14 UTC
This bug already has 50 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=185376
Comment 21 Marek Fukala 2012-03-21 17:24:03 UTC
regression of mkristofic's fix of issue Bug 204450 - Rewrite actions to use TypingHooks SPI
Comment 22 Marek Fukala 2012-03-21 17:56:46 UTC
the regression is workarounded in web-main#3f0d8e76ba3f
Comment 23 Quality Engineering 2012-03-22 11:14:51 UTC
Integrated into 'main-golden', will be available in build *201203220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3f0d8e76ba3f
User: Marek Fukala <mfukala@netbeans.org>
Log: #209019 - StringIndexOutOfBoundsException: String index out of range: 0
Comment 24 Jiri Prox 2012-03-22 20:25:16 UTC
Created attachment 117121 [details]
stacktrace

SIOOBE when typing while part of code is selected
Comment 25 Quality Engineering 2012-09-03 12:57:23 UTC
Integrated into 'main-golden', will be available in build *201209031048* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b0d2aea399b6
User: Marek Fukala <mfukala@netbeans.org>
Log: #209019 - StringIndexOutOfBoundsException: String index out of range: 0