eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[MARTE] NPE when evaluating ocl on stereotype from MARTE Profile #1455

Closed eclipse-ocl-bot closed 2 hours ago

eclipse-ocl-bot commented 2 hours ago

| --- | --- | | Bugzilla Link | 460316 | | Status | RESOLVED WONTFIX | | Importance | P3 normal | | Reported | Feb 19, 2015 04:47 EDT | | Modified | Jun 03, 2015 17:00 EDT | | Version | 5.0.0 | | Reporter | Tristan Faure |

Description

MARTE (v1.0.1) is an UML static profile downloadable through papyrus extra update site.

when an ocl rule is evaluated on an instance of a marte stereotype application element an NPE is raised (see end of the message)

After analysis this is caused because OCL pivot makes a PackageServer symetrical representation of Profile\ But MARTE is composed in this way :

therefore in OCL Package Servers are composed in this way

So when the method assertPackage is called, OCL detects something incoherent.

OCL shall manage this particular but authorized situation

Caused by: java.lang.NullPointerException\ at org.eclipse.ocl.examples.pivot.manager.RootPackageServer.assertSamePackage(RootPackageServer.java:43)\ at org.eclipse.ocl.examples.pivot.manager.NestedPackageServer.assertSamePackage(NestedPackageServer.java:42)\ at org.eclipse.ocl.examples.pivot.manager.NestedPackageServer.assertSamePackage(NestedPackageServer.java:42)\ at org.eclipse.ocl.examples.pivot.manager.PackageManager.getPackageServer(PackageManager.java:449)\ at org.eclipse.ocl.examples.pivot.manager.PackageManager.getTypeServer(PackageManager.java:587)\ at org.eclipse.ocl.examples.pivot.manager.MetaModelManager.getTypeServer(MetaModelManager.java:2580)\ at org.eclipse.ocl.examples.pivot.manager.MetaModelManager.getPrimaryType(MetaModelManager.java:2298)\ at com.airbus.tamore.core.MetamodelManagerDecorator.getPrimaryType(MetamodelManagerDecorator.java:845)\ at com.airbus.tamore.core.MetamodelManagerDecorator.getPrimaryType(MetamodelManagerDecorator.java:845)\ at org.eclipse.ocl.examples.pivot.manager.PivotIdResolver.getType(PivotIdResolver.java:189)\ at org.eclipse.ocl.examples.library.executor.AbstractIdResolver.getStaticTypeOf(AbstractIdResolver.java:671)\ at org.eclipse.ocl.examples.pivot.manager.PivotIdResolver.getStaticTypeOf(PivotIdResolver.java:123)\ at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:690)\ at org.eclipse.ocl.examples.pivot.internal.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:426)\ at org.eclipse.ocl.examples.pivot.evaluation.EvaluationVisitorImpl.safeVisit(EvaluationVisitorImpl.java:195) ... 3 more

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Feb 19, 2015 04:54

You should not use OCL 5.0.0 for UML. 5.0.1 came out instantly. 5.0.3 and imminently 5.0.4 is better.

Many of these problems stem from inconsistent URIs and nsURIs. The OCL support is generally unhappy if a URI is null or blank. Different profile nsURIs from Package URIs are also troublesome; leading to assertSamePackage to fail because the Ecore and UML are inconsistent.

So in your models make sure you define a URI, and raise a bug for any URI-less papyrus models. Some are fixed in Luna SR2. There is some mitigation for Mars.

eclipse-ocl-bot commented 2 hours ago

By Tristan Faure on Feb 19, 2015 05:07

I understand your remark and I just tried with 5.0.3\ the problem with MARTE is not problem of inconsistent URIs. In MARTE URIs are correctly filled but there is a package created just for containment (with no epackage stereotype and it is not a profile).

I will ask Papyrus community why they have made this, but in my opinion OCL should handle this profile organization

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Feb 19, 2015 05:42

You can't reopen without providing a concrete example of your strange models that do not work.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on May 23, 2015 12:14

(In reply to Ed Willink from comment #3)

You can't reopen without providing a concrete example of your strange models that do not work.

No repro. Nothing to do.

eclipse-ocl-bot commented 2 hours ago

By Ed Willink on Jun 03, 2015 17:00

See Bug 457206.

There is already an OCL JUnit test that tries to load the MARTE profile

org.eclipse.ocl.examples.consumers.tests.ConsumerLoadTests.testLoad_Bug457203_ocl

It fails because the MARTE profile has unresolved proxies.

Once the MARTE profile is loadable, further bugs may be uncovered.