Skip to content

Commit d2d35c2

Browse files
committed
Build: Mostly silence warning about html4 javadoc (#30220)
This *mostly* silences `javadoc`'s warning about defaulting to generating html4 files by enabling generating html5 file for the projects for which that works. It didn't work in a half dozen projects, about half of which I've fixed in this PR, entirely by replacing `<tt>thing</tt>` with `{@code thing}`. There are a few remaining projects that contain javadoc with invalid html5. I'll fix those projects in a followup.
1 parent 457a66e commit d2d35c2

File tree

10 files changed

+40
-22
lines changed

10 files changed

+40
-22
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,25 @@ class BuildPlugin implements Plugin<Project> {
549549
javadoc.classpath = javadoc.getClasspath().filter { f ->
550550
return classes.contains(f) == false
551551
}
552+
/*
553+
* Force html5 on projects that support it to silence the warning
554+
* that `javadoc` will change its defaults in the future.
555+
*
556+
* But not all of our javadoc is actually valid html5. So we
557+
* have to become valid incrementally. We only set html5 on the
558+
* projects we have converted so that we still get the annoying
559+
* warning on the unconverted ones. That will give us an
560+
* incentive to convert them....
561+
*/
562+
List html4Projects = [
563+
':server',
564+
':libs:elasticsearch-core',
565+
':test:framework',
566+
':x-pack:plugin:core',
567+
]
568+
if (false == html4Projects.contains(project.path)) {
569+
javadoc.options.addBooleanOption('html5', true)
570+
}
552571
}
553572
configureJavadocJar(project)
554573
}

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/NoopBulkRequestBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ public NoopBulkRequestBuilder setWaitForActiveShards(final int waitForActiveShar
129129
}
130130

131131
/**
132-
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
132+
* A timeout to wait if the index operation can't be performed immediately.
133+
* Defaults to {@code 1m}.
133134
*/
134135
public final NoopBulkRequestBuilder setTimeout(TimeValue timeout) {
135136
request.timeout(timeout);
136137
return this;
137138
}
138139

139140
/**
140-
* A timeout to wait if the index operation can't be performed immediately. Defaults to <tt>1m</tt>.
141+
* A timeout to wait if the index operation can't be performed immediately.
142+
* Defaults to {@code 1m}.
141143
*/
142144
public final NoopBulkRequestBuilder setTimeout(String timeout) {
143145
request.timeout(timeout);
@@ -151,4 +153,3 @@ public int numberOfActions() {
151153
return request.numberOfActions();
152154
}
153155
}
154-

client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/NoopSearchRequestBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public NoopSearchRequestBuilder setRouting(String... routing) {
142142

143143
/**
144144
* Sets the preference to execute the search. Defaults to randomize across shards. Can be set to
145-
* <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or
145+
* {@code _local} to prefer local shards, {@code _primary} to execute only on primary shards, or
146146
* a custom value, which guarantees that the same order will be used across different requests.
147147
*/
148148
public NoopSearchRequestBuilder setPreference(String preference) {
@@ -188,15 +188,15 @@ public NoopSearchRequestBuilder setMinScore(float minScore) {
188188
}
189189

190190
/**
191-
* From index to start the search from. Defaults to <tt>0</tt>.
191+
* From index to start the search from. Defaults to {@code 0}.
192192
*/
193193
public NoopSearchRequestBuilder setFrom(int from) {
194194
sourceBuilder().from(from);
195195
return this;
196196
}
197197

198198
/**
199-
* The number of search hits to return. Defaults to <tt>10</tt>.
199+
* The number of search hits to return. Defaults to {@code 10}.
200200
*/
201201
public NoopSearchRequestBuilder setSize(int size) {
202202
sourceBuilder().size(size);
@@ -349,7 +349,7 @@ public NoopSearchRequestBuilder slice(SliceBuilder builder) {
349349

350350
/**
351351
* Applies when sorting, and controls if scores will be tracked as well. Defaults to
352-
* <tt>false</tt>.
352+
* {@code false}.
353353
*/
354354
public NoopSearchRequestBuilder setTrackScores(boolean trackScores) {
355355
sourceBuilder().trackScores(trackScores);

modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
import java.util.Objects;
5858

5959
/**
60-
* A query builder for <tt>has_child</tt> query.
60+
* A query builder for {@code has_child} query.
6161
*/
6262
public class HasChildQueryBuilder extends AbstractQueryBuilder<HasChildQueryBuilder> {
6363
public static final String NAME = "has_child";

modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/DiscountedCumulativeGain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
/**
4343
* Metric implementing Discounted Cumulative Gain.
44-
* The `normalize` parameter can be set to calculate the normalized NDCG (set to <tt>false</tt> by default).<br>
44+
* The `normalize` parameter can be set to calculate the normalized NDCG (set to {@code false} by default).<br>
4545
* The optional `unknown_doc_rating` parameter can be used to specify a default rating for unlabeled documents.
4646
* @see <a href="https://en.wikipedia.org/wiki/Discounted_cumulative_gain#Discounted_Cumulative_Gain">Discounted Cumulative Gain</a><br>
4747
*/

modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public Map<String, Object> getParams() {
192192
return Collections.unmodifiableMap(this.params);
193193
}
194194

195-
/** return the parameters if this request uses a template, otherwise this will be <tt>null</tt>. */
195+
/** return the parameters if this request uses a template, otherwise this will be {@code null}. */
196196
public String getTemplateId() {
197197
return this.templateId;
198198
}

plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuCollationTokenFilterFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636

3737
/**
3838
* An ICU based collation token filter. There are two ways to configure collation:
39-
* <p>The first is simply specifying the locale (defaults to the default locale). The <tt>language</tt>
40-
* parameter is the lowercase two-letter ISO-639 code. An additional <tt>country</tt> and <tt>variant</tt>
39+
* <p>The first is simply specifying the locale (defaults to the default locale). The {@code language}
40+
* parameter is the lowercase two-letter ISO-639 code. An additional {@code country} and {@code variant}
4141
* can be provided.
4242
* <p>The second option is to specify collation rules as defined in the <a href="http://www.icu-project.org/userguide/Collate_Customization.html">
43-
* Collation customization</a> chapter in icu docs. The <tt>rules</tt> parameter can either embed the rules definition
44-
* in the settings or refer to an external location (preferable located under the <tt>config</tt> location, relative to it).
43+
* Collation customization</a> chapter in icu docs. The {@code rules} parameter can either embed the rules definition
44+
* in the settings or refer to an external location (preferable located under the {@code config} location, relative to it).
4545
*/
4646
public class IcuCollationTokenFilterFactory extends AbstractTokenFilterFactory {
4747

plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuFoldingTokenFilterFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* Can be filtered to handle certain characters in a specified way (see http://icu-project.org/apiref/icu4j/com/ibm/icu/text/UnicodeSet.html)
3636
* E.g national chars that should be retained (filter : "[^åäöÅÄÖ]").
3737
*
38-
* <p>The <tt>unicodeSetFilter</tt> attribute can be used to provide the UniCodeSet for filtering.
38+
* <p>The {@code unicodeSetFilter} attribute can be used to provide the UniCodeSet for filtering.
3939
*
4040
* @author kimchy (shay.banon)
4141
*/

plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuNormalizerCharFilterFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
/**
3434
* Uses the {@link org.apache.lucene.analysis.icu.ICUNormalizer2CharFilter} to normalize character.
35-
* <p>The <tt>name</tt> can be used to provide the type of normalization to perform.</p>
36-
* <p>The <tt>mode</tt> can be used to provide 'compose' or 'decompose'. Default is compose.</p>
37-
* <p>The <tt>unicodeSetFilter</tt> attribute can be used to provide the UniCodeSet for filtering.</p>
35+
* <p>The {@code name} can be used to provide the type of normalization to perform.</p>
36+
* <p>The {@code mode} can be used to provide 'compose' or 'decompose'. Default is compose.</p>
37+
* <p>The {@code unicodeSetFilter} attribute can be used to provide the UniCodeSet for filtering.</p>
3838
*/
3939
public class IcuNormalizerCharFilterFactory extends AbstractCharFilterFactory implements MultiTermAwareComponent {
4040

plugins/analysis-icu/src/main/java/org/elasticsearch/index/analysis/IcuNormalizerTokenFilterFactory.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131

3232
/**
3333
* Uses the {@link org.apache.lucene.analysis.icu.ICUNormalizer2Filter} to normalize tokens.
34-
* <p>The <tt>name</tt> can be used to provide the type of normalization to perform.</p>
35-
* <p>The <tt>unicodeSetFilter</tt> attribute can be used to provide the UniCodeSet for filtering.</p>
36-
*
37-
*
34+
* <p>The {@code name} can be used to provide the type of normalization to perform.</p>
35+
* <p>The {@code unicodeSetFilter} attribute can be used to provide the UniCodeSet for filtering.</p>
3836
*/
3937
public class IcuNormalizerTokenFilterFactory extends AbstractTokenFilterFactory implements MultiTermAwareComponent {
4038

0 commit comments

Comments
 (0)