From d6e88f0c53effc9a6dcff34689e2afa4d6e450bb Mon Sep 17 00:00:00 2001 From: yukaidi Date: Fri, 29 May 2026 07:06:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20PlaygroundApi=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=20import=20=E5=92=8C=E6=9C=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=20getStackTrace=20=E6=AD=BB=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 审查发现 42925c8 引入了重复的 StandardCharsets import,且 getStackTrace 方法在移除堆栈泄露后无任何调用方,属于死代码。 --- .../cn/qaiu/lz/web/controller/PlaygroundApi.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/web-service/src/main/java/cn/qaiu/lz/web/controller/PlaygroundApi.java b/web-service/src/main/java/cn/qaiu/lz/web/controller/PlaygroundApi.java index fb54307..09ae694 100644 --- a/web-service/src/main/java/cn/qaiu/lz/web/controller/PlaygroundApi.java +++ b/web-service/src/main/java/cn/qaiu/lz/web/controller/PlaygroundApi.java @@ -28,7 +28,6 @@ import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; -import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.util.ArrayList; import java.util.List; @@ -696,19 +695,5 @@ public class PlaygroundApi { } return ip; } - - /** - * 获取异常堆栈信息 - */ - private String getStackTrace(Throwable throwable) { - if (throwable == null) { - return ""; - } - log.error("获取异常堆栈信息", throwable); - java.io.StringWriter sw = new java.io.StringWriter(); - java.io.PrintWriter pw = new java.io.PrintWriter(sw); - throwable.printStackTrace(pw); - return sw.toString(); - } }