From 014bc8b0b5f4680f4b7971513ac9fd418e2f3636 Mon Sep 17 00:00:00 2001 From: themode Date: Fri, 20 Nov 2020 14:21:20 +0100 Subject: [PATCH] Fixed DebugUtils --- .../minestom/server/utils/debug/DebugUtils.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/java/net/minestom/server/utils/debug/DebugUtils.java b/src/main/java/net/minestom/server/utils/debug/DebugUtils.java index bdd926e6f..44c43edc9 100644 --- a/src/main/java/net/minestom/server/utils/debug/DebugUtils.java +++ b/src/main/java/net/minestom/server/utils/debug/DebugUtils.java @@ -11,15 +11,11 @@ public final class DebugUtils { public final static Logger LOGGER = LoggerFactory.getLogger(DebugUtils.class); private static final String LINE_SEPARATOR = System.getProperty("line.separator"); - private static final int OFFSET = 2; // Used to do not show DebugUtils in the stack trace /** * Prints the current thread stack trace elements. - * - * @param maxLine the maximum number of stack trace element */ - public static synchronized void printStackTrace(int maxLine) { - maxLine += OFFSET; + public static synchronized void printStackTrace() { StackTraceElement[] elements = Thread.currentThread().getStackTrace(); StringBuilder stringBuilder = new StringBuilder(); @@ -27,7 +23,7 @@ public final class DebugUtils { stringBuilder.append("START STACKTRACE"); stringBuilder.append(LINE_SEPARATOR); - for (int i = OFFSET; i < maxLine; i++) { + for (int i = 0; i < Integer.MAX_VALUE; i++) { if (i >= elements.length) break; @@ -42,11 +38,4 @@ public final class DebugUtils { LOGGER.info(stringBuilder.toString()); } - /** - * Prints the current thread stack trace elements. - */ - public static synchronized void printStackTrace() { - printStackTrace(Integer.MAX_VALUE); - } - }