Skip to content

Conversation

@tushuhei
Copy link
Member

Current Java code throws the following error when the input HTML has a skip node at the end. This PR fixes the issue.

java.lang.StringIndexOutOfBoundsException: index 15,length 15
        at java.base/java.lang.String.checkIndex(String.java:3278)
        at java.base/java.lang.StringUTF16.checkIndex(StringUTF16.java:1470)
        at java.base/java.lang.StringUTF16.charAt(StringUTF16.java:1267)
        at java.base/java.lang.String.charAt(String.java:695)
        at com.google.budoux.HTMLProcessor$PhraseResolvingNodeVisitor.head(HTMLProcessor.java:133)
        at org.jsoup.select.NodeTraversor.traverse(NodeTraversor.java:34)
        at org.jsoup.nodes.Node.traverse(Node.java:707)
        at org.jsoup.nodes.Element.traverse(Element.java:1883)
        at com.google.budoux.HTMLProcessor.resolve(HTMLProcessor.java:194)

@tushuhei tushuhei requested a review from kojiishi October 21, 2024 08:24
@tushuhei tushuhei changed the title Skip end [Java] Skip node at the end of input Oct 21, 2024
@tushuhei tushuhei added the java Pull requests that update Java code label Oct 21, 2024
@tushuhei tushuhei merged commit cbfb280 into main Oct 21, 2024
@tushuhei tushuhei deleted the skip-end branch November 21, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants