Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341707 - Report failure to instantiate model element
Summary: Report failure to instantiate model element
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-02 19:19 EDT by Konstantin Komissarchik CLA
Modified: 2021-11-19 09:22 EST (History)
1 user (show)

See Also:


Attachments

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