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

Bug 342479

Summary: NPE in EClassInfo.containsCompatibleFeature
Product: [Modeling] TMF Reporter: Michael Clay <clay>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: RC1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Michael Clay CLA 2011-04-11 13:55:35 EDT
existingFeature.getEType() is NULL in errorMessage.append("The existing feature '" + name + "' has an incompatible type '" + existingFeature.getEType().getName() + "'.");


java.lang.NullPointerException
	at org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo$EClassInfo.containsCompatibleFeature(EClassifierInfo.java:178)
	at org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo$EClassInfo.addFeature(EClassifierInfo.java:242)
	at org.eclipse.xtext.xtext.ecoreInference.EClassifierInfo$EClassInfo.addFeature(EClassifierInfo.java:111)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreInterpretationContext.addFeature(Xtext2EcoreInterpretationContext.java:122)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreInterpretationContext.addFeature(Xtext2EcoreInterpretationContext.java:91)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer$3.caseAssignment(Xtext2EcoreTransformer.java:393)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer$3.caseAssignment(Xtext2EcoreTransformer.java:1)
	at org.eclipse.xtext.util.XtextSwitch.doSwitch(XtextSwitch.java:164)
	at org.eclipse.xtext.util.XtextSwitch.doSwitch(XtextSwitch.java:70)
	at org.eclipse.xtext.util.XtextSwitch.doSwitch(XtextSwitch.java:58)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer.deriveFeatures(Xtext2EcoreTransformer.java:458)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer.deriveFeatures(Xtext2EcoreTransformer.java:477)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer.deriveFeatures(Xtext2EcoreTransformer.java:315)
	at org.eclipse.xtext.xtext.ecoreInference.Xtext2EcoreTransformer.transform(Xtext2EcoreTransformer.java:142)
	at org.eclipse.xtext.xtext.XtextLinker.linkModel(XtextLinker.java:218)
	at org.eclipse.xtext.resource.XtextResource.doLinking(XtextResource.java:254)
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLinking(LazyLinkingResource.java:76)
	at org.eclipse.xtext.resource.XtextResource.updateInternalState(XtextResource.java:220)
	at org.eclipse.xtext.resource.XtextResource.update(XtextResource.java:210)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconcilerUnitOfWork.process(XtextReconcilerUnitOfWork.java:50)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconcilerUnitOfWork.process(XtextReconcilerUnitOfWork.java:1)
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.modify(AbstractReadWriteAcces.java:49)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:187)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:98)
	at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(XtextDocumentReconcileStrategy.java:27)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(XtextReconciler.java:233)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Sebastian Zarnekow CLA 2011-04-11 14:21:35 EDT
Could you please provide a grammar snippet that allows to reproduce the issue?
Comment 2 Michael Clay CLA 2011-04-11 15:08:22 EDT
no..since the reason for this NPE was an (overlooked) error in my referenced test ecore file (a Reference without an EType set)...maybe we should close this bug as wontfix?..sorry for the noise.

(In reply to comment #1)
> Could you please provide a grammar snippet that allows to reproduce the issue?
Comment 3 Sebastian Zarnekow CLA 2011-04-11 15:23:11 EDT
We should fix this bug since incomplete ecore models should not cause an NPE in Xtext.
Comment 4 Sebastian Zarnekow CLA 2011-05-04 06:11:31 EDT
Preliminary scheduled for 2.0RC1
Comment 5 Sven Efftinge CLA 2011-05-11 11:03:51 EDT
pushed to master
Comment 6 Karsten Thoms CLA 2017-09-19 17:05:34 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 7 Karsten Thoms CLA 2017-09-19 17:17:26 EDT
Closing all bugs that were set to RESOLVED before Neon.0