List of utility methods to do Throwable to Calling Class Method
String | findCallingClassAndMethod(Throwable t) find Calling Class And Method String stackTraceAsString = Util.stackTraceToString(t); String callingClassAndMethod = CALLER_INFORMATION_NOT_AVAILABLE; int endInternalMethods = stackTraceAsString.lastIndexOf("com.mysql.jdbc"); if (endInternalMethods != -1) { int endOfLine = -1; int compliancePackage = stackTraceAsString.indexOf("com.mysql.jdbc.compliance", endInternalMethods); if (compliancePackage != -1) { endOfLine = compliancePackage - LINE_SEPARATOR_LENGTH; ... |
boolean | startWithClass(Throwable throwable, Class> clazz) start With Class StackTraceElement[] elements = throwable.getStackTrace();
return elements[0].getClassName().equals(clazz.getName());
|