Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322756 - QVTo property of type dictionary of string to enumeration crashes
Summary: QVTo property of type dictionary of string to enumeration crashes
Status: RESOLVED FIXED
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Sergey Boyko CLA
QA Contact:
URL:
Whiteboard: R3_0_maintenance
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 04:12 EDT by Dennis Hendriks CLA
Modified: 2010-08-26 06:14 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (14.99 KB, patch)
2010-08-26 06:12 EDT, Sergey Boyko CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Hendriks CLA 2010-08-16 04:12:49 EDT
Build Identifier: Build id: 20100617-1415 (Helios)

Having the following in a QVTo transformation:

property DISTRIBUTION_NAME_MAP : Dict(String, StdLibFunctions)
    = Dict {
        'Constant'    = StdLibFunctions::Constant,
(...)
        'Weibull'     = StdLibFunctions::Weibull
    };

where StdLibFunctions is an enumeration from the source metamodel.

Running this transformation gives:

java.lang.IllegalArgumentException: OCL collection kind (Collection) is not implemented in the java collection factory.
	at org.eclipse.ocl.util.CollectionUtil.createNewCollection(CollectionUtil.java:1079)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.ModuleInstanceFactory.initProperties(ModuleInstanceFactory.java:164)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.ModuleInstanceFactory.basicCreateModuleInstance(ModuleInstanceFactory.java:135)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.ModuleInstanceFactory.createModuleInstance(ModuleInstanceFactory.java:107)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.ModuleInstanceFactory.basicCreate(ModuleInstanceFactory.java:92)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.ModuleInstanceFactory.create(ModuleInstanceFactory.java:80)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.callTransformationImplicitConstructor(QvtOperationalEvaluationVisitorImpl.java:868)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.doVisitTransformation(QvtOperationalEvaluationVisitorImpl.java:890)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitModule(QvtOperationalEvaluationVisitorImpl.java:750)
	at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtGenericEvaluationVisitor.visitModule(QvtGenericEvaluationVisitor.java:396)
	at org.eclipse.m2m.internal.qvt.oml.expressions.impl.ModuleImpl.accept(ModuleImpl.java:632)
	at org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpretedTransformation.evaluate(QvtInterpretedTransformation.java:177)
	at org.eclipse.m2m.internal.qvt.oml.runtime.project.QvtInterpretedTransformation.run(QvtInterpretedTransformation.java:118)
	at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchConfigurationDelegateBase.doLaunch(QvtLaunchConfigurationDelegateBase.java:184)
	at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchConfigurationDelegateBase.doLaunch(QvtLaunchConfigurationDelegateBase.java:139)
	at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchConfigurationDelegate$1.run(QvtLaunchConfigurationDelegate.java:65)
	at org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$SameThreadRunner.run(SafeRunner.java:33)
	at org.eclipse.m2m.internal.qvt.oml.common.launch.SafeRunner$1.run(SafeRunner.java:26)
	at org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProcess.run(ShallowProcess.java:41)
	at org.eclipse.m2m.internal.qvt.oml.common.launch.ShallowProcess.run(ShallowProcess.java:32)
	at org.eclipse.m2m.internal.qvt.oml.runtime.launch.QvtLaunchConfigurationDelegate$3.run(QvtLaunchConfigurationDelegate.java:98)
	at java.lang.Thread.run(Unknown Source)

Additional info:

eclipse.buildId=I20100608-0911
java.version=1.6.0_11
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.modeling.product


Note that commenting out this property (which I didn't yet use), makes the transformation execute just fine again...

Reproducible: Always

Steps to Reproduce:
1. Define a property of type Dict(String, <some enum>), and give it a value
2. Run the transformation and observe the crash.
Comment 1 Sergey Boyko CLA 2010-08-26 06:12:46 EDT
Created attachment 177510 [details]
Proposed patch

In various places processing of ImperativeOCL specified types (ListType and DictionaryType) was omitted.
Comment 2 Sergey Boyko CLA 2010-08-26 06:14:35 EDT
Fix is committed in R3_0_maintenance branch.