eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[completeocl] Duplicate xmi:id P.ocl #1403

Closed eclipse-ocl-bot closed 4 hours ago

eclipse-ocl-bot commented 4 hours ago

| --- | --- | | Bugzilla Link | 450950 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Nov 11, 2014 08:36 EDT | | Modified | Nov 16, 2014 11:35 EDT | | Version | 5.0.0 | | Blocks | 446680 | | Reporter | Ed Willink |

Description

If a Complete OCL file (e.g. PivotNameResolution.ocl) defines complements for both package ocl (OCL Standard Library) and package pivot (the Pivot Metamodel) both are bnamed "ocl" and consequently any attempt to allocate URIs, when saving or also somewhat suspectly from an Xtext readonly() for a file change.

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Nov 11, 2014 14:33

Repro:

Open PivotNameResolution.ocl from ewillink/ocl25.\ Save As Concrete Syntax.

Problem is that Pivot loaded from Pivot.ecore as http://www.eclipse.org/ocl/3.1.0/Pivot is not unified with http://www.eclipse.org/ocl/3.1.0/OCL.oclstdlib leading to two "ocl" packages.

eclipse-ocl-bot commented 4 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 12, 2014 06:06

Hi

Unifying sounds frightening. How are you unifying two different packages with different names and different uris. Which name/uri are you going to use for the "unified" version ?

See Bug 441620 for more discussion. asanchez/441620 still contains a failing test case reproducing a presumably valid (at least, for one user) use case.

Regards,\ Adolfo.

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Nov 12, 2014 06:43

Runtime exceptions should be for real problems.

The duplicate xmi:ids is variously just a bad user model or a bad algorithm. The first must not be an ISE.

Therefore change from failing for duplicates to diagnosing that a potential duplicate is replaced by a random uuid. The diagnosis can be added to the ASResource.getErrors() where it can be detected by standard Resource.save validation.

Pushed to ewillink/ocl25

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Nov 12, 2014 06:47

(In reply to Adolfo Sanchez-Barbudo Herrera from comment #2)

Unifying sounds frightening.

Unifying is fundamental to modeling the OCL Standard LIbrarty with the pivit. The Boolean, Enumeration, Class types that are 'defined' in both Library and Metamodel must be the same classes.

How are you unifying two different packages with different names and different uris. Which name/uri are you going to use for the "unified" version ?

This is troublesome for master. One package has its name changed.

In ewillink/ocl25 the CompletePackage has the unified name and NsURI, the individual packages retain their natural name and nsURI which may or may not be distinct.

See Bug 441620 for more discussion. asanchez/441620 still contains a failing test case reproducing a presumably valid (at least, for one user) use case

Bug 441620 is resolved. If there is a bug there to open reopen with a clear description and repro of what the problem is.

eclipse-ocl-bot commented 4 hours ago

By Adolfo Sanchez-Barbudo Herrera on Nov 12, 2014 09:00

(In reply to comment #4)

See Bug 441620 for more discussion. asanchez/441620 still contains a failing test case reproducing a presumably valid (at least, for one user) use case

Bug 441620 is resolved. If there is a bug there to open reopen with a clear description and repro of what the problem is.

I pointed that bug, since I thought the issue was related/similar/the same (confusion with pivot/ocl packages). It was resolved as a work for you, which didn't work for me and didn't fixed the test case. The repro is just launch the test cases. If the test case is an incorrect use case, I'd expect a clear explanation why it's wrong ("The observation is perhaps more a surprise rather than a problem." is not convincing).

I'll give a try now to see if the test case runs successfully in current master and/or ewillink/ocl25.

Cheers,\ Adolfo.

eclipse-ocl-bot commented 4 hours ago

By Ed Willink on Nov 16, 2014 11:08

6 commits culminating in

commit 74064330d82a4fd52d382e68ccb6397bc917a426

pushed to master for M4.

As well as the immediate problem of xmi:ids, the illegal XMI:id string <> is avoided and throwing an ISE is avoided. Insterad all reports appear in Resource.errors.