RFR: 8285081: Improve XPath operators count accuracy

Joe Wang joehw at openjdk.java.net
Fri Jun 3 22:39:35 UTC 2022


On Fri, 3 Jun 2022 21:11:20 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Adjust how XPath operators are counted to improve accuracy. This change does not affect how XPath works. 
>> 
>> Test:  
>>      Tier2 passed;
>>      JCK XML tests passed.
>
> src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/sym.java line 99:
> 
>> 97:   public static final int[] OPERATORS = {GT, GE, EQ, NE, LT, LE, SLASH, DSLASH,
>> 98:       DOT, DDOT, ATSIGN, DCOLON, PLUS, MINUS, STAR, DIV, MOD, AND, OR, LPAREN,
>> 99:       LBRACK, VBAR, DOLLAR, NODE, TEXT, PI, PIPARAM};
> 
> Any reason for re-shuffling the order of operators? I'd expect new ones are appended to the existing ones, or appear in the order of their declarations above?
> (or is this automatically generated, as described in the comment?)

The order is not significant for this process as the lexer takes care of creating the right symbol. I re-grouped them to put operators of the same category together so that it's easier to see what might be missing.

> src/java.xml/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java line 476:
> 
>> 474:   }
>> 475: 
>> 476:   private void incrementCount(char c) {
> 
> `c` is not used.

Will remove it.

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

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


More information about the core-libs-dev mailing list