Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365620 - Content Model View gets NPE's if an element doesn't exist in the schema
Summary: Content Model View gets NPE's if an element doesn't exist in the schema
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-05 10:51 EST by Karen Butzke CLA
Modified: 2013-01-09 16:29 EST (History)
2 users (show)

See Also:


Attachments
NPE stack trace (5.24 KB, text/plain)
2011-12-05 15:33 EST, Karen Butzke CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2011-12-05 10:51:12 EST
With the new Content Model View open on an xml file, try typing in an element that doesn't exist in the schema. You will get the attached NPE multiple times.
Comment 1 David Carver CLA 2011-12-05 15:16:09 EST
Do you have a stack trace, and maybe a short example that can be used to reproduce the result?
Comment 2 Karen Butzke CLA 2011-12-05 15:33:21 EST
Created attachment 207944 [details]
NPE stack trace

Sorry, forgot to attach the file!

As an example, create a new xml file from an XML schema file. I chose an XML catalog entry and picked http://java.sun.com/xml/ns/j2ee/application_1_4.xsd . In the created xml file, begin to type in a new element "<f" and the attached NPE occurs. This is only if the Content Model view is open.
Comment 3 Karen Butzke CLA 2011-12-05 15:44:58 EST
I'm using e4 platform as well, not sure if that matters. I'm using wtp build 3.4.0-20111201045309
Comment 4 David Carver CLA 2011-12-05 15:46:41 EST
(In reply to comment #2)
> Created attachment 207944 [details]
> NPE stack trace
> 
> Sorry, forgot to attach the file!
> 
> As an example, create a new xml file from an XML schema file. I chose an XML
> catalog entry and picked http://java.sun.com/xml/ns/j2ee/application_1_4.xsd .
> In the created xml file, begin to type in a new element "<f" and the attached
> NPE occurs. This is only if the Content Model view is open.

Okay, so in this case, how do you want it to be displayed in the Content Model?  Should it be displayed as <unknown> or <any>?
Comment 5 Karen Butzke CLA 2012-01-12 16:47:19 EST
Seems I never responded to this, mainly because it doesn't really matter to me what is displayed in this case. Not sure what the functiuonal requirements should be. I just wanted to report that I was seeing this NPE which is easy to hit if you are hand editing an xml file. I will say that I like the new view overall!
Comment 6 Nick Sandonato CLA 2013-01-09 16:29:50 EST
Added a warning message to the view when the selected element is not in the content model.