| Summary: | Test for NULL results in egl.lang.NullType can not be resolved | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Kathy Carroll <carrollk> |
| Component: | EDT | Assignee: | Jeff Douglas <jeffdouglas> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mheitz |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Jeff, this needs to be fixed in I11 (so tomorrow...sorry) if possible. I'd do it myself but I'm out of time before my vacation. I checked in a lot of changes related to nulls in the runtime's Exxx classes. Methods like plus and concat now return null instead of throwing an exception on null input. The equals and notEquals methods now return false when either operand is null. These changes bring EDT in line with RBD. I believe we need a NullType generator to deal with expressions that do x == null, null == x, x != null, and null != x. That will fix this defect. It's also necessary because, as I mentioned in the last paragraph, equals and notEquals will return false when either operand is null. Without a special NullType generator to handle those four comparisons I think we'll end up using equals or notEquals from an Exxx class and the testcase in this defect won't work properly. What I've said may seem strange, but try this in RBD: s1 string? = null; s2 string? = "I'm not null"; if ( s1 == null ) writeStdout( "s1 eq null" ); else writeStdout( "s1 not eq null" ); end if ( s1 != null ) writeStdout( "s1 not eq null" ); else writeStdout( "s1 eq null" ); end if ( s1 == s2 ) writeStdout( "s1 eq s2" ); else writeStdout( "s1 not eq s2" ); end if ( s1 != s2 ) writeStdout( "s1 not eq s2" ); else writeStdout( "s1 eq s2" ); end The first two comparisons tell you if s1 is null or not. The last two comparisons both result in false, making s1 and s2 seem both equal and not equal! I've added the NullType logic. We still need to provide code for the asNullType method I think that the asNullType should just return null, which it does. So, I am resolving this defect. Verified Closing this defect. |
EGL code mystring string?; if (mystring == null ) writeStdout("got it"); end Error in generated Java egl.lang.NullType cannot be resolved to a type Java code: if (egl.lang.NullType.equals(EString.ezeBox(mystring), null)) { String eze$Temp7 = Constants.EMPTY_STRING; eze$Temp7 = "got it"; java.lang.System.out.println(eze$Temp7); } JavaScript has no error and it is using egl.egl.lang.NullType