eclipse-qvtd / org.eclipse.qvtd

Eclipse Public License 2.0
0 stars 0 forks source link

[qvtc2qvtu] enforced defaults are inadequately transformed #259

Open eclipse-qvtd-bot opened 1 day ago

eclipse-qvtd-bot commented 1 day ago

| --- | --- | | Bugzilla Link | 510063 | | Status | NEW | | Importance | P3 normal | | Reported | Jan 07, 2017 07:50 EDT | | Modified | Jan 07, 2017 09:15 EDT | | See also | 510032 | | Reporter | Ed Willink |

Description

QVTc2QVTu converts check-defaults to predicates. But leaves enforce-defaults unchanged.

Surely the "default" should be removed leaving a full assigmnent?

In SimpleUML2RDBMS.qvtu.qvtcas the conversion results in

default fc.foreignKeys := OrderedSet(SimpleRDBMS::ForeignKey){fk};\ fc.foreignKeys->includes(fk);

The includes predicate is redundant and should probably be removed. For a 'Set' the initialization plus assignment has no effect (apart possibly on order). For a non-'Set' initialization and assignment will result in a dual entry.

eclipse-qvtd-bot commented 1 day ago

By Ed Willink on Jan 07, 2017 09:07

http://issues.omg.org/browse/QVT14-46 suggests that

parent.children := aChild

is a partial assignment of aChild to parent.children. This eliminates the neec for magic ->includes() as an assignment.