RFR: 8285081: Improve XPath operators count accuracy

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


On Fri, 3 Jun 2022 21:08:04 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/java_cup/internal/runtime/lr_parser.java line 152:
> 
>> 150:     private int opCount = 0;
>> 151:     private int totalOpCount = 0;
>> 152:     private int lastSym;
> 
> `lastSym` is never initialized. It's OK for the first time, but should this be reset for the next use (if any), e.g. somewhere around line 595?

Right, -1 would be appropriate as 0 indicates EOF.

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

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


More information about the core-libs-dev mailing list