Skip to content

Commit af831d2

Browse files
authoredNov 19, 2021
LUCENE-10239: upgrade jflex (1.7.0 -> 1.8.2) (#452)
Upgrade jflex. Change doesn't alter the behavior of any of the analyzers (unicode version or grammar refactorings), just the minimal to get new tooling working.
1 parent ad911df commit af831d2

20 files changed

+67384
-68058
lines changed
 

‎buildSrc/scriptDepVersions.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ext {
2626
"ecj": "3.25.0",
2727
"flexmark": "0.61.24",
2828
"javacc": "7.0.4",
29-
"jflex": "1.7.0",
29+
"jflex": "1.8.2",
3030
"jgit": "5.9.0.202009080501-r",
3131
]
3232
}

‎dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private boolean hasInheritedJavadocs(Element element) {
331331
if (hasOverrides) {
332332
// If an element has explicit @Overrides annotation, assume it does
333333
// have inherited javadocs somewhere.
334-
reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping.");
334+
// reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping.");
335335
return true;
336336
}
337337

@@ -348,7 +348,7 @@ private boolean hasInheritedJavadocs(Element element) {
348348
// We could check supMethod for non-empty javadoc here. Don't know if this makes
349349
// sense though as all methods will be verified in the end so it'd fail on the
350350
// top of the hierarchy (if empty) anyway.
351-
reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but method overrides another, skipping.");
351+
// reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but method overrides another, skipping.");
352352
return true;
353353
}
354354
}

‎gradle/generation/jflex.gradle

+11
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,17 @@ class JFlexTask extends DefaultTask {
270270
]
271271
}
272272

273+
// fix invalid SuppressWarnings from jflex, so that it works with javac.
274+
// we also need to suppress 'unused' because of dead code, so it passes ecjLint
275+
// you can't "stack" SuppressWarnings annotations, jflex adds its own, this is the only way
276+
// https://github.com/jflex-de/jflex/issues/762
277+
project.ant.replace(
278+
file: target,
279+
encoding: "UTF-8",
280+
token: 'SuppressWarnings("FallThrough")',
281+
value: 'SuppressWarnings({"fallthrough","unused"})'
282+
)
283+
273284
// Correct line endings for Windows.
274285
project.ant.fixcrlf(
275286
file: target,

0 commit comments

Comments
 (0)