Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362121 - [Domainmodel Example] Template Proposals not working
Summary: [Domainmodel Example] Template Proposals not working
Status: VERIFIED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-26 14:10 EDT by Christian Dietrich CLA
Modified: 2011-10-29 05:02 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments
proposed patch (2.77 KB, patch)
2011-10-26 15:36 EDT, Michael Clay CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dietrich CLA 2011-10-26 14:10:24 EDT
Build Identifier: 2.1.0.v201110251848

Getting this stacktrace for op template


java.lang.NullPointerException
	at org.eclipse.xtext.ui.editor.templates.EnumTemplateVariableResolver.resolveValues(EnumTemplateVariableResolver.java:33)
	at org.eclipse.xtext.ui.editor.templates.AbstractTemplateVariableResolver.resolve(AbstractTemplateVariableResolver.java:35)
	at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:273)
	at org.eclipse.jface.text.templates.TemplateContextType.resolve(TemplateContextType.java:240)
	at org.eclipse.xtext.ui.editor.templates.XtextTemplateContext.evaluate(XtextTemplateContext.java:66)
	at org.eclipse.jface.text.templates.TemplateProposal.apply(TemplateProposal.java:160)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:930)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:881)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$27(CompletionProposalPopup.java:877)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$5.widgetDefaultSelected(CompletionProposalPopup.java:657)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:119)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613)
	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)

Reproducible: Always
Comment 1 Christian Dietrich CLA 2011-10-26 14:24:38 EDT
THe problem is that the grammar no longer contains the visibility enum. but the temlates still uses it.
Comment 2 Michael Clay CLA 2011-10-26 15:36:37 EDT
Created attachment 206028 [details]
proposed patch
Comment 3 Sebastian Zarnekow CLA 2011-10-26 15:42:18 EDT
Thanks for the patch. Looks good, please apply.
Comment 4 Jan Koehnlein CLA 2011-10-28 07:26:17 EDT
Patch applied. Thanks.