Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342438 - [xtend][richstring] NoSuchElementException in DefaultIndentationHandler
Summary: [xtend][richstring] NoSuchElementException in DefaultIndentationHandler
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-11 09:30 EDT by Maxim Frolov CLA
Modified: 2017-09-19 18:12 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
Xtend2 file causing exception in Xten2 editor (214 bytes, application/octet-stream)
2011-04-11 09:30 EDT, Maxim Frolov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Frolov CLA 2011-04-11 09:30:52 EDT
Created attachment 192928 [details]
Xtend2 file causing exception in Xten2 editor

Having the following content in Xtend2 Editor causes java.util.NoSuchElementException:

package x.y.z

import org.eclipse.emf.ecore.EObject

class Dummy {
	body(EObject object) {
		'''
			«FOR o : object.eContents»«"test123"»
			«ENDFOR»
			«FOR o : object.eContents»«"test123"»
			«ENDFOR»
		'''
	}	
}


The Xtend2 editor fails to open the file with error message: 

"Could not open the editor: An unexpected exception was thrown."

and exception stack trace:

java.util.NoSuchElementException
	at java.util.LinkedList.remove(LinkedList.java:788)
	at java.util.LinkedList.removeLast(LinkedList.java:144)
	at org.eclipse.xtext.xtend2.richstring.DefaultIndentationHandler.popIndentation(DefaultIndentationHandler.java:72)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor$Implementation.handleFirstLine(RichStringProcessor.java:173)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor$Implementation.caseRichStringLiteral(RichStringProcessor.java:133)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor$Implementation.caseRichStringLiteral(RichStringProcessor.java:1)
	at org.eclipse.xtext.xtend2.xtend2.util.Xtend2Switch.doSwitch(Xtend2Switch.java:167)
	at org.eclipse.xtext.xtend2.xtend2.util.Xtend2Switch.doSwitch(Xtend2Switch.java:83)
	at org.eclipse.xtext.xtend2.xtend2.util.Xtend2Switch.doSwitch(Xtend2Switch.java:69)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor$Implementation.doSwitch(RichStringProcessor.java:53)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor$Implementation.caseRichString(RichStringProcessor.java:64)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor$Implementation.caseRichString(RichStringProcessor.java:1)
	at org.eclipse.xtext.xtend2.xtend2.util.Xtend2Switch.doSwitch(Xtend2Switch.java:158)
	at org.eclipse.xtext.xtend2.xtend2.util.Xtend2Switch.doSwitch(Xtend2Switch.java:83)
	at org.eclipse.xtext.xtend2.xtend2.util.Xtend2Switch.doSwitch(Xtend2Switch.java:69)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor$Implementation.doSwitch(RichStringProcessor.java:53)
	at org.eclipse.xtext.xtend2.richstring.RichStringProcessor.process(RichStringProcessor.java:29)
	at org.eclipse.xtext.xtend2.ui.highlighting.RichStringHighlightingCalculator.highlightRichStrings(RichStringHighlightingCalculator.java:71)
	at org.eclipse.xtext.xtend2.ui.highlighting.RichStringHighlightingCalculator.provideHighlightingFor(RichStringHighlightingCalculator.java:58)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.MergingHighlightedPositionAcceptor.provideHighlightingFor(MergingHighlightedPositionAcceptor.java:48)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.reconcilePositions(HighlightingReconciler.java:87)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.modelChanged(HighlightingReconciler.java:275)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler$1.process(HighlightingReconciler.java:246)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler$1.process(HighlightingReconciler.java:1)
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:32)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:86)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.refresh(HighlightingReconciler.java:243)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingReconciler.install(HighlightingReconciler.java:197)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingHelper.enable(HighlightingHelper.java:75)
	at org.eclipse.xtext.ui.editor.syntaxcoloring.HighlightingHelper.install(HighlightingHelper.java:63)
	at org.eclipse.xtext.ui.editor.XtextEditor.installHighlightingHelper(XtextEditor.java:402)
	at org.eclipse.xtext.ui.editor.XtextEditor.createPartControl(XtextEditor.java:365)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
	at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
	at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
	at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:331)
	at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.java:179)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4150)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3739)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:344)
	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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

I use nightly build:
Xtext SDK 2.0.0.v201104110306
Comment 1 Sebastian Zarnekow CLA 2011-04-13 07:43:43 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 18:01:41 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 18:12:02 EDT
Closing all bugs that were set to RESOLVED before Neon.0