IBM Support

IV36135: JAVA.LANG.STRINGINDEXOUTOFBOUNDSEXCEPTION OCCURRED IN JAVA.UTIL.REGEX.MATCHER.FIND WHEN INPUT TEXT HAS UTF-16 SURROGATE PAIR CH

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

APAR status

  • Closed as program error.

Error description

  • Error Message: Exception in thread "main"
    java.lang.StringIndexOutOfBoundsException: String index out of
    range: -1
    .
    Stack Trace: at java.lang.String.charAt(String.java:686)
            at
    java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3366)
            at
    java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
            at
    java.util.regex.Pattern$GroupCurly.match0(Pattern.java:3972)
            at
    java.util.regex.Pattern$GroupCurly.match0(Pattern.java:3966)
            at
    java.util.regex.Pattern$GroupCurly.match(Pattern.java:3916)
            at
    java.util.regex.Pattern$SliceI.match(Pattern.java:3507)
            at
    java.util.regex.Pattern$Start.match(Pattern.java:3055)
            at java.util.regex.Matcher.search(Matcher.java:1105)
            at java.util.regex.Matcher.find(Matcher.java:535)
            at test.RegexTestCase.main(RegexTestCase.java:13)
    .
    

Local fix

  • The exception occurred only when there is no match. Hence, the
    application can catch java.lang.StringIndexOutOfBoundsException
    and process it as a false condition.
    

Problem summary

  • Pattern match loop increment was not updated properly when input
    text has UTF-16 surrogate pair characters
    

Problem conclusion

  • This defect will be fixed in:
    6.0.0 SR14
    6.0.1 SR6
    
    .
    Pattern match loop increment is modified to handle UTF-16
    surrogate pair.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV36135

  • Reported component name

    JAVA CLASS LIBS

  • Reported component ID

    620700130

  • Reported release

    600

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-01-31

  • Closed date

    2013-05-21

  • Last modified date

    2013-06-20

  • 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 CLASS LIBS

  • Fixed component ID

    620700130

Applicable component levels

  • R600 PSY

       UP

  • R700 PSY

       UP



Document information

More support for: Runtimes for Java Technology
Java Class Libraries

Software version: 6.0

Reference #: IV36135

Modified date: 20 June 2013