Bug #10366
ObjectOps.invokeStandalonePoly does not change output parameter value
Start date:
Due date:
% Done:
100%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
History
#1 Updated by Teodor Gorghe 12 months ago
We have the following test case:
BLOCK-LEVEL ON ERROR UNDO, THROW.
USING OpenEdge.Core.Assert FROM PROPATH.
CLASS tests.TestDecVarOutputAsInt:
DEFINE TEMP-TABLE tt1
FIELD f1 AS INTEGER.
METHOD PUBLIC VOID WriteIntVar(INPUT dummyVar AS INTEGER, OUTPUT iVar AS INTEGER):
iVar = 1.
END METHOD.
@Test.
METHOD PUBLIC VOID TestDecIntMethWrite():
DEFINE VARIABLE dVar AS DECIMAL INITIAL 0.
CREATE tt1.
tt1.f1 = 1.
WriteIntVar(BUFFER tt1::f1, OUTPUT dVar).
Assert:Equals(1.0, dVar).
END METHOD.
END CLASS.
On TestDecIntMethWrite, the WriteIntVar(BUFFER tt1::f1, OUTPUT dVar) gets converted into:
ObjectOps.invokeStandalonePoly(ObjectOps.thisObject(), com.goldencode.testcases.tests.TestDecVarOutputAsInt.class, "WriteIntVar", "IO", tt1.dereference("f1"), dVar);
This is mostly OK on conversion, but on runtime, the
dVar does not written by iVar = 1.When Poly is not used, this variable gets written, as it does on 4GL.
#3 Updated by Teodor Gorghe 12 months ago
- Status changed from New to WIP
Created task branch 10366a.
#4 Updated by Teodor Gorghe 12 months ago
- Assignee set to Teodor Gorghe
#5 Updated by Teodor Gorghe 12 months ago
- Status changed from WIP to Review
- reviewer Constantin Asofiei added
Committed revision 16085 on task branch 10366a:
- Added runtime parameter type conversion support for output parameters.
When the poly case is not used, the parameter is converted into integer type at conversion stage (wrap(integer.class, varName)), but on poly case, a new instance was created using the target class constructor.
This change should change this behavior to allow runtime output parameter wrapping.
#6 Updated by Constantin Asofiei 12 months ago
- Status changed from Review to Internal Test
- % Done changed from 0 to 100
Good catch, I'm OK with the changes.
#7 Updated by Alexandru Lungu 12 months ago
- Status changed from Internal Test to Merge Pending
Please merge 10366a to trunk after 10356a.
#8 Updated by Teodor Gorghe 12 months ago
- Status changed from Merge Pending to Test
Branch 10366a was merged to trunk rev 16099 and archived.