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

Bug 365433

Summary: [Xtend] quickfix to add xtend2.lib throws NPE on plain Java project
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: jan, sven.efftinge, tmf.xtext-inbox
Version: 2.2.0Flags: moritz.eysholdt: juno+
Target Milestone: M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Moritz Eysholdt CLA 2011-12-02 09:24:38 EST
If you execute the quickfix that adds xbase.lib and xtend2.lib to a the class path and the your project is a plain Java project (not a Plug-In Project), the exception below is thrown in the host-workbench's console.


!STACK 0
java.lang.NullPointerException
	at org.eclipse.xtext.xtend2.ui.buildpath.XtendLibClasspathAdder.addToPluginManifest(XtendLibClasspathAdder.java:73)
	at org.eclipse.xtext.xtend2.ui.buildpath.XtendLibClasspathAdder.addLibsToClasspath(XtendLibClasspathAdder.java:47)
	at org.eclipse.xtext.xtend2.ui.quickfix.Xtend2QuickfixProvider$13.apply(Xtend2QuickfixProvider.java:534)
	at org.eclipse.xtext.ui.editor.model.edit.SemanticModificationWrapper$1.process(SemanticModificationWrapper.java:35)
	at org.eclipse.xtext.ui.editor.model.edit.SemanticModificationWrapper$1.process(SemanticModificationWrapper.java:1)
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36)
	at org.eclipse.xtext.ui.editor.model.edit.ReconcilingUnitOfWork.exec(ReconcilingUnitOfWork.java:37)
	at org.eclipse.xtext.ui.editor.model.edit.ReconcilingUnitOfWork.exec(ReconcilingUnitOfWork.java:1)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.modify(AbstractReadWriteAcces.java:49)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:181)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:90)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.modify(XtextDocument.java:83)
	at org.eclipse.xtext.ui.editor.model.edit.SemanticModificationWrapper.apply(SemanticModificationWrapper.java:31)
	at org.eclipse.xtext.ui.editor.quickfix.IssueResolution.apply(IssueResolution.java:60)
	at org.eclipse.xtext.ui.editor.quickfix.QuickAssistCompletionProposal.apply(QuickAssistCompletionProposal.java:32)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:935)
	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.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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)
Comment 1 Moritz Eysholdt CLA 2011-12-02 09:26:04 EST
and... the libs are not being added to the classpath.
Comment 2 Jan Koehnlein CLA 2011-12-02 09:33:47 EST
I suppose your "plain Java project" still has the plugin nature. 
Nevertheless, the fix should not throw exceptions.
Comment 3 Jan Koehnlein CLA 2011-12-02 09:46:10 EST
Pushed to MASTER.
Comment 4 Karsten Thoms CLA 2017-09-19 17:56:00 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:06:45 EDT
Closing all bugs that were set to RESOLVED before Neon.0