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

Bug 352734

Summary: ConditionalComponent does not check the configuration of the "else"-component
Product: [Modeling] EMFT Reporter: Marc Schlienger <marc.schlienger>
Component: MWEAssignee: Karsten Thoms <karsten.thoms>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: christian.dietrich.opensource, karsten.thoms, sebastian.zarnekow
Version: 1.1Flags: sebastian.zarnekow: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Marc Schlienger CLA 2011-07-21 08:44:57 EDT
Build Identifier: org.eclipse.emf.mwe.core_1.1.0.v201106070424

Usually a component has the possibility to check its configuration and to perform specific tasks during the call to checkConfiguration. To say it differently, checkConfiguration has side effects, without saying that it is a good thing or a bad thing.

But...

due to the fact that "checkConfiguration()" is not called on the "elseComp" component of ConditionalComponent, some critical initialization might be missing.

I would suggest to override checkConfiguration in ConditionalComponent, with something like this:

	@Override
	public void checkConfiguration(Issues issues) throws ConfigurationException {
		super.checkConfiguration(issues);
		
		// Do not forget to check the config on the elseComp
		if (elseComp != null) {
			elseComp.checkConfiguration(issues);
		}
	}


Reproducible: Always
Comment 1 Sebastian Zarnekow CLA 2011-07-21 10:43:21 EDT
Good catch. Thanks for the report.
Comment 2 Karsten Thoms CLA 2011-08-22 15:53:28 EDT
Fixed and pushed to master.
Comment 3 Christian Dietrich CLA 2020-10-19 08:48:56 EDT
fixed somewhen in 2011