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 209498 - StringIndexOutOfBoundsException: String index out of range: 0
Summary: StringIndexOutOfBoundsException: String index out of range: 0
Status: RESOLVED FIXED
Alias: None
Product: python
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Lou Dasaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-13 08:38 UTC by Burjuy
Modified: 2015-05-26 02:36 UTC (History)
36 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 185407


Attachments
stacktrace (3.45 KB, text/plain)
2012-03-13 08:38 UTC, Burjuy
Details
stacktrace (3.42 KB, text/plain)
2013-02-27 08:44 UTC, sreimers
Details
Apply the same fix described in related bugs (659 bytes, patch)
2013-05-23 01:36 UTC, timfoster
Details | Diff
stacktrace (3.42 KB, text/plain)
2013-10-17 03:25 UTC, fortruth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Burjuy 2012-03-13 08:38:44 UTC
Build: NetBeans IDE Dev (Build 201203120400)
VM: OpenJDK 64-Bit Server VM, 20.0-b11, OpenJDK Runtime Environment, 1.6.0_23-b23
OS: Linux

User Comments:
GUEST: First thing after starting NetBeans, double-click a variable name to highlight, start typing.

I'm using the Python plugin.

GUEST: This happens whenever text is selected (variable names, in particular) and I attempt to type over them.

stefanocrosta: quotes around a selection

GUEST: I'm not sure when this came up, but I'm unable to replace highlighted sections of text by typing. I have to hit backspace first. Also when I hit backspace, instead of deleteing one character it goes back 4 characters.

stefanocrosta: add quotes to a text selection (python module is installed, but happens in any editing including html too)

GUEST: Changing variable, function, class, method etc.. names. Python plugin.




Stacktrace: 
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
   at java.lang.String.charAt(String.java:694)
   at org.netbeans.modules.gsf.GsfEditorKitFactory$GsfEditorKit$GsfDefaultKeyTypedAction.replaceSelection(GsfEditorKitFactory.java:299)
   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 Burjuy 2012-03-13 08:38:46 UTC
Created attachment 116643 [details]
stacktrace
Comment 2 Exceptions Reporter 2012-03-13 10:20:17 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=185407
Comment 3 Milutin Kristofic 2012-03-13 14:11:27 UTC
This is fixed in CSL here in Bug #208931 in Html it will be fixed in Bug #209019. You can easily fix it, reassigning to python
Comment 4 Exceptions Reporter 2012-03-26 11:41:03 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=185407
Comment 5 sreimers 2013-02-27 08:44:15 UTC
Created attachment 131943 [details]
stacktrace
Comment 6 timfoster 2013-05-23 01:36:02 UTC
Created attachment 134773 [details]
Apply the same fix described in related bugs

The attached patch works for me.
Comment 7 adam_felix_fps 2013-05-23 08:23:05 UTC
Thanks Tim.  I spoke to Petr Jiricka(Dev manager) previously about getting this integrated.  I will ask him again and see if we can get the patch added into main-golden.  It will be good to get the Python plugin at least functional again and then hopefully we can persuade some people to start working on improving it!
Comment 8 fortruth 2013-10-17 03:25:23 UTC
Created attachment 141184 [details]
stacktrace

open IDE, with a project open
Comment 9 Lou Dasaro 2015-05-26 02:36:08 UTC
Unable to replicate. This was likely fixed as a result of the GSF-to-CSL conversion. 
We are diligently working to improve Python support for NetBeans 8.1, and you can test our work in progress.
See "How to install new Development build(s) for testing" at http://forums.nbpython.org/viewtopic.php?f=6&t=69