From 8ea2fe4fed222fdcb9978080128ec4582b0b95a2 Mon Sep 17 00:00:00 2001 From: Oleksandr Popov Date: Sat, 8 Mar 2025 05:34:30 +0200 Subject: [PATCH] Fix typo mistake in comments and method params --- mcp/pom.xml | 2 +- .../client/McpAsyncClient.java | 2 +- .../HttpClientSseClientTransport.java | 2 +- .../transport/StdioClientTransport.java | 2 +- .../server/McpServer.java | 40 +++++++++---------- .../spec/DefaultMcpSession.java | 4 +- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/mcp/pom.xml b/mcp/pom.xml index 2170ffef..b1757c3d 100644 --- a/mcp/pom.xml +++ b/mcp/pom.xml @@ -97,7 +97,7 @@ test - diff --git a/mcp/src/main/java/io/modelcontextprotocol/client/McpAsyncClient.java b/mcp/src/main/java/io/modelcontextprotocol/client/McpAsyncClient.java index e1bf574e..98662ce8 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/client/McpAsyncClient.java +++ b/mcp/src/main/java/io/modelcontextprotocol/client/McpAsyncClient.java @@ -336,7 +336,7 @@ public Mono closeGracefully() { } // -------------------------- - // Basic Utilites + // Basic Utilities // -------------------------- /** diff --git a/mcp/src/main/java/io/modelcontextprotocol/client/transport/HttpClientSseClientTransport.java b/mcp/src/main/java/io/modelcontextprotocol/client/transport/HttpClientSseClientTransport.java index 7af5294b..2d1d76ab 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/client/transport/HttpClientSseClientTransport.java +++ b/mcp/src/main/java/io/modelcontextprotocol/client/transport/HttpClientSseClientTransport.java @@ -251,7 +251,7 @@ public Mono closeGracefully() { } /** - * Unmarshals data to the specified type using the configured object mapper. + * Unmarshal data to the specified type using the configured object mapper. * @param data the data to unmarshal * @param typeRef the type reference for the target type * @param the target type diff --git a/mcp/src/main/java/io/modelcontextprotocol/client/transport/StdioClientTransport.java b/mcp/src/main/java/io/modelcontextprotocol/client/transport/StdioClientTransport.java index 614c6512..ace0c939 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/client/transport/StdioClientTransport.java +++ b/mcp/src/main/java/io/modelcontextprotocol/client/transport/StdioClientTransport.java @@ -293,7 +293,7 @@ private void startInboundProcessing() { */ private void startOutboundProcessing() { this.handleOutbound(messages -> messages - // this bit is important since writes come from user threads and we + // this bit is important since writes come from user threads, and we // want to ensure that the actual writing happens on a dedicated thread .publishOn(outboundScheduler) .handle((message, s) -> { diff --git a/mcp/src/main/java/io/modelcontextprotocol/server/McpServer.java b/mcp/src/main/java/io/modelcontextprotocol/server/McpServer.java index 54c7a28f..bd5b90ca 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/server/McpServer.java +++ b/mcp/src/main/java/io/modelcontextprotocol/server/McpServer.java @@ -310,29 +310,29 @@ public AsyncSpec tools(McpServerFeatures.AsyncToolRegistration... toolRegistrati * Registers multiple resources with their handlers using a Map. This method is * useful when resources are dynamically generated or loaded from a configuration * source. - * @param resourceRegsitrations Map of resource name to registration. Must not be + * @param resourceRegistrations Map of resource name to registration. Must not be * null. * @return This builder instance for method chaining - * @throws IllegalArgumentException if resourceRegsitrations is null + * @throws IllegalArgumentException if resourceRegistrations is null * @see #resources(McpServerFeatures.AsyncResourceRegistration...) */ - public AsyncSpec resources(Map resourceRegsitrations) { - Assert.notNull(resourceRegsitrations, "Resource handlers map must not be null"); - this.resources.putAll(resourceRegsitrations); + public AsyncSpec resources(Map resourceRegistrations) { + Assert.notNull(resourceRegistrations, "Resource handlers map must not be null"); + this.resources.putAll(resourceRegistrations); return this; } /** * Registers multiple resources with their handlers using a List. This method is * useful when resources need to be added in bulk from a collection. - * @param resourceRegsitrations List of resource registrations. Must not be null. + * @param resourceRegistrations List of resource registrations. Must not be null. * @return This builder instance for method chaining - * @throws IllegalArgumentException if resourceRegsitrations is null + * @throws IllegalArgumentException if resourceRegistrations is null * @see #resources(McpServerFeatures.AsyncResourceRegistration...) */ - public AsyncSpec resources(List resourceRegsitrations) { - Assert.notNull(resourceRegsitrations, "Resource handlers list must not be null"); - for (McpServerFeatures.AsyncResourceRegistration resource : resourceRegsitrations) { + public AsyncSpec resources(List resourceRegistrations) { + Assert.notNull(resourceRegistrations, "Resource handlers list must not be null"); + for (McpServerFeatures.AsyncResourceRegistration resource : resourceRegistrations) { this.resources.put(resource.resource().uri(), resource); } return this; @@ -688,29 +688,29 @@ public SyncSpec tools(McpServerFeatures.SyncToolRegistration... toolRegistration * Registers multiple resources with their handlers using a Map. This method is * useful when resources are dynamically generated or loaded from a configuration * source. - * @param resourceRegsitrations Map of resource name to registration. Must not be + * @param resourceRegistrations Map of resource name to registration. Must not be * null. * @return This builder instance for method chaining - * @throws IllegalArgumentException if resourceRegsitrations is null + * @throws IllegalArgumentException if resourceRegistrations is null * @see #resources(McpServerFeatures.SyncResourceRegistration...) */ - public SyncSpec resources(Map resourceRegsitrations) { - Assert.notNull(resourceRegsitrations, "Resource handlers map must not be null"); - this.resources.putAll(resourceRegsitrations); + public SyncSpec resources(Map resourceRegistrations) { + Assert.notNull(resourceRegistrations, "Resource handlers map must not be null"); + this.resources.putAll(resourceRegistrations); return this; } /** * Registers multiple resources with their handlers using a List. This method is * useful when resources need to be added in bulk from a collection. - * @param resourceRegsitrations List of resource registrations. Must not be null. + * @param resourceRegistrations List of resource registrations. Must not be null. * @return This builder instance for method chaining - * @throws IllegalArgumentException if resourceRegsitrations is null + * @throws IllegalArgumentException if resourceRegistrations is null * @see #resources(McpServerFeatures.SyncResourceRegistration...) */ - public SyncSpec resources(List resourceRegsitrations) { - Assert.notNull(resourceRegsitrations, "Resource handlers list must not be null"); - for (McpServerFeatures.SyncResourceRegistration resource : resourceRegsitrations) { + public SyncSpec resources(List resourceRegistrations) { + Assert.notNull(resourceRegistrations, "Resource handlers list must not be null"); + for (McpServerFeatures.SyncResourceRegistration resource : resourceRegistrations) { this.resources.put(resource.resource().uri(), resource); } return this; diff --git a/mcp/src/main/java/io/modelcontextprotocol/spec/DefaultMcpSession.java b/mcp/src/main/java/io/modelcontextprotocol/spec/DefaultMcpSession.java index e2d354f4..891c14a3 100644 --- a/mcp/src/main/java/io/modelcontextprotocol/spec/DefaultMcpSession.java +++ b/mcp/src/main/java/io/modelcontextprotocol/spec/DefaultMcpSession.java @@ -107,7 +107,7 @@ public interface NotificationHandler { public DefaultMcpSession(Duration requestTimeout, McpTransport transport, Map> requestHandlers, Map notificationHandlers) { - Assert.notNull(requestTimeout, "The requstTimeout can not be null"); + Assert.notNull(requestTimeout, "The requestTimeout can not be null"); Assert.notNull(transport, "The transport can not be null"); Assert.notNull(requestHandlers, "The requestHandlers can not be null"); Assert.notNull(notificationHandlers, "The notificationHandlers can not be null"); @@ -127,7 +127,7 @@ public DefaultMcpSession(Duration requestTimeout, McpTransport transport, logger.debug("Received Response: {}", response); var sink = pendingResponses.remove(response.id()); if (sink == null) { - logger.warn("Unexpected response for unkown id {}", response.id()); + logger.warn("Unexpected response for unknown id {}", response.id()); } else { sink.success(response);