| Summary: | A null value is added to array when determine if it is null | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Huang Ji Yong <hjiyong> |
| Component: | EDT | Assignee: | Project Inbox <edt.javagen-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | greer, jeffdouglas |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Jeff, I was able to create this same problem in Java gen; I think reorgcode is the culprit. visit(BinaryExpression ...) has logic that injects appendAll / appendElement, so perhaps that logic is too simplistic as illustrated by this testcase. fixed Verified in 201110202102 |
This defect only happens when the && is used such as if (options != null && options.getSize() > 0) Testcase --------- package client; // RUI Handler // // handler testArrayNull type RUIhandler{onConstructionFunction = start, cssFile = "css/testBugs.css", title = "testArrayNull"} options String[] = ["coffee", "tea", "sugar"]; function start() if (options != null && options.getSize() > 0) // if (options != null) printOptions(options); end end function printOptions(opts String[] in) for (index int from 1 to opts.getSize() by 1) syslib.writeStdout(opts[index]); end end end ----- The generated js for if (options != null && options.getSize() > 0) is like eze$Temp1 = ((egl.eglx.lang.EBoolean.ezeCast({eze$$value : this.options.appendElement(null), eze$$signature : "Teglx/lang/EList;"}) && ((this.options.getSize() > 0)))); In which append null to this.options is wrong --------------- The RadioGroup widget suffers from this defect, can have a workaround to bypass it. But such kind of boolean statement is used frequently, so set the severity to major.