[JIRA] (JENKINS-25466) Exception "String index out of range" in summary_report plugin

2 views
Skip to first unread message

delonbest@protonmail.com (JIRA)

unread,
Mar 13, 2020, 12:55:03 AM3/13/20
to jenkinsc...@googlegroups.com
delon best commented on Bug JENKINS-25466
 
Re: Exception "String index out of range" in summary_report plugin

When using the Java substring() method, a subset of the character sequence can be extracted from a string. The  substring index must be any value from 0 to the length of a string. The java.lang.StringIndexOutOfBoundsException thrown by String methods to indicate that the beginIndex is negative , or endIndex is larger than the length of this String object, or beginIndex is larger than endIndex.

How to solve the StringIndexOutOfBoundsException

  • Check the length of the string before using substring()
  • Exception handling using try...catch.
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages