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

Bug 331653

Summary: NPE at org.eclipse.xtend.expression.TypeSystemImpl.getType(TypeSystemImpl.java:272)
Product: [Modeling] M2T Reporter: Philipp Zech <Philipp.Zech>
Component: XpandAssignee: Project Inbox <m2t.xpand-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: sven.efftinge
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Philipp Zech CLA 2010-12-02 06:40:20 EST
Build Identifier: M20100909-0800

during the evaluation of the following workflow component

<component id="StoryGenerator" class="org.eclipse.xpand2.Generator">
		<metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
			<metaModelPackage value="org.eclipse.emf.ecore.EcorePackage"/>	
		</metaModel>	
		<metaModel class="org.eclipse.xtend.typesystem.uml2.UML2MetaModel"/>
		<metaModel id="profile"
			class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
			<profile value="src/info/teststories/generator/profile/TTSProfile1.profile.uml"/>
		</metaModel>
		<expand value="info::teststories::generator::xpand::Teststory::Teststory FOR model"/>
		<outlet path="${projectLocation}/src/info/teststories/sut/stories"/>
		<beautifier class="org.eclipse.xpand2.output.JavaBeautifier"/>
	</component>

during the search of the best matching type for the input model (residing in "slot"), also the ProfileMetaModel is searched for a fitting type and following the internalProfileMetaModel is accessed, also with getType(); however, at this point internalProfileMetaModel is null, which actually leads to the NPE and aborts execution of the workflow.
interestingly, the NPE is not thrown if running the workflow inside an eclipse instance, however as soon as a standalone (host) eclipse is used, where the generator resides inside an exported plugin and is not loaded from the workspace of the host plugin, the exception is thrown.
the bug did not show up in the former oaw releases (affected project is currently ported from oaw 4.3.1 to MWE)
during debugging I also realized that inside the ProfileMetaModel the init() method actually is called, however, it returns at line 165 without initializing the stereotypes, as the profiles ArrayList is empty.

Reproducible: Sometimes

Steps to Reproduce:
1. use above workflow excerpt (replace profile by own one)
2. try to run the generator...
3.
Comment 1 Sven Efftinge CLA 2010-12-17 05:29:43 EST
Why did you close this bug?
Comment 2 Philipp Zech CLA 2010-12-17 06:43:41 EST
After hours of debugging I realized that the the bug was located somewhere in my code and just triggered itself down to ProfileMetaModel class where the NPE finally was thrown. Tthe origin of the bug was in my own, not Eclispe-related code.
(In reply to comment #1)
> Why did you close this bug?