1 package junit.framework; 2 3 /** 4 * Thrown when an assertion failed. 5 */ 6 public class AssertionFailedError extends AssertionError { 7 8 private static final long serialVersionUID = 1L; 9 10 /** 11 * Constructs a new AssertionFailedError without a detail message. 12 */ AssertionFailedError()13 public AssertionFailedError() { 14 } 15 16 /** 17 * Constructs a new AssertionFailedError with the specified detail message. 18 * A null message is replaced by an empty String. 19 * @param message the detail message. The detail message is saved for later 20 * retrieval by the {@code Throwable.getMessage()} method. 21 */ AssertionFailedError(String message)22 public AssertionFailedError(String message) { 23 super(defaultString(message)); 24 } 25 defaultString(String message)26 private static String defaultString(String message) { 27 return message == null ? "" : message; 28 } 29 }