IBM Support

PM70827: RUILib.sort() throws error when sorting a string array in a RUI handler during preview

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Failing scenario
    ------------------
    If you define an array of strings to be sorted then the
    RUILib.sort() function fails when the array is cast to type ANY
    before passing it to the RUILib.sort() function. An example is
    given below:
    
    Example
    -------
    //header code removed.
    handler MyTestSort type RUIhandler{initialUI =
            [aList], onConstructionFunction = start,
                cssFile = 'css/test.css',
                title = 'SortTest'}
    
             aList List {};
    
             function start()
                myValuesAsString string[] = ['c','b','a'];
    
                     // Since the values are in an array of type
    string
                     // and RUILib.sort requires an array of type
    ANY
                     // simply cast the string array to an ANY
    array.
                 myValues ANY[] = myValuesAsString AS ANY[];
    
                     // Although the myValues are of type any[] the
    sort
         // function fails with the error below.
                  RUILib.sort(myValues, SortFunction);
                  aList.values = myValues as String[];
             end
    
    function SortFunction(a any in, b any in) returns(int)
        //some sort algorithm
    end
    
    Error
    -----
    Could not render UI
    //[CRRUI2102E] Could not sort Array
    //[CRRUI2094E] Here are the EGL function calls leading to this
    error:
    //
    //    MyTestSort.start() [native JavaScript]
    //
    //uncaught exception: [type=egl.core.RuntimeException,
    message=[CRRUI2102E] Could not sort Array]
    //:0
    //[CRRUI2095E] Could not find the EGL function calls leading to
    this error
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    In RBD 8.0.1.3 and previous releases, regarding
    RUILib.sort(array, sortFunction), when the array is not
    defined as any[] type but casting from other types, a
    runtime error happens.
    

Problem conclusion

  • In RBD 8.0.1.4 and future releases, RUILib.sort(array,
    sortFunction) will support arrays casted into any[]. If the
    sortFunction or array is null, a NullException will be
    thrown in runtime.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM70827

  • Reported component name

    RATL BUS DEV

  • Reported component ID

    5724S5000

  • Reported release

    801

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-08-14

  • Closed date

    2012-10-08

  • Last modified date

    2012-10-08

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    RATL BUS DEV

  • Fixed component ID

    5724S5000

Applicable component levels

  • R801 PSN

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSMQ79","label":"Rational Business Developer"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.0.1","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
08 October 2012