Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330096

Summary: [Autoedit] Auto edit causes logged exception
Product: [Modeling] TMF Reporter: Henrik Lindberg <henrik.lindberg>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: 1.0.1Flags: sebastian.zarnekow: indigo+
Target Milestone: M7   
Hardware: All   
OS: All   
Whiteboard:

Description Henrik Lindberg CLA 2010-11-12 09:59:20 EST
In b3, given the simple input:

unit a ;

Selecting the 'a' and then typing a double quote causes the following exception to be logged:

455553 [Thread-0] ERROR org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy  - Exception in AutoEditStrategy
org.eclipse.jface.text.BadLocationException
	at org.eclipse.jface.text.AbstractDocument.get(AbstractDocument.java:1038)
	at org.eclipse.xtext.ui.editor.autoedit.AbstractEditStrategy.getDocumentContent(AbstractEditStrategy.java:60)
	at org.eclipse.xtext.ui.editor.autoedit.SameTerminalsEditStrategy.customizeDocumentCommand(SameTerminalsEditStrategy.java:32)
	at org.eclipse.xtext.ui.editor.autoedit.DefaultAutoEditStrategy.customizeDocumentCommand(DefaultAutoEditStrategy.java:67)
	at org.eclipse.jface.text.TextViewer.customizeDocumentCommand(TextViewer.java:3748)
	at org.eclipse.jface.text.TextViewer.handleVerifyEvent(TextViewer.java:3778)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.handleVerifyEvent(ProjectionViewer.java:1277)
	at org.eclipse.jface.text.TextViewer$TextVerifyListener.verifyText(TextViewer.java:433)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:255)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:7136)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:7975)
	at org.eclipse.swt.custom.StyledText.doContent(StyledText.java:2456)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5928)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5958)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5652)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3776)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1404)
	at org.eclipse.swt.widgets.Control.insertText(Control.java:1808)
	at org.eclipse.swt.widgets.Canvas.insertText(Canvas.java:245)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5066)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:56)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:587)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4978)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1943)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2008)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5040)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4582)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4659)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3274)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2624)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2588)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2422)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at com.cloudsmith.publish.publisher.Application.start(Application.java:22)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:369)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

It survives this, because AbstractEditStrategy.getDocumentContent(..) catches and logs the error.
Comment 1 Sebastian Zarnekow CLA 2011-04-07 08:51:06 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 17:08:27 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:19:58 EDT
Closing all bugs that were set to RESOLVED before Neon.0