Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345632 - NPE in XmlElementDefinitionByReference
Summary: NPE in XmlElementDefinitionByReference
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: Ling Hao CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 13:42 EDT by Greg Amerson CLA
Modified: 2021-11-19 09:22 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Amerson CLA 2011-05-12 13:42:39 EDT
With my sapphire model that I've been using for several weeks all of a sudden (with latest updates) stopped working when trying to add a particular child element.  Not every child element fails to be able to be inserted but sometimes I get a NPE down in XmlElementDefinitionByReference.  here is where I'm seeing it:

line 92
final XmlElementDefinition definition = getSchema().getElement(getName().getLocalPart());

This is sometimes returning a null value and the very next line will throw the NPE and this prevents the new child node from being added in the masterDetail page:
if (definition.isAbstract()) {

When I change this to add a null check everything seems to work ok.  Sapphire is able to insert the new child element in the UI and in the source.
if (definition != null && definition.isAbstract()) {
Comment 1 Ling Hao CLA 2011-05-12 14:42:08 EDT
Fix checked in. 
Greg, I would appreciate it if you can verify my fix. Thanks!
Comment 2 Greg Amerson CLA 2011-05-12 15:53:07 EDT
Verified NPE is fixed with build#336
Comment 3 Konstantin Komissarchik CLA 2011-05-12 17:04:59 EDT
Closing. Thanks for the problem report and verification.