IBM Support

PK18674: INCORRECT EXCEPTION THROWN ON STRING TO BIGDECIMAL CONVERSION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Converting the String '.' (single dot) into BigDecimal
    throws a StringIndexOutOfBoundsException instead of a
    NumberFormatException
    java.lang.StringIndexOutOfBoundsException: String index out
    of range: 1
    at java.lang.String.charAt(String.java(Compiled Code))
    at java.math.BigDecimal.<init>(BigDecimal.java:310)
    at dectest.convert(dectest.java:14)
    at dectest.main(dectest.java:6)
    

Local fix

Problem summary

  • java.lang.StringIndexOutOfBoundsException: String index out
    of range: 1
    was thrown when an attempt is made to convert a String
    containing a single dot into BigDecimal.  This was because
    Without checking the length of the String, the next element
    in the String was being accessed.
    

Problem conclusion

  • The constructor of BigDecimal is changed to properly check
    the length of the String, and if the String contains only a
    single dot, then NumberFormatException is thrown.
    .
    To obtain the fix:
    Install build 20060209 or later
    

Temporary fix

Comments

APAR Information

  • APAR number

    PK18674

  • Reported component name

    JAVA(1.3/1.4 CO

  • Reported component ID

    5648C9800

  • Reported release

    31A

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2006-01-31

  • Closed date

    2006-02-10

  • Last modified date

    2006-02-10

  • 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

    JAVA(1.3/1.4 CO

  • Fixed component ID

    5648C9800

Applicable component levels

  • R31A PSN

       UP

  • R31L PSN

       UP

  • R31O PSN

       UP

  • R31W PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SUPPORT","label":"IBM Worldwide Support"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.3.1","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
09 February 2022