Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341557 - @XmlElementBinding.Mapping(element="", type=ISomething.class) should trigger exception
Summary: @XmlElementBinding.Mapping(element="", type=ISomething.class) should trigger ...
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-03-31 17:54 EDT by Shenxue Zhou CLA
Modified: 2021-11-19 09:21 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 Shenxue Zhou CLA 2011-03-31 17:54:50 EDT
element="" is illegal for the mapping annotation. But instead of pointing out this problem with a clear error message, Sapphire would throw the following exception:

Invalid Characer Error !STACK 0
org.w3c.dom.DOMException: Invalid Characer Error
	at org.eclipse.wst.xml.core.internal.document.DocumentImpl.createElementNS(DocumentImpl.java:400)
	at org.eclipse.sapphire.modeling.xml.XmlElement.addChildElement(XmlElement.java:531)
	at org.eclipse.sapphire.modeling.xml.XmlElement.addChildElement(XmlElement.java:559)
......
Comment 1 Konstantin Komissarchik CLA 2011-03-31 23:09:55 EDT
The illegal usage looks like the following examples:

@XmlElementBinding( mappings = @XmlElementBinding.Mapping( element = "", type = IMyElement.class ) )

@XmlListBinding( mappings = @XmlListBinding.Mapping( element = "", type = IMyElement.class ) )
Comment 2 Konstantin Komissarchik CLA 2011-03-31 23:12:06 EDT
Added a check and a better worded exception. Wrote two unit tests. The error messages look like this:

ITestXmlBinding0001ModelElement.TestProperty : Element name must be specified in @XmlElementBinding.Mapping annotation.

Should be pretty self-explanatory at this point.
Comment 3 Konstantin Komissarchik CLA 2011-03-31 23:12:18 EDT
Fixed.
Comment 4 Shenxue Zhou CLA 2011-04-01 18:36:32 EDT
Verified that there is a clear message for this case.