Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 397758 - [PapyrusCore] ModelSet should be more extensible
Summary: [PapyrusCore] ModelSet should be more extensible
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.10.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Arthur Daussy CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-09 08:07 EST by Arthur Daussy CLA
Modified: 2013-03-20 11:31 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Daussy CLA 2013-01-09 08:07:12 EST
The current implementation of the model set do not allow overriding.
Comment 1 Arthur Daussy CLA 2013-01-09 08:10:14 EST
Comitted on 0.8.X branch.
rev -> 9754
Comment 2 Mathieu Velten CLA 2013-03-18 10:19:51 EDT
fixed on trunk, rev10551
Comment 3 Mathieu Velten CLA 2013-03-18 10:22:50 EDT
remove backport tag
Comment 4 Camille Letavernier CLA 2013-03-20 11:30:01 EDT
r10626:

I've removed the "throw exception" in one specific case. Papyrus doesn't fully support read only (It may happen that a specific action changes a read only element, although I don't know why). Thus, the following lines in ModelSet:

if(authorizeSave.isPresent() && !authorizeSave.get()) {
		monitor.done();
		throw new IOException("Some modified resources are read-only : the model can't be saved");
}

prevents saving the model. Instead of potential model corruption, we have systematic data loss (i.e. cannot save, and we don't even know it/why).

Especially, I have this exception when trying to save a simple model with a local profile applied. I open the model, move a class, save: OK. I create a Class, save: read-only save exception.

In some (unidentified) cases, this "throw exception" can make the editor unusable. On the other hand, it is really unlikely that we actually modified StandardL3 by creating a simple Class, so saving is probably safe.

Actions to be taken:

- Warn the user instead of throwing a silent exception
- Understand why the StandardL3 has been modified

In the specific case of applied profiles (Either local or static), it is not possible to make the resource writable (Simply because the ReadOnlyHandler doesn't permit it, even for local profiles: it doesn't make sense to modify the applied profile from the applying model).
Comment 5 Camille Letavernier CLA 2013-03-20 11:31:46 EDT
Note: this comment actually applied to Bug 396735. I re-close this task. Sorry :)