LUCENE-9021 QueryParser: re-use the LookaheadSuccess exception (#962)

* LUCENE-9021 QueryParser: re-use the LookaheadSuccess exception
Authored-by: Przemek Bruski <pbruski@atlassian.com>
This commit is contained in:
Przemek Bruski 2020-12-12 15:05:46 +01:00 committed by GitHub
parent a648143955
commit ccf3e60453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -120,6 +120,9 @@ configure(project(":lucene:queryparser")) {
text = text.replace(
"new java.util.ArrayList<int[]>",
"new java.util.ArrayList<>")
text = text.replace(
"final private LookaheadSuccess jj_ls =",
"static final private LookaheadSuccess jj_ls =")
return text
})
}

View File

@ -253,6 +253,8 @@ Optimizations
* LUCENE-9536: Reduced memory usage for OrdinalMap when a segment has all
values. (Julie Tibshirani via Adrien Grand)
* LUCENE-9021: QueryParser: re-use the LookaheadSuccess exception. (Przemek Bruski via Mikhail Khludnev)
Bug Fixes
---------------------

View File

@ -869,7 +869,7 @@ if (splitOnWhitespace == false) {
@SuppressWarnings("serial")
static private final class LookaheadSuccess extends java.lang.Error { }
final private LookaheadSuccess jj_ls = new LookaheadSuccess();
static final private LookaheadSuccess jj_ls = new LookaheadSuccess();
private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;