RFR: 8284920: Incorrect Token type causes XPath expression to return incorrect results
Joe Wang
joehw at openjdk.java.net
Wed Apr 20 17:49:52 UTC 2022
Patch note:
The previous patch changed all literal tokens to use constants. However, replacing "." with Token.DOT introduced this bug.
While tokens with a single char are inherently of type char, due to the different implementation of the overloaded method "tokenIs" that takes String or char, a wrong input type will produce incorrect result. It may be worth it to take a closer look at the overloaded method, but for now, a quick fix is to reverse the input type back to String (DOT_STR).
Test: the issue affect the processing of the short form of the parent axis "..". The test verifies that all form of the parent axis shall return the same result.
Test: all XML tests passed.
-------------
Commit messages:
- 8284920: Incorrect Token type causes XPath expression to return incorrect results
Changes: https://git.openjdk.java.net/jdk/pull/8321/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8321&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8284920
Stats: 113 lines in 3 files changed: 111 ins; 0 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/8321.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8321/head:pull/8321
PR: https://git.openjdk.java.net/jdk/pull/8321
More information about the core-libs-dev
mailing list