Skip to content

Commit 3e62d3f

Browse files
adwsinghrhernandez35
authored andcommitted
Fix spotbugs
1 parent ea7f194 commit 3e62d3f

File tree

2 files changed

+5
-2
lines changed
  • mcp

2 files changed

+5
-2
lines changed

mcp/mcp-cli-api/src/main/java/software/amazon/smithy/java/mcp/cli/ConfigUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.io.BufferedReader;
1111
import java.io.IOException;
1212
import java.io.InputStreamReader;
13+
import java.nio.charset.StandardCharsets;
1314
import java.nio.file.Files;
1415
import java.nio.file.Path;
1516
import java.nio.file.Paths;
@@ -175,6 +176,7 @@ public static McpBundleConfig addMcpBundle(Config config, String toolBundleName,
175176
builder.genericConfig(
176177
GenericToolBundleConfig.builder().name(toolBundleName).bundleLocation(location).build());
177178
}
179+
default -> throw new IllegalStateException("Unexpected bundle type: " + bundle.type());
178180
}
179181

180182
var mcpBundleConfig = builder.build();
@@ -230,7 +232,8 @@ private static void install(ExecSpec execSpec) {
230232
}
231233

232234
private static String captureProcessOutput(Process process) throws IOException {
233-
try (BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
235+
try (BufferedReader in =
236+
new BufferedReader(new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8))) {
234237
return in.lines().collect(Collectors.joining(System.lineSeparator()));
235238
}
236239
}

mcp/mcp-cli/src/main/java/software/amazon/smithy/java/mcp/cli/commands/StartServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.util.ArrayList;
1010
import java.util.List;
1111
import java.util.stream.Collectors;
12-
1312
import picocli.CommandLine.Command;
1413
import picocli.CommandLine.Option;
1514
import picocli.CommandLine.Parameters;
@@ -133,6 +132,7 @@ public void execute(ExecutionContext context) throws IOException {
133132
.environmentVariables(System.getenv())
134133
.build();
135134
}
135+
default -> throw new IllegalArgumentException("Unknown tool bundle type: " + toolBundleConfig.type());
136136
}
137137

138138
}

0 commit comments

Comments
 (0)