Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Java] Skip node at the end of input #765

Merged
merged 3 commits into from
Oct 21, 2024
Merged

[Java] Skip node at the end of input #765

merged 3 commits into from
Oct 21, 2024

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
42 checks passed
@tushuhei tushuhei deleted the skip-end branch November 21, 2024 07:48
# for free to join this conversation on GitHub. Already have an account? # 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