Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A small performance issue in "assertNull": the line 229

 (We have found several tests that run slow because these strings are appended unnecessarily for null values.)
  • Loading branch information...
commit efa11a4fb62f612347dbf2476afb9b2b54d590c1 1 parent 3639784
@songlh authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/main/java/junit/framework/Assert.java
View
2  src/main/java/junit/framework/Assert.java
@@ -226,7 +226,7 @@ static public void assertNotNull(String message, Object object) {
* Object to check or <code>null</code>
*/
static public void assertNull(Object object) {
- String message = "Expected: <null> but was: " + String.valueOf(object);
+ String message = object != null ? "Expected: <null> but was: " + object.toString() : "";
assertNull(message, object);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.