Project: aptanastudio
Issue APSTUD-4727: XML: StringIndexOutOfBoundsException: String index out of range in OpenTagCloser.getOpenTag()
Unfortunately not a repo case, but should be guarded against in code and a unit test added. {code} !ENTRY org.eclipse.ui 4 0 2012-04-13 16:34:06.939 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.StringIndexOutOfBoundsException: String index out of range: 0 java.lang.String.charAt(String.java:686) com.aptana.editor.xml.OpenTagCloser.getOpenTag(OpenTagCloser.java:286) com.aptana.editor.xml.OpenTagCloser.verifyKey(OpenTagCloser.java:93) org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:65) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:3783) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1398) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1383) org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1195) org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5957) org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5656) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) org.eclipse.swt.widgets.Display.sendEvent(Display.java:3783) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1398) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1383) org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1412) org.eclipse.swt.widgets.Control.insertText(Control.java:1831) org.eclipse.swt.widgets.Canvas.insertText(Canvas.java:245) org.eclipse.swt.widgets.Display.windowProc(Display.java:5073) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:56) org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587) org.eclipse.swt.widgets.Display.windowProc(Display.java:4985) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220) org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1959) org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2025) org.eclipse.swt.widgets.Display.windowProc(Display.java:5047) org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4589) org.eclipse.swt.widgets.Display.applicationProc(Display.java:4666) org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method) org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3281) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) com.aptana.rcp.IDEApplication.start(IDEApplication.java:125) org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620) org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) org.eclipse.equinox.launcher.Main.run(Main.java:1408) {code}
Story points: 5