Skip to content

Commit

Permalink
Use constructor directly
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Dec 17, 2024
1 parent 2593663 commit 981446a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public ShareWithRequest(String resourceId, String resourceIndex, ShareWith share
this.shareWith = shareWith;
}

public ShareWithRequest(StreamInput in, Reader<ShareWith> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -47,7 +46,7 @@ public class ShareWithTransportAction extends HandledTransportAction<ShareWithRe

@Inject
public ShareWithTransportAction(TransportService transportService, ActionFilters actionFilters, Client nodeClient) {
super(ShareWithAction.NAME, transportService, actionFilters, (in) -> new ShareWithRequest(in, ShareWith::new));
super(ShareWithAction.NAME, transportService, actionFilters, ShareWithRequest::new);
this.transportService = transportService;
this.nodeClient = nodeClient;
}
Expand Down

0 comments on commit 981446a

Please sign in to comment.