Skip to content

Commit 601773c

Browse files
committed
1 parent 8740392 commit 601773c

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/main/java/org/b3log/symphony/util/NodeUtil.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -178,36 +178,6 @@ public static void sendClear() {
178178
}
179179
}
180180

181-
public static HashMap<String, Long> parseStringToHashMap(String input) {
182-
HashMap<String, Long> map = new HashMap<>();
183-
184-
// 去掉前后的大括号
185-
if (input.startsWith("{") && input.endsWith("}")) {
186-
input = input.substring(1, input.length() - 1).trim();
187-
} else {
188-
throw new IllegalArgumentException("Invalid input format");
189-
}
190-
191-
// 分割键值对
192-
String[] pairs = input.split(", ");
193-
for (String pair : pairs) {
194-
String[] keyValue = pair.split("=");
195-
if (keyValue.length != 2) {
196-
throw new IllegalArgumentException("Invalid key-value pair: " + pair);
197-
}
198-
String key = keyValue[0].trim();
199-
Long value;
200-
try {
201-
value = Long.parseLong(keyValue[1].trim());
202-
} catch (NumberFormatException e) {
203-
throw new IllegalArgumentException("Invalid value for key: " + key);
204-
}
205-
map.put(key, value);
206-
}
207-
208-
return map;
209-
}
210-
211181
public static void initOnline() {
212182
JSONArray onlineList = new JSONArray();
213183
Map<String, Integer> tmp_wsOnline = new HashMap<>();

0 commit comments

Comments
 (0)