You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2025/06/27 01:04:12 UTC
(lucene) branch main updated: improve 'javadoc-style-license-header' and 'license-after-package' (#14849)
This is an automated email from the ASF dual-hosted git repository.
rmuir pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new 1f4da953f0c improve 'javadoc-style-license-header' and 'license-after-package' (#14849)
1f4da953f0c is described below
commit 1f4da953f0c13b9b5a3a38dfcfc3c7b6a5a2f6cd
Author: Robert Muir <rm...@apache.org>
AuthorDate: Thu Jun 26 21:04:06 2025 -0400
improve 'javadoc-style-license-header' and 'license-after-package' (#14849)
these two checks are currently implemented with regex rules looking for
comments, then calling into rat API to check if it is a license. It
means parsing every java file with rat just for this purpose, and the
regexes are not perfect.
The new rules are very simple but find some inconsistencies that weren't
found before: they aren't stricter, the previous code just misses some.
We now only call into rat here for xml files, separately we should
decide if that is worth it. If not, we can reduce the gradle code
further and avoid challenges with Rat API on upgrades.
To me, checking this for the 29 XML files is not worth the hassle of
installing additional C library / configuring `customLanguages` to check
the xml with this tool, I add xml parser in my own personal config but I
think its too much of a hassle for anyone else / CI.
* strengthen rule with wildcard node
This allows stuff in between such as import statements, and finds more
inconsistencies: fix them. The TokenManager associated with the
StandardSyntaxParser also has issues here, it has a package statement
and import statement before the license.
* add tests for additional cases now found and fixed
* javadoc-license: add autofix
* Correct license location in StandardSyntaxParser.
* This adds ASL headers to antlr-generated code and removes antlr generated sources from generated family in rat checks.
---------
Co-authored-by: Dawid Weiss <da...@carrotsearch.com>
---
.../src/main/groovy/lucene.regenerate.antlr.gradle | 22 ++-
.../groovy/lucene.validation.rat-sources.gradle | 2 -
.../lucene.validation.source-patterns.gradle | 13 +-
gradle/validation/ast-grep/rules/java-patterns.yml | 30 ++++
gradle/validation/ast-grep/sgconfig.yml | 5 +
gradle/validation/ast-grep/tests/java-patterns.yml | 28 ++++
gradle/validation/ast-grep/utils/java-license.yml | 14 ++
.../lucene/analysis/de/GermanLightStemmer.java | 3 +-
.../lucene/analysis/de/GermanMinimalStemmer.java | 3 +-
.../lucene/analysis/es/SpanishLightStemmer.java | 3 +-
.../lucene/analysis/fi/FinnishLightStemmer.java | 3 +-
.../lucene/analysis/fr/FrenchLightStemmer.java | 3 +-
.../lucene/analysis/fr/FrenchMinimalStemmer.java | 3 +-
.../lucene/analysis/hu/HungarianLightStemmer.java | 3 +-
.../lucene/analysis/it/ItalianLightStemmer.java | 3 +-
.../lucene/analysis/no/NorwegianLightStemmer.java | 3 +-
.../analysis/no/NorwegianMinimalStemmer.java | 3 +-
.../lucene/analysis/pt/PortugueseLightStemmer.java | 3 +-
.../lucene/analysis/ru/RussianLightStemmer.java | 3 +-
.../lucene/analysis/sv/SwedishLightStemmer.java | 3 +-
.../lucene/analysis/sv/SwedishMinimalStemmer.java | 3 +-
.../src/test/org/egothor/stemmer/TestCompile.java | 4 +-
.../src/test/org/egothor/stemmer/TestStemmer.java | 4 +-
.../java/org/apache/lucene/util/UnicodeUtil.java | 3 +-
.../org/apache/lucene/util/TestUnicodeUtil.java | 17 ++-
.../src/generated/checksums/generateAntlr.json | 8 +-
.../expressions/js/JavascriptBaseVisitor.java | 20 ++-
.../lucene/expressions/js/JavascriptLexer.java | 20 ++-
.../lucene/expressions/js/JavascriptParser.java | 20 ++-
.../lucene/expressions/js/JavascriptVisitor.java | 20 ++-
.../generated/checksums/javaccParserFlexible.json | 14 +-
.../flexible/standard/parser/ParseException.java | 16 ++
.../standard/parser/StandardSyntaxParser.java | 161 ++++++++++-----------
.../standard/parser/StandardSyntaxParser.jj | 3 +-
.../parser/StandardSyntaxParserConstants.java | 16 ++
.../parser/StandardSyntaxParserTokenManager.java | 5 +-
.../flexible/standard/parser/Token.java | 16 ++
.../flexible/standard/parser/TokenMgrError.java | 16 ++
38 files changed, 376 insertions(+), 143 deletions(-)
diff --git a/build-tools/build-infra/src/main/groovy/lucene.regenerate.antlr.gradle b/build-tools/build-infra/src/main/groovy/lucene.regenerate.antlr.gradle
index c5ed226b2f8..18dbceec3fd 100644
--- a/build-tools/build-infra/src/main/groovy/lucene.regenerate.antlr.gradle
+++ b/build-tools/build-infra/src/main/groovy/lucene.regenerate.antlr.gradle
@@ -69,7 +69,27 @@ configure(project(":lucene:expressions")) {
generatedFiles.each { file ->
modifyFile(file, { text ->
text = text.replaceAll("public ((interface|class) Javascript\\w+)", "\$1")
- text = text.replaceAll("// Generated from .*", "// ANTLR GENERATED CODE: DO NOT EDIT")
+ text = text.replaceAll("// Generated from .*",
+ """
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ANTLR GENERATED CODE: DO NOT EDIT.
+""")
return text
})
}
diff --git a/build-tools/build-infra/src/main/groovy/lucene.validation.rat-sources.gradle b/build-tools/build-infra/src/main/groovy/lucene.validation.rat-sources.gradle
index 28d63c16c52..c9817a054ce 100644
--- a/build-tools/build-infra/src/main/groovy/lucene.validation.rat-sources.gradle
+++ b/build-tools/build-infra/src/main/groovy/lucene.validation.rat-sources.gradle
@@ -217,8 +217,6 @@ class RatTask extends DefaultTask {
pattern(substring: "Produced by GNUPLOT")
// snowball stemmers generated by snowball compiler
pattern(substring: "Generated by Snowball")
- // parsers generated by antlr
- pattern(substring: "ANTLR GENERATED CODE")
}
approvedLicense(familyName: "Apache")
diff --git a/build-tools/build-infra/src/main/groovy/lucene.validation.source-patterns.gradle b/build-tools/build-infra/src/main/groovy/lucene.validation.source-patterns.gradle
index 36b315a58c6..1f0ec9db579 100644
--- a/build-tools/build-infra/src/main/groovy/lucene.validation.source-patterns.gradle
+++ b/build-tools/build-infra/src/main/groovy/lucene.validation.source-patterns.gradle
@@ -147,11 +147,8 @@ class ValidateSourcePatternsTask extends DefaultTask {
violations.add(msg)
}
- def javadocsPattern = ~$/(?sm)^\Q/**\E(.*?)\Q*/\E/$;
- def javaCommentPattern = ~$/(?sm)^\Q/*\E(.*?)\Q*/\E/$;
def xmlCommentPattern = ~$/(?sm)\Q<!--\E(.*?)\Q-->\E/$;
def lineSplitter = ~$/[\r\n]+/$;
- def packagePattern = ~$/(?m)^\s*package\s+org\.apache.*;/$;
def xmlTagPattern = ~$/(?m)\s*<[a-zA-Z].*/$;
def validSPINameJavadocTag = ~$/(?s)\s*\*\s*@lucene\.spi\s+\{@value #NAME\}/$;
@@ -209,14 +206,6 @@ class ValidateSourcePatternsTask extends DefaultTask {
reportViolation(f, String.format(Locale.ROOT, '%s [start=%d, end=%d]', name, matcher.start(), matcher.end()));
}
}
- def javadocsMatcher = javadocsPattern.matcher(text);
- def ratDocument = new FileDocument(f);
- while (javadocsMatcher.find()) {
- if (isLicense(javadocsMatcher, ratDocument)) {
- reportViolation(f, String.format(Locale.ENGLISH, 'javadoc-style license header [%s]',
- ratDocument.getMetaData().value(MetaData.RAT_URL_LICENSE_FAMILY_NAME)));
- }
- }
if (f.name.endsWith('.java')) {
// make sure that SPI names of all tokenizers/charfilters/tokenfilters are documented
if (!f.name.contains("Test") && !f.name.contains("Mock") && !f.name.contains("Fake") && !text.contains("abstract class") &&
@@ -228,9 +217,9 @@ class ValidateSourcePatternsTask extends DefaultTask {
reportViolation(f, 'invalid spi name documentation')
}
}
- checkLicenseHeaderPrecedes(f, 'package', packagePattern, javaCommentPattern, text, ratDocument);
}
if (f.name.endsWith('.xml')) {
+ def ratDocument = new FileDocument(f);
checkLicenseHeaderPrecedes(f, '<tag>', xmlTagPattern, xmlCommentPattern, text, ratDocument);
}
} catch (e) {
diff --git a/gradle/validation/ast-grep/rules/java-patterns.yml b/gradle/validation/ast-grep/rules/java-patterns.yml
index c6591bb3e74..a924b106e03 100644
--- a/gradle/validation/ast-grep/rules/java-patterns.yml
+++ b/gradle/validation/ast-grep/rules/java-patterns.yml
@@ -21,3 +21,33 @@ rule:
severity: error
message: illegal use of `var` keyword with generic instance creation
note: add explicit typing on the RHS when using `var`
+---
+# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/java_rule.json
+id: javadoc-style-license-header
+language: java
+rule:
+ matches: java-license
+ regex: "^/[*][*]"
+ pattern: $TEXT
+# remove extraneous stars
+transform:
+ NEWTEXT:
+ replace:
+ replace: "^/[*]+"
+ by: "/*"
+ source: $TEXT
+fix: $NEWTEXT
+severity: error
+message: license should be a non-javadoc block comment
+---
+# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/java_rule.json
+id: license-after-package
+language: java
+rule:
+ kind: package_declaration
+ precedes:
+ matches: java-license
+ # allow anything in between (e.g. import statements)
+ stopBy: end
+severity: error
+message: license should be before `package` declaration
diff --git a/gradle/validation/ast-grep/sgconfig.yml b/gradle/validation/ast-grep/sgconfig.yml
index 7f5543fe565..d93103936cd 100644
--- a/gradle/validation/ast-grep/sgconfig.yml
+++ b/gradle/validation/ast-grep/sgconfig.yml
@@ -1,5 +1,10 @@
+---
+# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/project.json
ruleDirs:
- ./rules
testConfigs:
- testDir: ./tests
+
+utilDirs:
+ - ./utils
diff --git a/gradle/validation/ast-grep/tests/java-patterns.yml b/gradle/validation/ast-grep/tests/java-patterns.yml
index 9e9a10b8fbe..cfa975180d1 100644
--- a/gradle/validation/ast-grep/tests/java-patterns.yml
+++ b/gradle/validation/ast-grep/tests/java-patterns.yml
@@ -13,3 +13,31 @@ invalid:
valid:
- HashSet<String> x = new HashSet<>();
- var list = new ArrayList<String>();
+---
+id: javadoc-style-license-header
+invalid:
+ - |
+ /** BLAH BLAH Unless required by applicable law BLAH BLAH */
+valid:
+ - |
+ /* BLAH BLAH Unless required by applicable law BLAH BLAH */
+ - |
+ /** something else */
+---
+id: license-after-package
+invalid:
+ - |
+ package foo;
+ /* BLAH BLAH Unless required by applicable law BLAH BLAH */
+ - |
+ package foo;
+ import bar;
+ /* BLAH BLAH Unless required by applicable law BLAH BLAH */
+ - |
+ /* BLAH BLAH Unless required by applicable law BLAH BLAH */
+ package foo;
+ /* BLAH BLAH Unless required by applicable law BLAH BLAH */
+valid:
+ - |
+ /* BLAH BLAH Unless required by applicable law BLAH BLAH */
+ package foo;
diff --git a/gradle/validation/ast-grep/utils/java-license.yml b/gradle/validation/ast-grep/utils/java-license.yml
new file mode 100644
index 00000000000..fdb8f2563aa
--- /dev/null
+++ b/gradle/validation/ast-grep/utils/java-license.yml
@@ -0,0 +1,14 @@
+---
+# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/refs/heads/main/schemas/java_rule.json
+id: java-license
+language: java
+rule:
+ # detect a license for non-legal purposes (e.g. style)
+ # make this more sophisticated as needed
+ kind: block_comment
+ # must be top-level
+ inside:
+ kind: program
+ any:
+ - regex: Unless required by applicable law
+ - regex: FITNESS FOR A PARTICULAR PURPOSE
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanLightStemmer.java
index 6a6a6e4f0ed..58c6b7b3a43 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.de;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.de;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.de;
+
/**
* Light Stemmer for German.
*
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanMinimalStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanMinimalStemmer.java
index f477bb9c6d3..63f3b4954b2 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanMinimalStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/de/GermanMinimalStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.de;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.de;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.de;
+
/**
* Minimal Stemmer for German.
*
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java
index 087eb795f99..452c92414e0 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/es/SpanishLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.es;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.es;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.es;
+
/**
* Light Stemmer for Spanish
*
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/fi/FinnishLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/fi/FinnishLightStemmer.java
index f1a13aaa081..030db2c2889 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/fi/FinnishLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/fi/FinnishLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.fi;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.fi;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.fi;
+
import static org.apache.lucene.analysis.util.StemmerUtil.delete;
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java
index edcc389ce68..9887ccffd15 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.fr;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.fr;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.fr;
+
import static org.apache.lucene.analysis.util.StemmerUtil.delete;
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java
index 88cd3480706..affc0859ef5 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/fr/FrenchMinimalStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.fr;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.fr;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.fr;
+
/**
* Light Stemmer for French.
*
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hu/HungarianLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hu/HungarianLightStemmer.java
index 34366f039b9..9221ce4f914 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/hu/HungarianLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/hu/HungarianLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.hu;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.hu;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.hu;
+
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
/**
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemmer.java
index 0edb5caf66f..de85c61625e 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/it/ItalianLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.it;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.it;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.it;
+
/**
* Light Stemmer for Italian.
*
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java
index 1c0c30116f5..db29351440a 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.no;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.no;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.no;
+
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
/**
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianMinimalStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianMinimalStemmer.java
index fce97b3fd6c..1967d6553fe 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianMinimalStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/no/NorwegianMinimalStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.no;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.no;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.no;
+
import static org.apache.lucene.analysis.no.NorwegianLightStemmer.BOKMAAL;
import static org.apache.lucene.analysis.no.NorwegianLightStemmer.NYNORSK;
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseLightStemmer.java
index aea0b6b7e0a..81ce6a2c644 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/pt/PortugueseLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.pt;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.pt;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.pt;
+
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
/**
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLightStemmer.java
index 4e368def790..9b1f2b6575d 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/ru/RussianLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.ru;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.ru;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.ru;
+
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
/**
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishLightStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishLightStemmer.java
index 4c4913bfbee..e7aa5a2fa30 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishLightStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishLightStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.sv;
/*
* This algorithm is updated based on code located at:
@@ -51,6 +50,8 @@ package org.apache.lucene.analysis.sv;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.sv;
+
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
/**
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishMinimalStemmer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishMinimalStemmer.java
index 9b1c2f532b3..ad57b3eba0a 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishMinimalStemmer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/sv/SwedishMinimalStemmer.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.analysis.sv;
/*
* The code is inspired from original code located at: http://members.unine.ch/jacques.savoy/clef/
@@ -50,6 +49,8 @@ package org.apache.lucene.analysis.sv;
* POSSIBILITY OF SUCH DAMAGE.
*/
+package org.apache.lucene.analysis.sv;
+
import static org.apache.lucene.analysis.util.StemmerUtil.endsWith;
/**
diff --git a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java
index aa196fdd1bc..6509488e282 100644
--- a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java
+++ b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestCompile.java
@@ -1,5 +1,3 @@
-package org.egothor.stemmer;
-
/*
Egothor Software License version 1.00
Copyright (C) 1997-2004 Leo Galambos.
@@ -55,6 +53,8 @@ individuals on behalf of the Egothor Project and was originally
created by Leo Galambos (Leo.G@seznam.cz).
*/
+package org.egothor.stemmer;
+
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.IOException;
diff --git a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java
index 02e27b2f473..548830d2146 100644
--- a/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java
+++ b/lucene/analysis/stempel/src/test/org/egothor/stemmer/TestStemmer.java
@@ -1,5 +1,3 @@
-package org.egothor.stemmer;
-
/*
Egothor Software License version 1.00
Copyright (C) 1997-2004 Leo Galambos.
@@ -55,6 +53,8 @@ individuals on behalf of the Egothor Project and was originally
created by Leo Galambos (Leo.G@seznam.cz).
*/
+package org.egothor.stemmer;
+
import org.apache.lucene.tests.util.LuceneTestCase;
public class TestStemmer extends LuceneTestCase {
diff --git a/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java b/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java
index dcf6b0c26cb..4ac05aae975 100644
--- a/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java
+++ b/lucene/core/src/java/org/apache/lucene/util/UnicodeUtil.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.util;
/*
* Some of this code came from the excellent Unicode
@@ -83,6 +82,8 @@ package org.apache.lucene.util;
* copyright holder.
*/
+package org.apache.lucene.util;
+
import java.util.Arrays;
/**
diff --git a/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java b/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java
index 38aea3125f8..6118b246ad2 100644
--- a/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java
+++ b/lucene/core/src/test/org/apache/lucene/util/TestUnicodeUtil.java
@@ -14,14 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.lucene.util;
-
-import java.util.Arrays;
-import org.apache.lucene.tests.util.LuceneTestCase;
-import org.apache.lucene.tests.util.TestUtil;
-import org.apache.lucene.util.automaton.Automaton;
-import org.apache.lucene.util.automaton.CompiledAutomaton;
-import org.apache.lucene.util.automaton.FiniteStringsIterator;
/*
* Some of this code came from the excellent Unicode
@@ -90,6 +82,15 @@ import org.apache.lucene.util.automaton.FiniteStringsIterator;
* copyright holder.
*/
+package org.apache.lucene.util;
+
+import java.util.Arrays;
+import org.apache.lucene.tests.util.LuceneTestCase;
+import org.apache.lucene.tests.util.TestUtil;
+import org.apache.lucene.util.automaton.Automaton;
+import org.apache.lucene.util.automaton.CompiledAutomaton;
+import org.apache.lucene.util.automaton.FiniteStringsIterator;
+
public class TestUnicodeUtil extends LuceneTestCase {
public void testCodePointCount() {
// Check invalid codepoints.
diff --git a/lucene/expressions/src/generated/checksums/generateAntlr.json b/lucene/expressions/src/generated/checksums/generateAntlr.json
index 960e57bb918..8046910acdc 100644
--- a/lucene/expressions/src/generated/checksums/generateAntlr.json
+++ b/lucene/expressions/src/generated/checksums/generateAntlr.json
@@ -1,8 +1,8 @@
{
"lucene/expressions/src/java/org/apache/lucene/expressions/js/Javascript.g4": "818e89aae0b6c7601051802013898c128fe7c1ba",
- "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java": "6965abdb8b069aaceac1ce4f32ed965b194f3a25",
- "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java": "6508dc5008e96a1ad28c967a3401407ba83f140b",
- "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptParser.java": "ba6d0c00af113f115fc7a1f165da7726afb2e8c5",
- "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java": "ec24bb2b9004bc38ee808970870deed12351039e",
+ "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java": "d0ffa1d452a12e3c69aca79ba1a4922d5d6d0e7b",
+ "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java": "38096b5359f221118bbb6b9707adf78b4d494a2f",
+ "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptParser.java": "d337c8306c9c92d98d73cccac7fd9fada395cb53",
+ "lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java": "522d962d302478459d3d0b6b11e2b8a4fe024247",
"property:antlr-version": "4.13.2"
}
diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java
index d14cda07b4a..c4efec0d547 100644
--- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java
+++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptBaseVisitor.java
@@ -1,4 +1,22 @@
-// ANTLR GENERATED CODE: DO NOT EDIT
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ANTLR GENERATED CODE: DO NOT EDIT.
+
package org.apache.lucene.expressions.js;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java
index 21169bde3a1..8470d225859 100644
--- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java
+++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptLexer.java
@@ -1,4 +1,22 @@
-// ANTLR GENERATED CODE: DO NOT EDIT
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ANTLR GENERATED CODE: DO NOT EDIT.
+
package org.apache.lucene.expressions.js;
import org.antlr.v4.runtime.*;
diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptParser.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptParser.java
index 0ad4309b248..0e5e54b5698 100644
--- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptParser.java
+++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptParser.java
@@ -1,4 +1,22 @@
-// ANTLR GENERATED CODE: DO NOT EDIT
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ANTLR GENERATED CODE: DO NOT EDIT.
+
package org.apache.lucene.expressions.js;
import java.util.List;
diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java
index cd2fbe6177a..f6445fa3c7e 100644
--- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java
+++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptVisitor.java
@@ -1,4 +1,22 @@
-// ANTLR GENERATED CODE: DO NOT EDIT
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ANTLR GENERATED CODE: DO NOT EDIT.
+
package org.apache.lucene.expressions.js;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
diff --git a/lucene/queryparser/src/generated/checksums/javaccParserFlexible.json b/lucene/queryparser/src/generated/checksums/javaccParserFlexible.json
index 7fc515f7a1e..8a1336f301e 100644
--- a/lucene/queryparser/src/generated/checksums/javaccParserFlexible.json
+++ b/lucene/queryparser/src/generated/checksums/javaccParserFlexible.json
@@ -1,9 +1,9 @@
{
- "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java": "ef2008e6ebaff7c5bd90caf5ba61fd9dc5d6ba8c",
- "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java": "dcf92073340d1c38d01905a307f49fc89e094e76",
- "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj": "77ebf56c78a8614a82532ca6bdf69378afd44b8f",
- "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserConstants.java": "4ad426d4f4b7577f4af4e9057de32c65c83b1812",
- "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java": "c264cc500a3964751827a9567ac230eda9783d9f",
- "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java": "f4cb9d01587279dba30e549ce4867e4381bbd9d7",
- "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java": "8dc34288301da07c6264d9fb8e61f82ad35e5db7"
+ "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java": "c1b095461818be6bf073ca12c383bf7c06443b7e",
+ "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java": "55bd0228665fc67e6310558eb45c32ed1e20c32d",
+ "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj": "cbcfc2d93dd684ab31e7824210cd167be210bce3",
+ "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserConstants.java": "d5e76f5f5522ae4b758d5c2f12e496fe182ae1f2",
+ "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java": "b00fca1e176bf95deb63fcb26f3eecd247b93a09",
+ "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java": "d4603a7c273e0ef5e9c8890552779e40864185f4",
+ "lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java": "d474a0039c288e5e7dfa0a0e22e16e0e0fdaeaab"
}
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java
index 894c4f8ebd4..e4c7d6e8448 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java
@@ -1,5 +1,21 @@
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 7.0 */
/* JavaCCOptions:KEEP_LINE_COLUMN=true */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.lucene.queryparser.flexible.standard.parser;
import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException;
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java
index 37b4b952931..d2db631cde2 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java
@@ -1,7 +1,5 @@
/* StandardSyntaxParser.java */
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParser.java */
-package org.apache.lucene.queryparser.flexible.standard.parser;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -18,6 +16,7 @@ package org.apache.lucene.queryparser.flexible.standard.parser;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.apache.lucene.queryparser.flexible.standard.parser;
import java.io.StringReader;
import java.io.Reader;
@@ -1383,23 +1382,23 @@ if (left.kind == RANGE_QUOTED) {
finally { jj_save(27, xla); }
}
- private boolean jj_3R_IntervalUnorderedNoOverlaps_465_3_17()
+ private boolean jj_3R_IntervalUnorderedNoOverlaps_464_3_17()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(UNORDERED_NO_OVERLAPS)) return true;
return false;
}
- private boolean jj_3R_IntervalContainedBy_557_3_25()
+ private boolean jj_3R_IntervalContainedBy_556_3_25()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(CONTAINED_BY)) return true;
return false;
}
- private boolean jj_3R_FieldRangeExpr_744_3_11()
+ private boolean jj_3R_FieldRangeExpr_743_3_11()
{
- if (jj_3R_FieldName_344_3_9()) return true;
+ if (jj_3R_FieldName_343_3_9()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(17)) {
@@ -1415,50 +1414,50 @@ if (left.kind == RANGE_QUOTED) {
return false;
}
- private boolean jj_3R_IntervalWildcard_647_3_19()
+ private boolean jj_3R_IntervalWildcard_646_3_19()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(WILDCARD)) return true;
return false;
}
- private boolean jj_3R_QuotedTerm_834_5_47()
+ private boolean jj_3R_QuotedTerm_833_5_47()
{
if (jj_scan_token(TILDE)) return true;
return false;
}
- private boolean jj_3R_IntervalUnordered_454_3_16()
+ private boolean jj_3R_IntervalUnordered_453_3_16()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(UNORDERED)) return true;
return false;
}
- private boolean jj_3R_IntervalNotContaining_546_3_24()
+ private boolean jj_3R_IntervalNotContaining_545_3_24()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(NOT_CONTAINING)) return true;
return false;
}
- private boolean jj_3R_QuotedTerm_829_3_43()
+ private boolean jj_3R_QuotedTerm_828_3_43()
{
if (jj_scan_token(QUOTED)) return true;
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_QuotedTerm_834_5_47()) jj_scanpos = xsp;
+ if (jj_3R_QuotedTerm_833_5_47()) jj_scanpos = xsp;
return false;
}
- private boolean jj_3R_IntervalNonOverlapping_636_3_30()
+ private boolean jj_3R_IntervalNonOverlapping_635_3_30()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(NON_OVERLAPPING)) return true;
return false;
}
- private boolean jj_3R_IntervalMaxGaps_442_3_14()
+ private boolean jj_3R_IntervalMaxGaps_441_3_14()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(MAXGAPS)) return true;
@@ -1471,70 +1470,70 @@ if (left.kind == RANGE_QUOTED) {
return false;
}
- private boolean jj_3R_IntervalContaining_535_3_23()
+ private boolean jj_3R_IntervalContaining_534_3_23()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(CONTAINING)) return true;
return false;
}
- private boolean jj_3R_FieldName_344_3_9()
+ private boolean jj_3R_FieldName_343_3_9()
{
if (jj_scan_token(TERM)) return true;
return false;
}
- private boolean jj_3R_IntervalOverlapping_626_3_29()
+ private boolean jj_3R_IntervalOverlapping_625_3_29()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(OVERLAPPING)) return true;
return false;
}
- private boolean jj_3R_Term_806_10_41()
+ private boolean jj_3R_Term_805_10_41()
{
- if (jj_3R_FuzzyOp_717_3_45()) return true;
+ if (jj_3R_FuzzyOp_716_3_45()) return true;
return false;
}
- private boolean jj_3R_Term_808_8_37()
+ private boolean jj_3R_Term_807_8_37()
{
- if (jj_3R_QuotedTerm_829_3_43()) return true;
+ if (jj_3R_QuotedTerm_828_3_43()) return true;
return false;
}
- private boolean jj_3R_FuzzyOp_717_3_45()
+ private boolean jj_3R_FuzzyOp_716_3_45()
{
if (jj_scan_token(TILDE)) return true;
return false;
}
- private boolean jj_3R_Term_810_5_38()
+ private boolean jj_3R_Term_809_5_38()
{
- if (jj_3R_Boost_700_3_44()) return true;
+ if (jj_3R_Boost_699_3_44()) return true;
return false;
}
- private boolean jj_3R_Term_807_8_36()
+ private boolean jj_3R_Term_806_8_36()
{
- if (jj_3R_TermRangeExpr_855_3_42()) return true;
+ if (jj_3R_TermRangeExpr_854_3_42()) return true;
return false;
}
private boolean jj_3_2()
{
- if (jj_3R_Term_798_3_10()) return true;
+ if (jj_3R_Term_797_3_10()) return true;
return false;
}
- private boolean jj_3R_IntervalMaxWidth_430_3_13()
+ private boolean jj_3R_IntervalMaxWidth_429_3_13()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(MAXWIDTH)) return true;
return false;
}
- private boolean jj_3R_Term_804_8_35()
+ private boolean jj_3R_Term_803_8_35()
{
Token xsp;
xsp = jj_scanpos;
@@ -1543,11 +1542,11 @@ if (left.kind == RANGE_QUOTED) {
if (jj_scan_token(24)) return true;
}
xsp = jj_scanpos;
- if (jj_3R_Term_806_10_41()) jj_scanpos = xsp;
+ if (jj_3R_Term_805_10_41()) jj_scanpos = xsp;
return false;
}
- private boolean jj_3R_IntervalAfter_524_3_20()
+ private boolean jj_3R_IntervalAfter_523_3_20()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(AFTER)) return true;
@@ -1556,7 +1555,7 @@ if (left.kind == RANGE_QUOTED) {
private boolean jj_3_1()
{
- if (jj_3R_FieldName_344_3_9()) return true;
+ if (jj_3R_FieldName_343_3_9()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(15)) {
@@ -1568,57 +1567,57 @@ if (left.kind == RANGE_QUOTED) {
private boolean jj_3_3()
{
- if (jj_3R_FieldRangeExpr_744_3_11()) return true;
+ if (jj_3R_FieldRangeExpr_743_3_11()) return true;
return false;
}
- private boolean jj_3R_Term_799_8_34()
+ private boolean jj_3R_Term_798_8_34()
{
if (jj_scan_token(REGEXPTERM)) return true;
return false;
}
- private boolean jj_3R_IntervalNotWithin_611_3_28()
+ private boolean jj_3R_IntervalNotWithin_610_3_28()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(NOT_WITHIN)) return true;
return false;
}
- private boolean jj_3R_IntervalBefore_513_3_21()
+ private boolean jj_3R_IntervalBefore_512_3_21()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(BEFORE)) return true;
return false;
}
- private boolean jj_3R_Term_798_3_10()
+ private boolean jj_3R_Term_797_3_10()
{
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_Term_799_8_34()) {
+ if (jj_3R_Term_798_8_34()) {
jj_scanpos = xsp;
- if (jj_3R_Term_804_8_35()) {
+ if (jj_3R_Term_803_8_35()) {
jj_scanpos = xsp;
- if (jj_3R_Term_807_8_36()) {
+ if (jj_3R_Term_806_8_36()) {
jj_scanpos = xsp;
- if (jj_3R_Term_808_8_37()) return true;
+ if (jj_3R_Term_807_8_37()) return true;
}
}
}
xsp = jj_scanpos;
- if (jj_3R_Term_810_5_38()) jj_scanpos = xsp;
+ if (jj_3R_Term_809_5_38()) jj_scanpos = xsp;
return false;
}
- private boolean jj_3R_IntervalAtLeast_418_3_12()
+ private boolean jj_3R_IntervalAtLeast_417_3_12()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(ATLEAST)) return true;
return false;
}
- private boolean jj_3R_Boost_700_3_44()
+ private boolean jj_3R_Boost_699_3_44()
{
if (jj_scan_token(CARAT)) return true;
return false;
@@ -1626,35 +1625,35 @@ if (left.kind == RANGE_QUOTED) {
private boolean jj_3_25()
{
- if (jj_3R_IntervalText_685_5_33()) return true;
+ if (jj_3R_IntervalText_684_5_33()) return true;
return false;
}
private boolean jj_3_24()
{
- if (jj_3R_IntervalFuzzyTerm_666_3_32()) return true;
+ if (jj_3R_IntervalFuzzyTerm_665_3_32()) return true;
return false;
}
private boolean jj_3_23()
{
- if (jj_3R_IntervalExtend_595_3_31()) return true;
+ if (jj_3R_IntervalExtend_594_3_31()) return true;
return false;
}
private boolean jj_3_22()
{
- if (jj_3R_IntervalNonOverlapping_636_3_30()) return true;
+ if (jj_3R_IntervalNonOverlapping_635_3_30()) return true;
return false;
}
private boolean jj_3_21()
{
- if (jj_3R_IntervalOverlapping_626_3_29()) return true;
+ if (jj_3R_IntervalOverlapping_625_3_29()) return true;
return false;
}
- private boolean jj_3R_IntervalPhrase_501_3_22()
+ private boolean jj_3R_IntervalPhrase_500_3_22()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(PHRASE)) return true;
@@ -1663,11 +1662,11 @@ if (left.kind == RANGE_QUOTED) {
private boolean jj_3_20()
{
- if (jj_3R_IntervalNotWithin_611_3_28()) return true;
+ if (jj_3R_IntervalNotWithin_610_3_28()) return true;
return false;
}
- private boolean jj_3R_IntervalExtend_595_3_31()
+ private boolean jj_3R_IntervalExtend_594_3_31()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(EXTEND)) return true;
@@ -1676,17 +1675,17 @@ if (left.kind == RANGE_QUOTED) {
private boolean jj_3_19()
{
- if (jj_3R_IntervalWithin_579_3_27()) return true;
+ if (jj_3R_IntervalWithin_578_3_27()) return true;
return false;
}
private boolean jj_3_18()
{
- if (jj_3R_IntervalNotContainedBy_568_3_26()) return true;
+ if (jj_3R_IntervalNotContainedBy_567_3_26()) return true;
return false;
}
- private boolean jj_3R_IntervalText_686_5_40()
+ private boolean jj_3R_IntervalText_685_5_40()
{
Token xsp;
xsp = jj_scanpos;
@@ -1699,76 +1698,76 @@ if (left.kind == RANGE_QUOTED) {
private boolean jj_3_17()
{
- if (jj_3R_IntervalContainedBy_557_3_25()) return true;
+ if (jj_3R_IntervalContainedBy_556_3_25()) return true;
return false;
}
- private boolean jj_3R_IntervalText_685_5_39()
+ private boolean jj_3R_IntervalText_684_5_39()
{
if (jj_scan_token(QUOTED)) return true;
return false;
}
- private boolean jj_3R_IntervalText_685_5_33()
+ private boolean jj_3R_IntervalText_684_5_33()
{
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_IntervalText_685_5_39()) {
+ if (jj_3R_IntervalText_684_5_39()) {
jj_scanpos = xsp;
- if (jj_3R_IntervalText_686_5_40()) return true;
+ if (jj_3R_IntervalText_685_5_40()) return true;
}
return false;
}
private boolean jj_3_16()
{
- if (jj_3R_IntervalNotContaining_546_3_24()) return true;
+ if (jj_3R_IntervalNotContaining_545_3_24()) return true;
return false;
}
private boolean jj_3_15()
{
- if (jj_3R_IntervalContaining_535_3_23()) return true;
+ if (jj_3R_IntervalContaining_534_3_23()) return true;
return false;
}
private boolean jj_3_14()
{
- if (jj_3R_IntervalPhrase_501_3_22()) return true;
+ if (jj_3R_IntervalPhrase_500_3_22()) return true;
return false;
}
private boolean jj_3_13()
{
- if (jj_3R_IntervalBefore_513_3_21()) return true;
+ if (jj_3R_IntervalBefore_512_3_21()) return true;
return false;
}
private boolean jj_3_12()
{
- if (jj_3R_IntervalAfter_524_3_20()) return true;
+ if (jj_3R_IntervalAfter_523_3_20()) return true;
return false;
}
private boolean jj_3_11()
{
- if (jj_3R_IntervalWildcard_647_3_19()) return true;
+ if (jj_3R_IntervalWildcard_646_3_19()) return true;
return false;
}
private boolean jj_3_10()
{
- if (jj_3R_IntervalOr_489_3_18()) return true;
+ if (jj_3R_IntervalOr_488_3_18()) return true;
return false;
}
private boolean jj_3_9()
{
- if (jj_3R_IntervalUnorderedNoOverlaps_465_3_17()) return true;
+ if (jj_3R_IntervalUnorderedNoOverlaps_464_3_17()) return true;
return false;
}
- private boolean jj_3R_IntervalOr_489_3_18()
+ private boolean jj_3R_IntervalOr_488_3_18()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(FN_OR)) return true;
@@ -1777,31 +1776,31 @@ if (left.kind == RANGE_QUOTED) {
private boolean jj_3_8()
{
- if (jj_3R_IntervalUnordered_454_3_16()) return true;
+ if (jj_3R_IntervalUnordered_453_3_16()) return true;
return false;
}
private boolean jj_3_7()
{
- if (jj_3R_IntervalOrdered_477_3_15()) return true;
+ if (jj_3R_IntervalOrdered_476_3_15()) return true;
return false;
}
private boolean jj_3_6()
{
- if (jj_3R_IntervalMaxGaps_442_3_14()) return true;
+ if (jj_3R_IntervalMaxGaps_441_3_14()) return true;
return false;
}
private boolean jj_3_5()
{
- if (jj_3R_IntervalMaxWidth_430_3_13()) return true;
+ if (jj_3R_IntervalMaxWidth_429_3_13()) return true;
return false;
}
private boolean jj_3_4()
{
- if (jj_3R_IntervalAtLeast_418_3_12()) return true;
+ if (jj_3R_IntervalAtLeast_417_3_12()) return true;
return false;
}
@@ -1811,7 +1810,7 @@ if (left.kind == RANGE_QUOTED) {
return false;
}
- private boolean jj_3R_IntervalWithin_579_3_27()
+ private boolean jj_3R_IntervalWithin_578_3_27()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(WITHIN)) return true;
@@ -1824,31 +1823,31 @@ if (left.kind == RANGE_QUOTED) {
return false;
}
- private boolean jj_3R_TermRangeExpr_856_6_46()
+ private boolean jj_3R_TermRangeExpr_855_6_46()
{
if (jj_scan_token(RANGEIN_START)) return true;
return false;
}
- private boolean jj_3R_IntervalOrdered_477_3_15()
+ private boolean jj_3R_IntervalOrdered_476_3_15()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(ORDERED)) return true;
return false;
}
- private boolean jj_3R_IntervalFuzzyTerm_666_3_32()
+ private boolean jj_3R_IntervalFuzzyTerm_665_3_32()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(FUZZYTERM)) return true;
return false;
}
- private boolean jj_3R_TermRangeExpr_855_3_42()
+ private boolean jj_3R_TermRangeExpr_854_3_42()
{
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_TermRangeExpr_856_6_46()) {
+ if (jj_3R_TermRangeExpr_855_6_46()) {
jj_scanpos = xsp;
if (jj_scan_token(28)) return true;
}
@@ -1863,7 +1862,7 @@ if (left.kind == RANGE_QUOTED) {
return false;
}
- private boolean jj_3R_IntervalNotContainedBy_568_3_26()
+ private boolean jj_3R_IntervalNotContainedBy_567_3_26()
{
if (jj_scan_token(FN_PREFIX)) return true;
if (jj_scan_token(NOT_CONTAINED_BY)) return true;
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj
index 7389ce659f0..35ebe0dee17 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj
@@ -11,8 +11,6 @@ options {
}
PARSER_BEGIN(StandardSyntaxParser)
-package org.apache.lucene.queryparser.flexible.standard.parser;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -29,6 +27,7 @@ package org.apache.lucene.queryparser.flexible.standard.parser;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package org.apache.lucene.queryparser.flexible.standard.parser;
import java.io.StringReader;
import java.io.Reader;
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserConstants.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserConstants.java
index b8868689d3e..1f1d33c134f 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserConstants.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserConstants.java
@@ -1,4 +1,20 @@
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParserConstants.java */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.lucene.queryparser.flexible.standard.parser;
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java
index fa4e2f63d13..8c2fa93a2f9 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java
@@ -1,7 +1,5 @@
/* StandardSyntaxParserTokenManager.java */
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParserTokenManager.java */
-package org.apache.lucene.queryparser.flexible.standard.parser;
- import org.apache.lucene.queryparser.charstream.CharStream;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -18,7 +16,8 @@ package org.apache.lucene.queryparser.flexible.standard.parser;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+package org.apache.lucene.queryparser.flexible.standard.parser;
+ import org.apache.lucene.queryparser.charstream.CharStream;
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java
index 55c47b3ba03..420bada1bc9 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java
@@ -1,5 +1,21 @@
/* Generated By:JavaCC: Do not edit this line. Token.java Version 7.0 */
/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COLUMN=true,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.lucene.queryparser.flexible.standard.parser;
/**
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java
index 77b5816111d..bf336f5d907 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java
@@ -1,5 +1,21 @@
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 7.0 */
/* JavaCCOptions: */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.lucene.queryparser.flexible.standard.parser;
/** Token Manager Error. */