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

Bug 341707

Summary: Report failure to instantiate model element
Product: z_Archived Reporter: Konstantin Komissarchik <konstantin>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ling.hao
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Konstantin Komissarchik CLA 2011-04-02 19:19:43 EDT
ModelElementType.instantiate() method returns null if the type's implementation class is not found or cannot otherwise be instantiated. This makes it difficult to figure out the cause of the problem (missing type impl class) when calling code subsequently fails with a NullPointerException, often far from original instantiation.

The instantiate method should instead throw an exception in this case. The exception message should include the name of the type that could not be instantiated.
Comment 1 Konstantin Komissarchik CLA 2011-04-02 19:29:31 EDT
Implemented the exception and a corresponding unit test TestMisc0001.
Comment 2 Ling Hao CLA 2011-06-10 13:14:15 EDT
Verified in unit test.