eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[Library] Unexpected OclStdlib reset causes failures for QVTo CS2AS CGed transformation #1509

Open eclipse-ocl-bot opened 2 months ago

eclipse-ocl-bot commented 2 months ago

| --- | --- | | Bugzilla Link | 466620 | | Status | NEW | | Importance | P3 normal | | Reported | May 06, 2015 13:21 EDT | | Modified | Aug 10, 2017 10:26 EDT | | See also | 520847 | | Reporter | Adolfo Sanchez-Barbudo Herrera |

Description

OCL: master\ QVTd: asanchez/libraryIssue \ QVTo: asanchez/397429

To reproduce:

  1. execute GenerateQVTOperationalEditor.mwe2 [1]
  2. you get an exception [2]

Giving that QVTd test cases pass, which also involve generation of CGed QVTi transformations from CS2AS descriptions, I believe that the failure comes when the CS2AS description imports the pivot.ecore meta-model.

[1] org.eclipse.qvto.examples.build\src\org\eclipse\qvto\examples\build\GenerateQVTOperationalEditor.mwe2 \ [2] [ERROR]: Error while executing org.eclipse.qvtd.cs2as.build.mwe.GenerateCGedQVTiTransformation(Element: -UNKNOWN-; Reported by: GenerateCGedQVTiTransformation)\ java.lang.NullPointerException\ at org.eclipse.qvtd.pivot.qvtimperative.evaluation.QVTiTransformationAnalysis.analyzeTransformation(QVTiTransformationAnalysis.java:125)\ at org.eclipse.qvtd.codegen.qvti.java.QVTiCodeGenerator.getTransformationAnalysis(QVTiCodeGenerator.java:176)\ at org.eclipse.qvtd.codegen.qvti.analyzer.QVTiAS2CGVisitor.visitPropertyAssignment(QVTiAS2CGVisitor.java:614)\ at org.eclipse.qvtd.codegen.qvti.analyzer.QVTiAS2CGVisitor.visitPropertyAssignment(QVTiAS2CGVisitor.java:1)\ at org.eclipse.qvtd.pivot.qvtcorebase.impl.PropertyAssignmentImpl.accept(PropertyAssignmentImpl.java:257)\ at org.eclipse.ocl.examples.codegen.analyzer.AS2CGVisitor.doVisit(AS2CGVisitor.java:364)\ at org.eclipse.qvtd.codegen.qvti.analyzer.QVTiAS2CGVisitor.doBottoms(QVTiAS2CGVisitor.java:189)\ at org.eclipse.qvtd.codegen.qvti.analyzer.QVTiAS2CGVisitor.visitMapping(QVTiAS2CGVisitor.java:488)\ at org.eclipse.qvtd.codegen.qvti.analyzer.QVTiAS2CGVisitor.visitMapping(QVTiAS2CGVisitor.java:1)\ at org.eclipse.qvtd.pivot.qvtimperative.impl.MappingImpl.accept(MappingImpl.java:417)\ at org.eclipse.ocl.examples.codegen.analyzer.AS2CGVisitor.doVisit(AS2CGVisitor.java:364)\ at org.eclipse.qvtd.codegen.qvti.analyzer.QVTiAS2CGVisitor.visitTransformation(QVTiAS2CGVisitor.java:701)\ at org.eclipse.qvtd.codegen.qvti.analyzer.QVTiAS2CGVisitor.visitTransformation(QVTiAS2CGVisitor.java:1)\ at org.eclipse.qvtd.pivot.qvtbase.impl.TransformationImpl.accept(TransformationImpl.java:412)\ at org.eclipse.qvtd.codegen.qvti.java.QVTiCodeGenerator.createCGPackage(QVTiCodeGenerator.java:97)\ at org.eclipse.qvtd.codegen.qvti.java.QVTiCodeGenerator.generateClassFile(QVTiCodeGenerator.java:134)\ at org.eclipse.qvtd.cs2as.compiler.internal.CS2ASJavaCompilerImpl.compileTransformation(CS2ASJavaCompilerImpl.java:436)\ at org.eclipse.qvtd.cs2as.compiler.OCL2QVTiCGTxCompiler.compileTransformation(OCL2QVTiCGTxCompiler.java:38)\ at org.eclipse.qvtd.cs2as.build.mwe.GenerateCGedQVTiTransformation.invokeInternal(GenerateCGedQVTiTransformation.java:76)\ at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)\ at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)\ at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)\ at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)\ at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)\ at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)\ at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)\ at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)\ at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)\ at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)\ at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)

eclipse-ocl-bot commented 2 months ago

By Ed Willink on May 07, 2015 03:24

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

OCL: master

asanchez/397429

QVTd: asanchez/libraryIssue QVTo: asanchez/397429

To reproduce:

  1. execute GenerateQVTOperationalEditor.mwe2 [1]
  2. you get an exception [2]

Yes.

Just don't try this on M7. See Bug 466677.

eclipse-ocl-bot commented 2 months ago

By Adolfo Sanchez-Barbudo Herrera on May 07, 2015 07:24

Hi Ed,

I don't see relation of between the error I obtained and the metnioned bugzilla. Actually, until M7 is officially released on Friday I should not have any M7 component in my Oomph-based installation.

Regards,\ Adolfo.

eclipse-ocl-bot commented 2 months ago

By Ed Willink on May 07, 2015 11:28

As suggested on the newsgroup, the auto-adaption to the prevailing StdLib in PivotMetamodelManager.installRoot corrupts an explicit setting.

The auto-adaption is only benign if a library type is accessed before the corruption. In the reported MWE2 script there is a long delay.

No tests fail if we just delete the corrupting line (and the auto-adaption).

But we now have an import of the OCL Standard Library from the Pivot so that the current use-the-first-asLibraries heuristric malfunctions for QVT.

Changing this seems to just give a choice as to which four tests fail.

The basic problem is that we allow a custom Standard Library to displace the normal one. We can get this to work again by:

whenever a Library is installRoot'd\ and if no explicit call to StandardLibrary.setDefaultStandardLibraryURI is made\ and if the new Library has an "OclAny" type\ then use the Library URI as the implicit defaultStandardLibraryURI

whenever loadDefaultLibrary is invoked with a URI that has no registration then all previously installRoot'd libraries are search for a matching URI.

The above continues to support custom library discovery without disrupting normal usage.

Fix pushed on branch ewillink/397429

eclipse-ocl-bot commented 2 months ago

By Ed Willink on May 07, 2015 12:58

(In reply to Ed Willink from comment #3)

Fix pushed on branch ewillink/397429

QVTd branch ewillink/libraryIssue has two CG fixes. The generated QVTOperationalCS2AS_qvtp_qvtias.java now has just two errors, both of which look like bad oclAsType() calls in the generated QVTi.

eclipse-ocl-bot commented 2 months ago

By Adolfo Sanchez-Barbudo Herrera on May 07, 2015 13:07

Thx.

I had temporarily disabled the generation of the QVTi tx. I'll have a look to the new issue with your new fix