Here you can find the source of toArray(final Throwable throwable)
Parameter | Description |
---|---|
throwable | throwable |
private static String[] toArray(final Throwable throwable)
//package com.java2s; /**/*from w ww. java 2 s.co m*/ * This class contains static methods, which are used throughout the project. * The methods are used for dumping error output, debugging information, * getting the application path, etc. * * @author BaseX Team 2005-17, BSD License * @author Christian Gruen */ public class Main { /** * Returns an string array representation of the specified throwable. * @param throwable throwable * @return string array */ private static String[] toArray(final Throwable throwable) { final StackTraceElement[] st = throwable.getStackTrace(); final int sl = st.length; final String[] obj = new String[sl + 1]; obj[0] = throwable.toString(); for (int s = 0; s < sl; s++) obj[s + 1] = "\tat " + st[s]; return obj; } }