From 4f2954041dc7a208c8fd45e4d56644d2d9fab4b9 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 6 Jun 2022 04:48:04 -0400 Subject: [PATCH] Removed unused code. --- src/engine/util/MiscUtils.java | 55 ---------------------------------- 1 file changed, 55 deletions(-) diff --git a/src/engine/util/MiscUtils.java b/src/engine/util/MiscUtils.java index cb42e93c..bb2e2ec0 100644 --- a/src/engine/util/MiscUtils.java +++ b/src/engine/util/MiscUtils.java @@ -17,13 +17,6 @@ import java.util.regex.Pattern; public class MiscUtils { - // no need to recompile these each call, put them in object scope and - // compile just once. - private static final Pattern lastNameRegex = Pattern - .compile("^[A-Za-z][-'A-Za-z\\x20]*$"); - private static final Pattern firstNameRegex = Pattern - .compile("^[A-Za-z]+$"); - public static boolean checkIfFirstNameInvalid(String firstName) { if ((firstName == null) || (firstName.length() == 0) || (firstName.length() > MBServerStatics.MAX_NAME_LENGTH) @@ -44,52 +37,4 @@ public class MiscUtils { // empty last names are fine, return false return false; } - - public static String getCallingMethodName() { - StackTraceElement e[] = Thread.currentThread().getStackTrace(); - int numElements = e.length; - - if (numElements < 1) { - return "NoStack"; - } - - if (numElements == 1) { - return e[0].getMethodName(); - } else if (numElements == 2) { - return e[1].getMethodName(); - } else if (numElements == 3) { - return e[2].getMethodName(); - } else { - return e[3].getMethodName(); - } - } - - public static String getCallStackAsString() { - String out = ""; - - StackTraceElement e[] = Thread.currentThread().getStackTrace(); - int numElements = e.length; - - for (int i = (numElements - 1); i > 1; --i) { - - String[] classStack = e[i].getClassName().split("\\."); - String methName = e[i].getMethodName(); - - String className = classStack[classStack.length - 1]; - - if (methName.equals("")) { - methName = className; - } - - out += className + '.' + methName + "()"; - - if (i > 2) { - out += " -> "; - } - - } - - return out; - } - }