Skip to content

Commit

Permalink
Add missing Javadoc tag descriptions in unit tests (#4629)
Browse files Browse the repository at this point in the history
* Add missing Javadoc tag descriptions in unit tests

Using JDK14 (downloaded from https://jdk.java.net/archive/), I tried
running ./gradlew check, and received errors like:

server/src/test/java/org/opensearch/indices/replication/SegmentReplicationTargetTests.java:440:
warning: no description for @throws

The build then failed with "warnings found and -Werror specified".

I tried again with JDK17 and the build passed.

According to DEVELOPER_GUIDE.md, we should be able to build with JDK14,
I added the missing Javadoc tag descriptions.

Signed-off-by: Michael Froh <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Michael Froh <[email protected]>

Signed-off-by: Michael Froh <[email protected]>
  • Loading branch information
msfroh authored Sep 29, 2022
1 parent ab6849f commit ebbddd3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add BWC version 2.3.1 ([#4513](https://github.com/opensearch-project/OpenSearch/pull/4513))
- [Segment Replication] Add snapshot and restore tests for segment replication feature ([#3993](https://github.com/opensearch-project/OpenSearch/pull/3993))
- Added missing javadocs for `:example-plugins` modules ([#4540](https://github.com/opensearch-project/OpenSearch/pull/4540))
- Add missing Javadoc tag descriptions in unit tests ([#4629](https://github.com/opensearch-project/OpenSearch/pull/4629))
### Dependencies
- Bumps `log4j-core` from 2.18.0 to 2.19.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected List<SearchPlugin> getSearchPlugins() {
/**
* Testing Empty aggregator results.
*
* @throws Exception
* @throws Exception if an error occurs accessing the index
*/
public void testEmpty() throws Exception {
try (Directory dir = newDirectory(); RandomIndexWriter w = new RandomIndexWriter(random(), dir)) {
Expand All @@ -93,7 +93,7 @@ public void testEmpty() throws Exception {
/**
* Testing GeoBoundAggregator for random shapes which are indexed.
*
* @throws Exception
* @throws Exception if an error occurs accessing the index
*/
public void testRandom() throws Exception {
final int numDocs = randomIntBetween(50, 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public void onFailure(Exception e) {

/**
* This tests ensures that new files generated on primary (due to delete operation) are not considered missing on replica
* @throws IOException
* @throws IOException if an indexing operation fails or segment replication fails
*/
public void test_MissingFiles_NotCausingFailure() throws IOException {
int docCount = 1 + random().nextInt(10);
Expand Down Expand Up @@ -435,9 +435,9 @@ public void onFailure(Exception e) {
/**
* Generates a list of Store.MetadataSnapshot with two elements where second snapshot has extra files due to delete
* operation. A list of snapshots is returned so that identical files have same checksum.
* @param docCount
* @return
* @throws IOException
* @param docCount the number of documents to index in the first snapshot
* @return a list of Store.MetadataSnapshot with two elements where second snapshot has extra files due to delete
* @throws IOException if one of the indexing operations fails
*/
private List<Store.MetadataSnapshot> generateStoreMetadataSnapshot(int docCount) throws IOException {
List<Document> docList = new ArrayList<>();
Expand Down

0 comments on commit ebbddd3

Please sign in to comment.