Menu

#1735 StringIndexOutOfBoundsException with isQuoteEnclosed()

2.18
closed
RBRi
None
1
2015-12-17
2015-12-17
Jumper Chen
No

In the class of HtmlUnitBrowserCompatCookieSpec, it has a method called isQuoteEnclosed(), if the passed argument is an empty string, it will throw an exception of StringIndexOutOfBoundsException.

For example,

private static boolean isQuoteEnclosed(final String s) {
return s != null
&& '\"' == s.charAt(0) //<-- caused by this line.
&& '\"' == s.charAt(s.length() - 1);
}

Discussion

  • RBRi

    RBRi - 2015-12-17
    • status: open --> accepted
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2015-12-17

    fixed in SVN, will refresh our snapshot build also.

    Thanks for reporting and using HtmlUnit.

     
  • RBRi

    RBRi - 2015-12-17
    • status: accepted --> closed
     

Log in to post a comment.