eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot] Ecore2AS fails for oclstdlib.ecore #1622

Open eclipse-ocl-bot opened 3 hours ago

eclipse-ocl-bot commented 3 hours ago

| --- | --- | | Bugzilla Link | 479445 | | Status | NEW | | Importance | P3 major | | Reported | Oct 09, 2015 11:32 EDT | | Modified | Nov 08, 2015 12:04 EDT | | Reporter | Ed Willink |

Description

oclstdlib.ecore uses some OCL-specific classes such as AnyType and VoidType.

Ecore2AS converts these to null, which gives an NPE.

a) Ecore2AS should translate old Classic OCL to Pivot OCL.

b) the NPE in similar situations should be less fatal.

java.lang.NullPointerException\ at org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal.refreshList(PivotUtilInternal.java:600)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2ASDeclarationSwitch.doSwitchAll(Ecore2ASDeclarationSwitch.java:776)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2ASDeclarationSwitch.caseEPackage(Ecore2ASDeclarationSwitch.java:419)\ at org.eclipse.emf.ecore.util.EcoreSwitch.doSwitch(EcoreSwitch.java:188)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2ASDeclarationSwitch.doInPackageSwitch(Ecore2ASDeclarationSwitch.java:766)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2AS.update(Ecore2AS.java:822)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2AS.importObjects(Ecore2AS.java:482)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2AS.getASModel(Ecore2AS.java:317)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2AS.getASOfEcore(Ecore2AS.java:338)\ at org.eclipse.ocl.pivot.internal.ecore.es2as.Ecore2AS.getCreated(Ecore2AS.java:411)\ at org.eclipse.ocl.pivot.internal.manager.PivotMetamodelManager.getASOfEcore(PivotMetamodelManager.java:827)

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Nov 02, 2015 05:27

This is blocking QVTo pivot work.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Nov 02, 2015 14:34

(In reply to Ed Willink from comment #0)

oclstdlib.ecore uses some OCL-specific classes such as AnyType and VoidType.

(See also Bug 479880)

Unavoidably co-existence of Classic OCL and Pivot OCL in the same class requires a new org.eclipse.ocl.pivot.ecoreocl plugin for the double dependence. Integration with the Pivot code base needs an extension point. The ASResourceFactory is not suitable.

A new Ecore2ASHelper can support Classic OCL and EMF Profile to Pivot. It may also simplify UML2AS.

eclipse-ocl-bot commented 3 hours ago

By Ed Willink on Nov 08, 2015 12:04

It is not clear that an ability to translate the Classic oclstdlib.ecore to PIvot is necessary. The Classic oclstdlib.ecore should be loaded as *.ecore and so load conventionally.

What is needed is a generic old declaration to new declaration synthesis.

--

An extension point may be helpful for EMF profiles driven by the variant 'Ecore' nsURI. This is much harder for the Classic OCL Standard Library where the need for a variant converter can only be discovered by pre-analyzing the EClasses/EAnnotations; an unpleasant overhead that would impact all Ecore loading.

Most of this is on ewillink/479445.