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 10133 - StringIndexOutOfBoundException in org.netbeans.editor.Formatter
Summary: StringIndexOutOfBoundException in org.netbeans.editor.Formatter
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
: 10419 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-03-09 13:41 UTC by Kevin Septor
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Septor 2001-03-09 13:41:31 UTC
I was editing a plain text file containing an XML document.  I have noticed 
some very bizarre behavior in the editor before, but I thought it was just the 
auto-formatting at work and I was going to look into the annoyance later (it 
was just a small document).  Here's the issue..

<blah>
\t<one/>
\t<two>
\t\t<three/>
\t\t<four/>
\t</two>
</blah>

if the you place the cursor in front of the <three/> tag and hit backspace, it 
will jump back to be aligned with the <two> tag.  however, if you hit tab, it 
won't fly back to it's former position. it will stubbornly sit there.  you have 
to insert a new line above it, tab it over, and then backspace the <two/> tag 
up to it.  very annoying.

anyhow, while trying to do silly things like that to get around the problem the 
following error poped up so i'm thinking it's a bug and not a feature to try 
and line the tags up.


*********** Exception occurred ************
Fri Mar 09 08:33:43 EST 2001java.lang.StringIndexOutOfBoundsException: String 
index out of range: 2
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.charAt(String.java:507)
	at org.netbeans.editor.Formatter.insertTabString(Formatter.java:299)
	at org.netbeans.editor.BaseKit$InsertTabAction.actionPerformed
(BaseKit.java:824)
	at org.netbeans.editor.ext.ExtKit$ExtInsertTabAction.actionPerformed
(ExtKit.java:879)
	at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:126)
	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1702)
	at javax.swing.JComponent.processKeyBinding(JComponent.java:2156)
	at javax.swing.JComponent.processKeyBindings(JComponent.java:2182)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2119)
	at javax.swing.JEditorPane.processKeyEvent(JEditorPane.java:1159)
	at java.awt.Component.processEvent(Component.java:3555)
	at java.awt.Container.processEvent(Container.java:1164)
	at java.awt.Component.dispatchEventImpl(Component.java:2595)
	at java.awt.Container.dispatchEventImpl(Container.java:1213)
	at java.awt.Component.dispatchEvent(Component.java:2499)
	at java.awt.LightweightDispatcher.processKeyEvent(Container.java:2155)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2135)
	at java.awt.Container.dispatchEventImpl(Container.java:1200)
	at java.awt.Window.dispatchEventImpl(Window.java:912)
	at java.awt.Component.dispatchEvent(Component.java:2499)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
[catch] at java.awt.EventDispatchThread.pumpOneEvent
(EventDispatchThread.java:103)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
Comment 1 David Konecny 2001-03-29 08:28:06 UTC
Now it should be OK.
(fixed in Formatter.java 1.32.2.1)
Comment 2 David Konecny 2001-04-03 15:19:02 UTC
*** Issue 10419 has been marked as a duplicate of this issue. ***
Comment 3 Quality Engineering 2003-06-30 18:01:18 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 4 Quality Engineering 2003-06-30 18:10:05 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.