Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342030 - [Xtend][AutoEdit] Editor says "String index out of range" when pasting into RichString
Summary: [Xtend][AutoEdit] Editor says "String index out of range" when pasting into R...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-06 10:23 EDT by Robert von Massow CLA
Modified: 2017-09-19 17:14 EDT (History)
1 user (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert von Massow CLA 2011-04-06 10:23:30 EDT
Build Identifier: 

I have the following XtendFunction

genPlainText(Object this){
	''''''
}

Now I try to paste some string of the form "foo.bar" (dot-separated FQN) into the RichString. The editor fails with the message: "String index out of range: 16" for this example.

The Stacktrace is given below:

java.lang.StringIndexOutOfBoundsException: String index out of range: 16
	at java.lang.String.substring(String.java:1765)
	at org.eclipse.xtext.ui.editor.autoedit.PartitionEndSkippingEditStrategy.internalCustomizeDocumentCommand(PartitionEndSkippingEditStrategy.java:42)
	at org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy.customizeDocumentCommand(AbstractEditStrategy.java:41)
	at org.eclipse.jface.text.TextViewer.customizeDocumentCommand(TextViewer.java:3734)
	at org.eclipse.jface.text.TextViewer.handleVerifyEvent(TextViewer.java:3764)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.handleVerifyEvent(ProjectionViewer.java:1276)
	at org.eclipse.jface.text.TextViewer$TextVerifyListener.verifyText(TextViewer.java:433)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1025)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:6605)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7446)
	at org.eclipse.swt.custom.StyledText.paste(StyledText.java:6693)
	at org.eclipse.jface.text.TextViewer.paste(TextViewer.java:4026)
	at org.eclipse.jface.text.TextViewer.doOperation(TextViewer.java:3970)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:921)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1533)
	at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:131)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:129)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:824)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:880)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:569)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:510)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:125)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1467)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1175)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1212)
	at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:706)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2837)
	at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:703)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1570)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4594)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4191)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:7603)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1185)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1860)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3110)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


Reproducible: Always
Comment 1 Sebastian Zarnekow CLA 2011-04-06 13:04:49 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 17:03:18 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:14:52 EDT
Closing all bugs that were set to RESOLVED before Neon.0