Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357962 - [EMF Runtime Extensions] Make sure that problems occurring when saving model elements in a new resource are not recorded as errors/warnings on resource
Summary: [EMF Runtime Extensions] Make sure that problems occurring when saving model ...
Status: CLOSED FIXED
Alias: None
Product: Sphinx
Classification: Automotive
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 0.7.0   Edit
Assignee: Stephan Eberle CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 12:34 EDT by Stephan Eberle CLA
Modified: 2021-07-14 02:14 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Eberle CLA 2011-09-16 12:34:47 EDT
= Problem description =
Currently, org.eclipse.sphinx.emf.util.EcoreResourceUtil.loadModelResource(ResourceSet, URI, Map<?, ?>, boolean) and org.eclipse.sphinx.emf.util.EcoreResourceUtil.saveModelResource(Resource, Map<?, ?>) record exceptions raised during load or save operation as errors on the the affected model resource. These errors are subsequently translated into problem markers, attached to the underlying file and thus become visible in the Problems view.

While this behavior makes sense for already existing resources that are loaded or saved it doesn't make much sense on new resources being created and saved for the first time. If exceptions are raised in that case, the underlying file will never be created. So, there won't be any target for attaching the problem markers created from the errors recorded on the model resource. Users just notice that nothing has happened but neither Problems view nor Error Log view give any hint about what went wrong.

= Resolution approach =
Make sure that exceptions raised when saving model resources are only recorded as errors on model resource when the latter already exists (i.e., in case when EcoreResourceUtil#saveModelResource() is directly called by clients). Log raised exceptions in error log instead when saving models to new resources (i.e., in case when EcoreResourceUtil#saveNewModelResource() is called).
Comment 1 Stephan Eberle CLA 2011-09-16 12:36:39 EDT
Fixed as proposed in description.
Comment 2 Balazs Grill CLA 2021-07-14 02:14:51 EDT
Mass-closing Resolved tickets