Integrated: 8284920: Incorrect Token type causes XPath expression to return incorrect results

Joe Wang joehw at openjdk.java.net
Wed Apr 20 19:25:34 UTC 2022


On Wed, 20 Apr 2022 17:40:24 GMT, Joe Wang <joehw at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: 81a8e2f8
Author:    Joe Wang <joehw at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/81a8e2f8b32ad27aed45c4f6966e8d9ecf8b0fc9
Stats:     124 lines in 3 files changed: 122 ins; 0 del; 2 mod

8284920: Incorrect Token type causes XPath expression to return incorrect results

Reviewed-by: naoto, lancea

-------------

PR: https://git.openjdk.java.net/jdk/pull/8321


More information about the core-libs-dev mailing list