@Test public void testToString() { String exception = "NullPointerOfCourse"; String message = "because why not!"; CrashStackTrace st = new CrashStackTrace(exception, message); st.addFrame(new Frame("clazz", "method")); st.setCause(new CrashStackTrace("except", message)); LOG.debug("Stack trace is: {}", st); assertThat(st.toString(), not(emptyString())); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder = builder.append(exceptionClass).append(':').append(errorMessage).append('\n'); for(Frame f : this) { builder = builder.append(f.toString()).append('\n'); } if(cause != null) { builder = builder.append("Caused by: ").append(cause.toString()); } return builder.toString(); }
CrashStackTrace implements Iterable<Frame> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder = builder.append(exceptionClass).append(':').append(errorMessage).append('\n'); for(Frame f : this) { builder = builder.append(f.toString()).append('\n'); } if(cause != null) { builder = builder.append("Caused by: ").append(cause.toString()); } return builder.toString(); } }
CrashStackTrace implements Iterable<Frame> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder = builder.append(exceptionClass).append(':').append(errorMessage).append('\n'); for(Frame f : this) { builder = builder.append(f.toString()).append('\n'); } if(cause != null) { builder = builder.append("Caused by: ").append(cause.toString()); } return builder.toString(); } CrashStackTrace();  CrashStackTrace(String exceptionClass, String errorMessage);  CrashStackTrace(String exceptionClass, String errorMessage, CrashStackTrace cause); }
CrashStackTrace implements Iterable<Frame> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder = builder.append(exceptionClass).append(':').append(errorMessage).append('\n'); for(Frame f : this) { builder = builder.append(f.toString()).append('\n'); } if(cause != null) { builder = builder.append("Caused by: ").append(cause.toString()); } return builder.toString(); } CrashStackTrace();  CrashStackTrace(String exceptionClass, String errorMessage);  CrashStackTrace(String exceptionClass, String errorMessage, CrashStackTrace cause); String getExceptionClass(); void setExceptionClass(String exceptionClass); String getErrorMessage(); void setErrorMessage(String errorMessage); CrashStackTrace getCause(); void setCause(CrashStackTrace stackTrace); @Override Iterator<Frame> iterator(); Frame removeFrame(int level); void addFrame(Frame frame); int highestFrameLevel(); Frame getFrame(int level); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
CrashStackTrace implements Iterable<Frame> { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder = builder.append(exceptionClass).append(':').append(errorMessage).append('\n'); for(Frame f : this) { builder = builder.append(f.toString()).append('\n'); } if(cause != null) { builder = builder.append("Caused by: ").append(cause.toString()); } return builder.toString(); } CrashStackTrace();  CrashStackTrace(String exceptionClass, String errorMessage);  CrashStackTrace(String exceptionClass, String errorMessage, CrashStackTrace cause); String getExceptionClass(); void setExceptionClass(String exceptionClass); String getErrorMessage(); void setErrorMessage(String errorMessage); CrashStackTrace getCause(); void setCause(CrashStackTrace stackTrace); @Override Iterator<Frame> iterator(); Frame removeFrame(int level); void addFrame(Frame frame); int highestFrameLevel(); Frame getFrame(int level); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }