Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342479 - NPE in EClassInfo.containsCompatibleFeature
Summary: NPE in EClassInfo.containsCompatibleFeature
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-11 13:55 EDT by Michael Clay CLA
Modified: 2017-09-19 17:17 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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