Community
Participate
Working Groups
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)
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)
Created attachment 233657 [details] A unit test for the patch
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.
Pushed to master. Commit ID: 5223621bf728735416905bf2eee7750c9c5e4c58