Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346804 - [metatype] Error parsing xml with empty <MetaData/> element
Summary: [metatype] Error parsing xml with empty <MetaData/> element
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: Juno   Edit
Assignee: John Ross CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 350201
  Show dependency tree
 
Reported: 2011-05-22 01:16 EDT by Jarek Gawor CLA
Modified: 2011-07-01 15:29 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (14.34 KB, patch)
2011-06-30 18:52 EDT, John Ross CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jarek Gawor CLA 2011-05-22 01:16:06 EDT
Build Identifier: 

As according the http://www.osgi.org/xmlns/metatype/v1.1.0 schema an empty <MetaData/> should be supported (the OCD, Designate, xsd:any element have all minOccurs="0"). However, the implementation will report the following error when parsing an empty <MetaData/> element: 

[ERROR ] DataParser.finished() Missing element Designate (Reference ID = <missing argument>. Bundle:org.eclipse.equinox.metatype(id=12)



Reproducible: Always
Comment 1 John Ross CLA 2011-05-23 08:58:30 EDT
Targeting this for 3.8.

It's true that an empty <MetaData/> element is technically correct albeit completely useless. What do you think the desired behavior would be when encountering one? Process it silently or issue a message at some level in order to protect users from themselves?
Comment 2 Thomas Watson CLA 2011-05-23 09:03:37 EDT
I would issue at least a warning.  What is the reason to have an empty <MetaData/> element?  I agree with John, this seems like it would be useless to do.
Comment 3 Jarek Gawor CLA 2011-05-23 11:25:27 EDT
It might be useless but it's not an error. So getting a warning message instead of an error would be great.
Comment 4 Thomas Watson CLA 2011-06-08 11:28:25 EDT
Move all 3.8 bugs to Juno.
Comment 5 John Ross CLA 2011-06-30 17:33:11 EDT
Note the conversation occuring in bug 350201 is applicable here too. If a bundle only contains metadata files with an empty <MetaData/> element, it will act as if it had no metadata and be converted into a tracker.
Comment 6 John Ross CLA 2011-06-30 18:52:34 EDT
Created attachment 198941 [details]
proposed patch

This patch simple changes the log level from error to warning. Note this patch also includes bug 350201.
Comment 7 John Ross CLA 2011-07-01 15:29:56 EDT
Patch released.