Bug #10063
Numeric FILL-IN Throws NPE During Unit Testing
100%
History
#1 Updated by Vladimir Tsichevski about 1 year ago
A Numeric FILL-IN program exhibits a behavioral difference when running as a 4GL procedure versus as an ABLUnit test, resulting in a NullPointerException in FWD.
Steps to Reproduce¶
- As a 4GL Procedure: Here is a simple 4GL procedure that runs without issues in both OE and FWD:
DEFINE VARIABLE decimalField AS DECIMAL NO-UNDO. DEFINE FRAME f decimalField NO-LABEL. ENABLE ALL WITH FRAME f. APPLY "1" TO decimalField IN FRAME f.
- As an ABLUnit Test: The same logic, when executed as an ABLUnit test, this executes successfully in OE but fails in FWD with an NPE.
ROUTINE-LEVEL ON ERROR UNDO, THROW. USING OpenEdge.Core.Assert FROM PROPATH. CLASS unittests.TestApply: DEFINE PUBLIC VARIABLE decimalField AS DECIMAL NO-UNDO. DEFINE FRAME f decimalField NO-LABEL. @Test. METHOD PUBLIC VOID testBackSpace(): ENABLE ALL WITH FRAME f. APPLY "1" TO decimalField IN FRAME f. END METHOD. END CLASS.
Root Cause¶
Debugging reveals that the FILL-IN is not initialized when the input is processed, leaving the NumberFormat.NumberBuf.digits field as null, which causes the NPE. The initialization should occur when the FILL-IN is enabled.
#2 Updated by Vladimir Tsichevski about 1 year ago
A check for an unknown value has been added to the NumberBufGui.input() method in revision 15949 of 10063a. This change does not address the underlying cause of the NPE, but serves as a workaround that eliminates the NPE and enables unit tests to proceed.
#3 Updated by Hynek Cihlar 5 months ago
- Status changed from New to WIP
Vladimir, what is the status of the issue? Does 10063a resolve it? What else should be done? Also please update % Done.
#5 Updated by Vladimir Tsichevski 5 months ago
Hynek Cihlar wrote:
Vladimir, what is the status of the issue? Does 10063a resolve it? What else should be done? Also please update % Done.
The change from 10063a was later merged into trunk in rev. 16138 as part of the fix for #10020.
As a result, this issue no longer exists.