From 981446ab1421f990fd3c40a29b460a8fde275a0b Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Tue, 17 Dec 2024 17:54:05 -0500 Subject: [PATCH] Use constructor directly Signed-off-by: Craig Perkins --- .../opensearch/security/rest/resource/ShareWithRequest.java | 4 ++-- .../security/rest/resource/ShareWithTransportAction.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java b/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java index 1204b7e061..6e64ef6997 100644 --- a/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java +++ b/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java @@ -34,10 +34,10 @@ public ShareWithRequest(String resourceId, String resourceIndex, ShareWith share this.shareWith = shareWith; } - public ShareWithRequest(StreamInput in, Reader shareWithReader) throws IOException { + public ShareWithRequest(StreamInput in) throws IOException { this.resourceId = in.readString(); this.resourceIndex = in.readString(); - this.shareWith = shareWithReader.read(in); + this.shareWith = new ShareWith(in); } @Override diff --git a/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java b/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java index 014b08d5f0..d2427698a9 100644 --- a/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java +++ b/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java @@ -30,7 +30,6 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.search.SearchHit; import org.opensearch.search.builder.SearchSourceBuilder; -import org.opensearch.security.spi.ShareWith; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; @@ -47,7 +46,7 @@ public class ShareWithTransportAction extends HandledTransportAction new ShareWithRequest(in, ShareWith::new)); + super(ShareWithAction.NAME, transportService, actionFilters, ShareWithRequest::new); this.transportService = transportService; this.nodeClient = nodeClient; }