Skip to content

Commit

Permalink
修复通过GSON反序列化时将long类型的数值错误的转成了double类型科学计数法
Browse files Browse the repository at this point in the history
  • Loading branch information
aimacode committed Mar 8, 2024
1 parent 43316d6 commit 58cad5b
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ public Map<String, Object> args() {
public abstract Object innerRun(String args, Map<String, Object> kwargs);

public Pair<Object[], Map<String, Object>> toArgsAndKwargs(Object toolInput) {
if (toolInput instanceof String) {
return Pair.of(new Object[]{toolInput}, Maps.newHashMap());
} else {
@SuppressWarnings("unchecked")
/*
* 20230308:入参为Map时转换,否则不进行转换
* 原逻辑入参为非String和非Map时会出现将toolInput强转为Map报错
* */
if(toolInput instanceof Map){
Map<String, Object> mapInput = (Map<String, Object>) toolInput;
return Pair.of(new Object[]{}, mapInput);
}
return Pair.of(new Object[]{toolInput}, Maps.newHashMap());
}

/**
Expand Down

0 comments on commit 58cad5b

Please sign in to comment.