Skip to content

Commit abd7d2f

Browse files
committed
fix: 修复工具类冗余
1 parent 8cbb182 commit abd7d2f

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

labs/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/tool/DefaultToolCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public String call(String toolInput, ToolContext toolContext) {
7575
}
7676

7777
private void validateToolContextSupport(ToolContext toolContext) {
78-
boolean isNonEmptyToolContextProvided = toolContext != null && !Utils.isCollectionEmpty(toolContext.getContext());
78+
boolean isNonEmptyToolContextProvided = toolContext != null && !Utils.isEmpty(toolContext.getContext());
7979

8080
boolean isToolContextAcceptedByMethod = Arrays.stream(this.toolMethod.getParameterTypes())
8181
.anyMatch(type -> Utils.isAssignable(type, ToolContext.class));

labs/arthas-mcp-server/src/main/java/com/taobao/arthas/mcp/server/util/Utils.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ public static boolean isEmpty(Map<?, ?> map) {
1717
return (map == null || map.isEmpty());
1818
}
1919

20-
public static boolean isCollectionEmpty(Map<?, ?> map) {
21-
return map == null || map.isEmpty();
22-
}
23-
2420
public static boolean isAssignable(Class<?> targetType, Class<?> sourceType) {
2521
if (targetType == null || sourceType == null) {
2622
return false;

0 commit comments

Comments
 (0)