PM80544: StrLib.getNextToken(commandLine, i, delimiters) fails when commandLine itself consists only of delimiters

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as user error.

Error description

  • StrLib.getNextToken(commandLine, i, delimiters) fails when
    commandLine itself consists only of delimiters
    
    When the commandLine consists of delimiters only such as ' , '
    parsing of tokens fails because getNextToken(...) returns null
    at each iteration.
    
    Environment
    -----------
    Windows, Linux
    Product name: IBM? Rational? Business Developer
    
    Program Version    :  8.5.0, 8.5.1
    
    
    Error
    ------
    No error is thrown but a parser loop as in the example below
    will loop indefinitely unless a check is inserted.
    
    Example
    -------
     commandLine STRING = '   ,  '; //loops indefinitely
     delimiters STRING = ', ';
     i INT = 1;
     max INT;
     tokens STRING[0];
     token STRING? = '';
    
     function main()
        max = strLib.byteLen(commandLine);
          syslib.writeStdout('comandLine length= '+max);
          // end processing when the getNextToken function returns a
    null
          while(i ? max)
             token = StrLib.getNextToken(commandLine, i,
    delimiters);
             if (token != null)
                tokens.appendElement(token);
                syslib.writeStdout('token = ?'+token+'?');
             end
          end
          syslib.writeStdout('tokens found= '+tokens.getSize());
         end
    
    To reproduce the error
    --------------------------
    Create a basic EGL program and insert the code above.
    

Local fix

Problem summary

Problem conclusion

Temporary fix

Comments

  • This is not a bug.  The documentation for getNextToken says
    "If no token is found, the function returns a null value."
    It also says "If no token is found, index is unchanged."
    (Index is the name of the second parameter.)
    
    The user's loop should end when the function returns null.
    

APAR Information

  • APAR number

    PM80544

  • Reported component name

    RATL BUS DEV

  • Reported component ID

    5724S5000

  • Reported release

    850

  • Status

    CLOSED USE

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-01-14

  • Closed date

    2014-05-26

  • Last modified date

    2014-05-26

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

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

Fix information

Applicable component levels



Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Business Developer

Software version:

850

Reference #:

PM80544

Modified date:

2014-05-26

Translate my page

Machine Translation

Content navigation