Project

General

Profile

Bug #10063

Numeric FILL-IN Throws NPE During Unit Testing

Added by Vladimir Tsichevski about 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
15938
version_resolved:
production:
No
env_name:
topics:

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

  1. 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.
    
  2. 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.

#6 Updated by Greg Shah 5 months ago

  • % Done changed from 0 to 100
  • Status changed from WIP to Closed

Also available in: Atom PDF