RFR 8236034 : Use optimized Ques node for curly {0,1} quantifier

Roger Riggs Roger.Riggs at oracle.com
Fri Jan 17 21:30:15 UTC 2020


Hi Ivan,

This refactoring looks fine.

Sorry for the long time to get to looking at this.

Thanks, Roger


On 12/16/19 7:03 PM, Ivan Gerasimov wrote:
> Hello!
>
> In the regular expressions, the quantifier ? can be equally written as 
> {0,1}.
>
> While for the former variant an optimized algorithm is used (coded in 
> the Pattern.Ques class), the later variant uses more general and less 
> efficient implementation (coded in the Pattern.Curly class).
>
> It would be beneficial, if we unify the implementation for these two 
> variants of quantifier and make them both use Ques node.
>
> Also, I couldn't resist to do some refactoring in the affected potion 
> of the code to eliminate the repetition of logics.
>
> The regression test was modified to exercise both forms of quantifiers 
> equally well.
>
> Would you please help review this enhancement?
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8236034
> WEBREV: http://cr.openjdk.java.net/~igerasim/8236034/00/webrev/
>
> Thanks in advance!
>



More information about the core-libs-dev mailing list