Skip to content

[Feature/extensions]Enforce type safety for NamedWriteableRegistryParseRequest#4923

Merged
owaiskazi19 merged 3 commits intoopensearch-project:feature/extensionsfrom
mloufra:cleanupwarning
Oct 26, 2022
Merged

[Feature/extensions]Enforce type safety for NamedWriteableRegistryParseRequest#4923
owaiskazi19 merged 3 commits intoopensearch-project:feature/extensionsfrom
mloufra:cleanupwarning

Conversation

@mloufra
Copy link
Copy Markdown
Contributor

@mloufra mloufra commented Oct 25, 2022

Signed-off-by: mloufra mloufra@amazon.com

Description

Add generic type for categoryClass in NamedWriteable RegistryParseRequest, NamedWriteableRegistryResponse, ExtensionNamedWriteableRegistry, NamedWriteableRegistryResponseHandler and ExtensionsOrchestratorTests
Equivalent PR on OpenSearch-sdk-java: opensearch-project/opensearch-sdk-java#203

Issues Resolved

opensearch-project/opensearch-sdk-java#130

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: mloufra <mloufra@amazon.com>
Signed-off-by: mloufra <mloufra@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

Copy link
Copy Markdown
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one comment about placement of the warning suppression.

Good job with all these changes, it was a bit more complicated than I expected!

* @param in StreamInput from which map entries of writeable names and their associated category classes are read from
* @throws IllegalArgumentException if the fully qualified class name is invalid and the class object cannot be generated at runtime
*/
@SuppressWarnings("unchecked")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally we try to put @SuppressWarnings at the lowest scope possible. In the constructor we were assigning a value to an instance variable, so we had to use the method level, but here we are assigning to a local variable. You should be able to put this suppression down above line 47.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, I will move @SuppressWarnings in next commit

Signed-off-by: mloufra <mloufra@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

Gradle Check (Jenkins) Run Completed with:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants