Skip to content

Commit b19a204

Browse files
committed
HTML5ify Javadoc for core and test framework (#30234)
`javadoc` will switch from detaulting to html4 to html5 in "a future release". We should get ahead of it so we're not surprised. Also, HTML5 is the future! Er, the present. Anyway, this follows up from #30220 to make the Javadoc for two of the four remaining projects HTML5 compatible.
1 parent 82f0527 commit b19a204

File tree

8 files changed

+34
-37
lines changed

8 files changed

+34
-37
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,6 @@ class BuildPlugin implements Plugin<Project> {
561561
*/
562562
List html4Projects = [
563563
':server',
564-
':libs:elasticsearch-core',
565-
':test:framework',
566564
':x-pack:plugin:core',
567565
]
568566
if (false == html4Projects.contains(project.path)) {

libs/elasticsearch-core/src/main/java/org/elasticsearch/common/Booleans.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static Boolean parseBoolean(String value, Boolean defaultValue) {
107107
}
108108

109109
/**
110-
* Returns <code>false</code> if text is in <tt>false</tt>, <tt>0</tt>, <tt>off</tt>, <tt>no</tt>; else, true
110+
* Returns {@code false} if text is in "false", "0", "off", "no"; else, {@code true}.
111111
*
112112
* @deprecated Only kept to provide automatic upgrades for pre 6.0 indices. Use {@link #parseBoolean(String, Boolean)} instead.
113113
*/
@@ -119,9 +119,7 @@ public static Boolean parseBooleanLenient(String value, Boolean defaultValue) {
119119
return parseBooleanLenient(value, false);
120120
}
121121
/**
122-
* Returns <code>true</code> iff the value is neither of the following:
123-
* <tt>false</tt>, <tt>0</tt>, <tt>off</tt>, <tt>no</tt>
124-
* otherwise <code>false</code>
122+
* Returns {@code false} if text is in "false", "0", "off", "no"; else, {@code true}.
125123
*
126124
* @deprecated Only kept to provide automatic upgrades for pre 6.0 indices. Use {@link #parseBoolean(String, boolean)} instead.
127125
*/
@@ -134,21 +132,21 @@ public static boolean parseBooleanLenient(String value, boolean defaultValue) {
134132
}
135133

136134
/**
137-
* @return <code>true</code> iff the value is <tt>false</tt>, otherwise <code>false</code>.
135+
* @return {@code true} iff the value is "false", otherwise {@code false}.
138136
*/
139137
public static boolean isFalse(String value) {
140138
return "false".equals(value);
141139
}
142140

143141
/**
144-
* @return <code>true</code> iff the value is <tt>true</tt>, otherwise <code>false</code>
142+
* @return {@code true} iff the value is "true", otherwise {@code false}.
145143
*/
146144
public static boolean isTrue(String value) {
147145
return "true".equals(value);
148146
}
149147

150148
/**
151-
* Returns <code>false</code> if text is in <tt>false</tt>, <tt>0</tt>, <tt>off</tt>, <tt>no</tt>; else, true
149+
* Returns {@code false} if text is in "false", "0", "off", "no"; else, {@code true}.
152150
*
153151
* @deprecated Only kept to provide automatic upgrades for pre 6.0 indices. Use {@link #parseBoolean(char[], int, int, boolean)} instead
154152
*/

libs/elasticsearch-core/src/main/java/org/elasticsearch/core/internal/io/IOUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
public final class IOUtils {
3838

3939
private IOUtils() {
40-
40+
// Static utils methods
4141
}
4242

4343
/**
44-
* Closes all given <tt>Closeable</tt>s. Some of the <tt>Closeable</tt>s may be null; they are
44+
* Closes all given {@link Closeable}s. Some of the {@linkplain Closeable}s may be null; they are
4545
* ignored. After everything is closed, the method either throws the first exception it hit
4646
* while closing with other exceptions added as suppressed, or completes normally if there were
4747
* no exceptions.
@@ -53,7 +53,7 @@ public static void close(final Closeable... objects) throws IOException {
5353
}
5454

5555
/**
56-
* Closes all given <tt>Closeable</tt>s. Some of the <tt>Closeable</tt>s may be null; they are
56+
* Closes all given {@link Closeable}s. Some of the {@linkplain Closeable}s may be null; they are
5757
* ignored. After everything is closed, the method adds any exceptions as suppressed to the
5858
* original exception, or throws the first exception it hit if {@code Exception} is null. If
5959
* no exceptions are encountered and the passed in exception is null, it completes normally.
@@ -65,7 +65,7 @@ public static void close(final Exception e, final Closeable... objects) throws I
6565
}
6666

6767
/**
68-
* Closes all given <tt>Closeable</tt>s. Some of the <tt>Closeable</tt>s may be null; they are
68+
* Closes all given {@link Closeable}s. Some of the {@linkplain Closeable}s may be null; they are
6969
* ignored. After everything is closed, the method either throws the first exception it hit
7070
* while closing with other exceptions added as suppressed, or completes normally if there were
7171
* no exceptions.

test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@ public void indexRandom(boolean forceRefresh, boolean dummyDocuments, IndexReque
13521352
* segment or if only one document is in a segment etc. This method prevents issues like this by randomizing the index
13531353
* layout.
13541354
*
1355-
* @param forceRefresh if <tt>true</tt> all involved indices are refreshed once the documents are indexed. Additionally if <tt>true</tt>
1355+
* @param forceRefresh if {@code true} all involved indices are refreshed once the documents are indexed. Additionally if {@code true}
13561356
* some empty dummy documents are may be randomly inserted into the document list and deleted once all documents are indexed.
13571357
* This is useful to produce deleted documents on the server side.
13581358
* @param builders the documents to index.
@@ -1369,8 +1369,8 @@ public void indexRandom(boolean forceRefresh, List<IndexRequestBuilder> builders
13691369
* segment or if only one document is in a segment etc. This method prevents issues like this by randomizing the index
13701370
* layout.
13711371
*
1372-
* @param forceRefresh if <tt>true</tt> all involved indices are refreshed once the documents are indexed.
1373-
* @param dummyDocuments if <tt>true</tt> some empty dummy documents may be randomly inserted into the document list and deleted once
1372+
* @param forceRefresh if {@code true} all involved indices are refreshed once the documents are indexed.
1373+
* @param dummyDocuments if {@code true} some empty dummy documents may be randomly inserted into the document list and deleted once
13741374
* all documents are indexed. This is useful to produce deleted documents on the server side.
13751375
* @param builders the documents to index.
13761376
*/
@@ -1385,10 +1385,10 @@ public void indexRandom(boolean forceRefresh, boolean dummyDocuments, List<Index
13851385
* segment or if only one document is in a segment etc. This method prevents issues like this by randomizing the index
13861386
* layout.
13871387
*
1388-
* @param forceRefresh if <tt>true</tt> all involved indices are refreshed once the documents are indexed.
1389-
* @param dummyDocuments if <tt>true</tt> some empty dummy documents may be randomly inserted into the document list and deleted once
1388+
* @param forceRefresh if {@code true} all involved indices are refreshed once the documents are indexed.
1389+
* @param dummyDocuments if {@code true} some empty dummy documents may be randomly inserted into the document list and deleted once
13901390
* all documents are indexed. This is useful to produce deleted documents on the server side.
1391-
* @param maybeFlush if <tt>true</tt> this method may randomly execute full flushes after index operations.
1391+
* @param maybeFlush if {@code true} this method may randomly execute full flushes after index operations.
13921392
* @param builders the documents to index.
13931393
*/
13941394
public void indexRandom(boolean forceRefresh, boolean dummyDocuments, boolean maybeFlush, List<IndexRequestBuilder> builders) throws InterruptedException, ExecutionException {
@@ -1554,27 +1554,27 @@ public enum Scope {
15541554
Scope scope() default Scope.SUITE;
15551555

15561556
/**
1557-
* Returns the number of nodes in the cluster. Default is <tt>-1</tt> which means
1557+
* Returns the number of nodes in the cluster. Default is {@code -1} which means
15581558
* a random number of nodes is used, where the minimum and maximum number of nodes
15591559
* are either the specified ones or the default ones if not specified.
15601560
*/
15611561
int numDataNodes() default -1;
15621562

15631563
/**
1564-
* Returns the minimum number of data nodes in the cluster. Default is <tt>-1</tt>.
1564+
* Returns the minimum number of data nodes in the cluster. Default is {@code -1}.
15651565
* Ignored when {@link ClusterScope#numDataNodes()} is set.
15661566
*/
15671567
int minNumDataNodes() default -1;
15681568

15691569
/**
1570-
* Returns the maximum number of data nodes in the cluster. Default is <tt>-1</tt>.
1570+
* Returns the maximum number of data nodes in the cluster. Default is {@code -1}.
15711571
* Ignored when {@link ClusterScope#numDataNodes()} is set.
15721572
*/
15731573
int maxNumDataNodes() default -1;
15741574

15751575
/**
1576-
* Indicates whether the cluster can have dedicated master nodes. If <tt>false</tt> means data nodes will serve as master nodes
1577-
* and there will be no dedicated master (and data) nodes. Default is <tt>true</tt> which means
1576+
* Indicates whether the cluster can have dedicated master nodes. If {@code false} means data nodes will serve as master nodes
1577+
* and there will be no dedicated master (and data) nodes. Default is {@code false} which means
15781578
* dedicated master nodes will be randomly used.
15791579
*/
15801580
boolean supportsDedicatedMasters() default true;
@@ -1703,7 +1703,7 @@ private int getNumClientNodes() {
17031703
}
17041704

17051705
/**
1706-
* This method is used to obtain settings for the <tt>Nth</tt> node in the cluster.
1706+
* This method is used to obtain settings for the {@code N}th node in the cluster.
17071707
* Nodes in this cluster are associated with an ordinal number such that nodes can
17081708
* be started with specific configurations. This method might be called multiple
17091709
* times with the same ordinal and is expected to return the same value for each invocation.
@@ -1878,15 +1878,15 @@ public Collection<Class<? extends Plugin>> transportClientPlugins() {
18781878

18791879
/**
18801880
* Iff this returns true mock transport implementations are used for the test runs. Otherwise not mock transport impls are used.
1881-
* The default is <tt>true</tt>
1881+
* The default is {@code true}.
18821882
*/
18831883
protected boolean addMockTransportService() {
18841884
return true;
18851885
}
18861886

18871887
/**
18881888
* Iff this returns true test zen discovery implementations is used for the test runs.
1889-
* The default is <tt>true</tt>
1889+
* The default is {@code true}.
18901890
*/
18911891
protected boolean addTestZenDiscovery() {
18921892
return true;
@@ -1957,7 +1957,7 @@ private static double transportClientRatio() {
19571957
/**
19581958
* Returns the transport client ratio from the class level annotation or via
19591959
* {@link System#getProperty(String)} if available. If both are not available this will
1960-
* return a random ratio in the interval <tt>[0..1]</tt>
1960+
* return a random ratio in the interval {@code [0..1]}.
19611961
*/
19621962
protected double getPerTestTransportClientRatio() {
19631963
final ClusterScope annotation = getAnnotation(this.getClass(), ClusterScope.class);

test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ public Settings onNodeStopped(String nodeName) throws Exception {
19781978
}
19791979

19801980
/**
1981-
* Executed for each node before the <tt>n+1</tt> node is restarted. The given client is
1981+
* Executed for each node before the {@code n + 1} node is restarted. The given client is
19821982
* an active client to the node that will be restarted next.
19831983
*/
19841984
public void doAfterNodes(int n, Client client) throws Exception {

test/framework/src/main/java/org/elasticsearch/test/XContentTestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private static String differenceBetweenObjectsIgnoringArrayOrder(String path, Ob
145145
* If the xContent output contains objects that should be skipped of such treatment, an optional filtering
146146
* {@link Predicate} can be supplied that checks xContent paths that should be excluded from this treatment.
147147
*
148-
* This predicate should check the xContent path that we want to insert to and return <tt>true</tt> if the
148+
* This predicate should check the xContent path that we want to insert to and return {@code true} if the
149149
* path should be excluded. Paths are string concatenating field names and array indices, so e.g. in:
150150
*
151151
* <pre>

test/framework/src/main/java/org/elasticsearch/test/engine/MockEngineSupport.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@
1919
package org.elasticsearch.test.engine;
2020

2121
import org.apache.logging.log4j.Logger;
22+
import org.apache.lucene.index.AssertingDirectoryReader;
2223
import org.apache.lucene.index.DirectoryReader;
2324
import org.apache.lucene.index.FilterDirectoryReader;
2425
import org.apache.lucene.index.IndexReader;
2526
import org.apache.lucene.search.AssertingIndexSearcher;
26-
import org.apache.lucene.search.IndexSearcher;
2727
import org.apache.lucene.search.QueryCache;
2828
import org.apache.lucene.search.QueryCachingPolicy;
29-
import org.apache.lucene.search.ReferenceManager;
3029
import org.apache.lucene.util.LuceneTestCase;
3130
import org.elasticsearch.ElasticsearchException;
3231
import org.elasticsearch.common.logging.Loggers;
@@ -38,6 +37,7 @@
3837
import org.elasticsearch.index.engine.EngineException;
3938
import org.elasticsearch.index.shard.ShardId;
4039
import org.elasticsearch.test.ESIntegTestCase;
40+
import org.elasticsearch.test.engine.MockInternalEngine;
4141

4242
import java.io.Closeable;
4343
import java.io.IOException;
@@ -47,14 +47,15 @@
4747
import java.util.concurrent.atomic.AtomicBoolean;
4848

4949
/**
50-
* Support class to build MockEngines like {@link org.elasticsearch.test.engine.MockInternalEngine}
50+
* Support class to build MockEngines like {@link MockInternalEngine}
5151
* since they need to subclass the actual engine
5252
*/
5353
public final class MockEngineSupport {
5454

5555
/**
56-
* Allows tests to wrap an index reader randomly with a given ratio. This is disabled by default ie. <tt>0.0d</tt> since reader wrapping is insanely
57-
* slow if {@link org.apache.lucene.index.AssertingDirectoryReader} is used.
56+
* Allows tests to wrap an index reader randomly with a given ratio. This
57+
* is disabled by default ie. {@code 0.0d} since reader wrapping is insanely
58+
* slow if {@link AssertingDirectoryReader} is used.
5859
*/
5960
public static final Setting<Double> WRAP_READER_RATIO =
6061
Setting.doubleSetting("index.engine.mock.random.wrap_reader_ratio", 0.0d, 0.0d, Property.IndexScope);

test/framework/src/main/java/org/elasticsearch/test/transport/MockTransportService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public void clearRule() {
474474
/**
475475
* Adds a new delegate transport that is used for communication with the given transport service.
476476
*
477-
* @return <tt>true</tt> iff no other delegate was registered for any of the addresses bound by transport service.
477+
* @return {@code true} iff no other delegate was registered for any of the addresses bound by transport service.
478478
*/
479479
public boolean addDelegate(TransportService transportService, DelegateTransport transport) {
480480
boolean noRegistered = true;
@@ -487,7 +487,7 @@ public boolean addDelegate(TransportService transportService, DelegateTransport
487487
/**
488488
* Adds a new delegate transport that is used for communication with the given transport address.
489489
*
490-
* @return <tt>true</tt> iff no other delegate was registered for this address before.
490+
* @return {@code true} iff no other delegate was registered for this address before.
491491
*/
492492
public boolean addDelegate(TransportAddress transportAddress, DelegateTransport transport) {
493493
return transport().transports.put(transportAddress, transport) == null;

0 commit comments

Comments
 (0)