From 3b17275e4325f91046a9fdf43e6715ffea3f2d5c Mon Sep 17 00:00:00 2001 From: Himanshu Setia Date: Fri, 14 May 2021 14:47:32 -0700 Subject: [PATCH 1/2] Fixes precommit task configuration failures due to newly added missingJavadoc task Signed-off-by: Himanshu Setia --- gradle/missing-javadoc.gradle | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/gradle/missing-javadoc.gradle b/gradle/missing-javadoc.gradle index 5879b58168e17..440c2867dec1f 100644 --- a/gradle/missing-javadoc.gradle +++ b/gradle/missing-javadoc.gradle @@ -52,20 +52,22 @@ allprojects { docroot = file("${buildDir}/site") } - // TODO: Enable missingJavadoc task + // TODO: Add missingJavadoc checks to precommit plugin // See https://github.com/opendistro-for-elasticsearch/search/issues/221 - // Once we get the javadocs ready for the code base - // we will disable the default javadoc task and use our own - // missingJavadoc task below. The default javadoc task - // will just invoke 'missingJavadoc' (to allow people to call - // conventional task name). - tasks.matching { it.name == "javadoc" }.all { + // Currently the missingJavadoc task fails due to missing documentation + // across multiple modules. Once javadocs are added, we can + // add this task to precommit plugin. + tasks.withType(MissingJavadocTask).configureEach { enabled = true - // enabled = false - // dependsOn "missingJavadoc" + title = "${project.rootProject.name} ${project.name} API" + + // Set up custom doclet. + dependsOn configurations.missingdoclet + docletpath = configurations.missingdoclet } - task missingJavadoc(type: MissingJavadocTask) { + + tasks.register('missingJavadoc', MissingJavadocTask) { description "This task validates and generates Javadoc API documentation for the main source code." group "documentation" @@ -79,16 +81,6 @@ allprojects { } } -allprojects { - project.tasks.withType(MissingJavadocTask) { - title = "${project.rootProject.name} ${project.name} API" - - // Set up custom doclet. - dependsOn configurations.missingdoclet - docletpath = configurations.missingdoclet - } -} - class MissingJavadocTask extends DefaultTask { @InputFiles @SkipWhenEmpty From 90cbbd4bbfef1d8a6d91c9cfb9654d3823cfab5e Mon Sep 17 00:00:00 2001 From: Himanshu Setia Date: Fri, 14 May 2021 15:31:55 -0700 Subject: [PATCH 2/2] Fixes javadoc task errors due to PR#685 Signed-off-by: Himanshu Setia --- .../rest/src/main/java/org/opensearch/client/NodeSelector.java | 2 +- .../src/main/java/org/opensearch/client/RestClientBuilder.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/rest/src/main/java/org/opensearch/client/NodeSelector.java b/client/rest/src/main/java/org/opensearch/client/NodeSelector.java index e9f0b4b9f8b59..0e11c113be31c 100644 --- a/client/rest/src/main/java/org/opensearch/client/NodeSelector.java +++ b/client/rest/src/main/java/org/opensearch/client/NodeSelector.java @@ -54,7 +54,7 @@ public interface NodeSelector { *

* Implementers should not rely on the ordering of the nodes. * - * @param nodes the {@Node}s targeted for the sending requests + * @param nodes the {@link Node}s targeted for the sending requests */ void select(Iterable nodes); /* diff --git a/client/rest/src/main/java/org/opensearch/client/RestClientBuilder.java b/client/rest/src/main/java/org/opensearch/client/RestClientBuilder.java index 72800f1c0706f..cd6d9b9b75f1d 100644 --- a/client/rest/src/main/java/org/opensearch/client/RestClientBuilder.java +++ b/client/rest/src/main/java/org/opensearch/client/RestClientBuilder.java @@ -179,7 +179,7 @@ public RestClientBuilder setPathPrefix(String pathPrefix) { * @param pathPrefix the path prefix to be cleaned up. * @return the cleaned up path prefix. * @throws NullPointerException if {@code pathPrefix} is {@code null}. - * @throws IllegalArgumentException if {@pathPrefix} is empty, or ends with more than one '/'. + * @throws IllegalArgumentException if {@code pathPrefix} is empty, or ends with more than one '/'. */ public static String cleanPathPrefix(String pathPrefix) { Objects.requireNonNull(pathPrefix, "pathPrefix must not be null");