eclipse-qvtd / org.eclipse.qvtd

Eclipse Public License 2.0
0 stars 0 forks source link

[qvts] Bad ClassDatum.completeClasses multiplicity/transient #409

Open eclipse-qvtd-bot opened 2 weeks ago

eclipse-qvtd-bot commented 2 weeks ago

| --- | --- | | Bugzilla Link | 551443 | | Status | NEW | | Importance | P3 normal | | Reported | Sep 25, 2019 04:00 EDT | | Modified | Oct 01, 2019 12:36 EDT | | See also | 551415 | | Reporter | Ed Willink |

Description

Loading a .qvtsas in the Sample Ecore EDitor gives numerous problems because ClassDatum.completeClasses is [1...] and transient. Since transient, nothing is serialized, so the [1..*] is violated (unless a smart loader rediscovers them). (EMF could perhaps give a warning, but if there is a smart loader that would be a false warning.)

The DatumCaches maintain ClassDatum.completeClasses in conjunction with a completeClass2classDatum map. Looks like a bad 'optimization' refactoring. Move ClassDatum.completeClasses to DatumCaches.

Add a *.qvtsas load test to detect this bug.

eclipse-qvtd-bot commented 2 weeks ago

By Ed Willink on Sep 30, 2019 03:32

(In reply to Ed Willink from comment #0)

Add a *.qvtsas load test to detect this bug.

A separate test requires an example *.qvtsas to be moved to the test sources with manual correction of trelative references. Fragile and needing repeating every QVTs model upgrade.

Better to add a load check to every non-CG QVTr compile test. (CG toowould just be bloat.)

eclipse-qvtd-bot commented 2 weeks ago

By Ed Willink on Oct 01, 2019 06:34

(In reply to Ed Willink from comment #0)

The DatumCaches maintain ClassDatum.completeClasses in conjunction with a completeClass2classDatum map. Looks like a bad 'optimization' refactoring. Move ClassDatum.completeClasses to DatumCaches.

Not so easy. The bad 'optimization' refactoring merged ClassDatumAnalysis into ClassDatum which is available for e.g. NavigationEdge conformsTo checks. IIRC the separate ClassDatum / ClassDatumAnalysis made navigation from model-level algorithms to the extra analysis painful.

For now just chnabge the lowerbound to [0..*] to make the problem go away.

Re-introducing ClassDatumAnalysis needs a lot of study solely to provide a richer load of a *.qvtsas. Who does that anyway?

eclipse-qvtd-bot commented 2 weeks ago

By Ed Willink on Oct 01, 2019 07:54

(In reply to Ed Willink from comment #2)

For now just change the lowerbound to [0..*] to make the problem go away.

and ...

CollectionClassDatum.elementalClassDatum\ MappingPartition.region\ NavigationEdge.referredProperty\ Symbolable.symbolName\ VariableNode.referredVariable

and

MappingPartition.rootPartition

is dead

eclipse-qvtd-bot commented 2 weeks ago

By Ed Willink on Oct 01, 2019 12:35

Simple fix pushed to master for 2019-12M1; *.qvtsas shows sensibly.

Still to do.

Review all QVTschedule.ecore transient properties.

Reconsider ClassDatumAnalysis etc to host all transient properties.