Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor refactoring.

Use StringUtils from commons-lang.
  • Loading branch information...
commit be483f359a83fc4d8a9c67a0b1c3d38f05a0328c 1 parent 2ad9a7d
@mnuessler authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/java/org/nuessler/junit/util/rule/FailureLogger.java
View
6 src/main/java/org/nuessler/junit/util/rule/FailureLogger.java
@@ -15,6 +15,8 @@
*/
package org.nuessler.junit.util.rule;
+import static org.apache.commons.lang3.StringUtils.defaultString;
+
import java.util.Collections;
import java.util.List;
@@ -53,8 +55,7 @@ private StackTraceElement findStrackTraceForClass(StackTraceElement[] elements,
private String formatMessage(Description description, StackTraceElement element, Throwable t) {
return String.format("%s in %s#%s, line %s: %s", t.getClass().getCanonicalName(), description.getTestClass(),
- description.getMethodName(), element.getLineNumber(),
- t.getMessage() == null ? "<no message>" : t.getMessage());
+ description.getMethodName(), element.getLineNumber(), defaultString(t.getMessage(), "<no message>"));
}
private void log(String msg) {
@@ -64,4 +65,5 @@ private void log(String msg) {
public interface Callback<T> {
void call(T value);
}
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.