Bug 294127 - Helper of tuple return type may cause runtime exception during evaluation
Summary: Helper of tuple return type may cause runtime exception during evaluation
Status: RESOLVED FIXED
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: 2.0   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Radomil Dvorak CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-03 16:55 EST by Radomil Dvorak CLA
Modified: 2013-07-23 15:50 EDT (History)
1 user (show)

See Also:


Attachments
The code that prepares 'extent' is now not used in cases when 'extent' is not used (i.e.when isMapping is false) (1.19 KB, patch)
2013-07-21 19:26 EDT, Alex Paperno CLA
serg.boyko2011: iplog+
Details | Diff
A unit test for the patch (2.45 KB, application/octet-stream)
2013-07-21 19:26 EDT, Alex Paperno CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radomil Dvorak CLA 2009-11-03 16:55:14 EST
Helper operation which returns a tuple instance having any of its part of <null> value cause
runtime exception during execution.

The issues can be reproduced using the code snippet bellow:

helper createTuple() : a : String, b : Integer {
	a := null; -- null value of a tuple part cause runtime exception
	b := 10;
}

main() {
	var t:= createTuple();
}

Stack trace:
-----------

java.lang.ClassCastException: org.eclipse.m2m.internal.qvt.oml.expressions.impl.VarParameterImpl cannot be cast to org.eclipse.m2m.internal.qvt.oml.expressions.MappingParameter
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.createTupleResult(QvtOperationalEvaluationVisitorImpl.java:1931)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitOperationBody(QvtOperationalEvaluationVisitorImpl.java:993)
at org.eclipse.m2m.internal.qvt.oml.evaluator.QvtOperationalEvaluationVisitorImpl.visitHelper(QvtOperationalEvaluationVisitorImpl.java:464)
Comment 1 Alex Paperno CLA 2013-07-21 19:26:29 EDT
Created attachment 233656 [details]
The code that prepares 'extent' is now not used in cases when 'extent' is not used (i.e.when isMapping is false)
Comment 2 Alex Paperno CLA 2013-07-21 19:26:42 EDT
Created attachment 233657 [details]
A unit test for the patch
Comment 3 Sergey Boyko CLA 2013-07-23 15:48:09 EDT
Comment on attachment 233656 [details]
The code that prepares 'extent' is now not used in cases when 'extent' is not used (i.e.when isMapping is false)

The patch is accurate. It exactly remediates the problem mentioned with tuple creation by helper. Junit test passed.
Comment 4 Sergey Boyko CLA 2013-07-23 15:50:29 EDT
Pushed to master.

Commit ID: 5223621bf728735416905bf2eee7750c9c5e4c58