Skip to content

Commit

Permalink
LUCENE-10239: upgrade jflex (1.7.0 -> 1.8.2) (#452)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rmuir authored Nov 19, 2021
1 parent ad911df commit af831d2
Show file tree
Hide file tree
Showing 20 changed files with 67,384 additions and 68,058 deletions.
2 changes: 1 addition & 1 deletion buildSrc/scriptDepVersions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ext {
"ecj": "3.25.0",
"flexmark": "0.61.24",
"javacc": "7.0.4",
"jflex": "1.7.0",
"jflex": "1.8.2",
"jgit": "5.9.0.202009080501-r",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ private boolean hasInheritedJavadocs(Element element) {
if (hasOverrides) {
// If an element has explicit @Overrides annotation, assume it does
// have inherited javadocs somewhere.
reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping.");
// reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping.");
return true;
}

Expand All @@ -348,7 +348,7 @@ private boolean hasInheritedJavadocs(Element element) {
// We could check supMethod for non-empty javadoc here. Don't know if this makes
// sense though as all methods will be verified in the end so it'd fail on the
// top of the hierarchy (if empty) anyway.
reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but method overrides another, skipping.");
// reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but method overrides another, skipping.");
return true;
}
}
Expand Down
11 changes: 11 additions & 0 deletions gradle/generation/jflex.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ class JFlexTask extends DefaultTask {
]
}

// fix invalid SuppressWarnings from jflex, so that it works with javac.
// we also need to suppress 'unused' because of dead code, so it passes ecjLint
// you can't "stack" SuppressWarnings annotations, jflex adds its own, this is the only way
// https://github.com/jflex-de/jflex/issues/762
project.ant.replace(
file: target,
encoding: "UTF-8",
token: 'SuppressWarnings("FallThrough")',
value: 'SuppressWarnings({"fallthrough","unused"})'
)

// Correct line endings for Windows.
project.ant.fixcrlf(
file: target,
Expand Down
Loading

0 comments on commit af831d2

Please sign in to comment.