From 351b30489c2a47f32500abbb7bdc4ea30e37a247 Mon Sep 17 00:00:00 2001
From: Dawid Weiss
Date: Mon, 20 Jan 2020 10:10:48 +0100
Subject: [PATCH] LUCENE-9077: Enable javac linting as in ant. TONS of warnings
are currently printed.
---
gradle/defaults-java.gradle | 15 +++++++++++++--
.../tools/CheckLinksAndAnchors.java | 4 ++--
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/gradle/defaults-java.gradle b/gradle/defaults-java.gradle
index 896b8bb233b..ac0802e6217 100644
--- a/gradle/defaults-java.gradle
+++ b/gradle/defaults-java.gradle
@@ -5,7 +5,18 @@ allprojects {
sourceCompatibility = "11"
targetCompatibility = "11"
- compileJava.options.encoding = "UTF-8"
- compileTestJava.options.encoding = "UTF-8"
+ tasks.withType(JavaCompile) {
+ options.encoding = "UTF-8"
+ options.compilerArgs += [
+ "-Xlint",
+ "-Xlint:-deprecation",
+ "-Xlint:-serial",
+
+ "-Xdoclint:all/protected",
+ "-Xdoclint:-missing",
+ "-Xdoclint:-accessibility",
+ "-proc:none", // proc:none was added because of LOG4J2-1925 / JDK-8186647
+ ]
+ }
}
}
diff --git a/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java b/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java
index fb9ce10e883..7aeb1ed7723 100644
--- a/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java
+++ b/solr/solr-ref-guide/tools/CheckLinksAndAnchors.java
@@ -78,7 +78,7 @@ import org.jsoup.select.NodeVisitor;
* This tool supports 2 command line options:
*
*
- * - -check-all-relative-links
+ * - -check-all-relative-links
*
By default, only relative links to files in the same directory (ie: not startin with
* "../"
are checked for existence. This means that we can do a "quick" validatation of
* links to other ref-guide files, but ignore relative links to things outside of the ref-guide --
@@ -86,7 +86,7 @@ import org.jsoup.select.NodeVisitor;
* also check relative links where the path starts with "../"
*
*
- * - -bare-bones
+ * - -bare-bones
*
By default, this tool assumes it is analyzing Jekyll generated files. If this option is specified,
* then it instead assumes it's checking "bare bones" HTML files...
*