Skip to content

Commit

Permalink
Address some Java 21 warns
Browse files Browse the repository at this point in the history
Disable or suppress "this escape" as that's unavoidable in most of the
codebase.

Signed-off-by: thc202 <[email protected]>
  • Loading branch information
thc202 committed Jun 20, 2024
1 parent cebd4ec commit d8acbb0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addOns/addOns.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ subprojects {
}
}

tasks.withType<JavaCompile>().configureEach {
if (JavaVersion.current().getMajorVersion() >= "21") {
options.compilerArgs = options.compilerArgs + "-Xlint:-this-escape"
}
}

tasks.named<JacocoReport>("jacocoTestReport") {
reports {
xml.required.set(true)
Expand Down
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ allprojects {
}

tasks.withType<JavaCompile>().configureEach {
if (JavaVersion.current().getMajorVersion() >= "21") {
options.compilerArgs = options.compilerArgs + "-Xlint:-this-escape"
}
options.errorprone {
disableAllChecks.set(true)
error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class ProcessSvnDiggerFiles extends DefaultTask {
private final ConfigurableFileTree sourceFiles;
private final DirectoryProperty outputDir;

@SuppressWarnings("this-escape")
public ProcessSvnDiggerFiles() {
this.sourceFiles = getProject().fileTree(getProject().file("src/main/" + SVNDIGGER_DIR));
this.sourceFiles.exclude(LICENCE_FILE_NAME, README_FILE_NAME);
Expand Down

0 comments on commit d8acbb0

Please sign in to comment.