| Summary: | XMLResource cannot save an empty resource | ||
|---|---|---|---|
| Product: | [Modeling] EMF | Reporter: | Bryan Hunt <bhunt> |
| Component: | XML/XMI | Assignee: | Ed Merks <Ed.Merks> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 2.5.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Bryan Hunt
SAX can't parse an empty file so it's good for save to fail one way or another. In this case, it doesn't make sense to write a header with empty content? If that's the case, it might be nice to have a better exception ... something like:
if(contents.isEmpty())
throw new IOException("Cannot save a resource with no contents");
No, an XML resource must have a single root element. For all I know, someone already catches an index out of bounds exception so while I agree that a descriptive message would be a marginal improvement, the current failure is pretty obvious as well. In fact, this is really a smaller problem than the fact that if you have more than one element, only the first is saved and the rest are silently ignored... |