summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPepich <benedikt.abel@yahoo.de>2017-05-09 11:24:11 +0200
committerPepich <benedikt.abel@yahoo.de>2017-05-09 11:24:11 +0200
commited4da2e766e32b7dfe565f4a2f6863c16b72ee27 (patch)
tree42d82002c39183b115ea965c0ea40c377215c77d
parentda9d34118241d86fa948cf89408edc3a57f3756f (diff)
Updated getCaller method
-rw-r--r--src/com/redstoner/misc/Utils.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/redstoner/misc/Utils.java b/src/com/redstoner/misc/Utils.java
index 34922be..c5491c5 100644
--- a/src/com/redstoner/misc/Utils.java
+++ b/src/com/redstoner/misc/Utils.java
@@ -222,11 +222,11 @@ public final class Utils
*
* @param directCaller used to prevent this method from returning the caller itself. Null if supposed to be ignored.
* @return the name of the calling class. */
- public static final String getCaller(Class<? extends Object> directCaller)
+ public static final String getCaller(String directCaller)
{
StackTraceElement[] stackTrace = (new Exception()).getStackTrace();
- String classname = (directCaller == null ? "Utils" : directCaller.getName());
- for (int i = 0; classname.equals(directCaller.getName()) || classname.equals("Utils"); i++)
+ String classname = (directCaller == null ? "Utils" : directCaller);
+ for (int i = 0; classname.equals(directCaller) || classname.equals("Utils"); i++)
{
classname = stackTrace[i].getClassName().replaceAll(".*\\.", "");
}