diff --git a/src/main/java/org/junit/internal/AssumptionViolatedException.java b/src/main/java/org/junit/internal/AssumptionViolatedException.java index 68a28173b9f5..76790eaa3acc 100644 --- a/src/main/java/org/junit/internal/AssumptionViolatedException.java +++ b/src/main/java/org/junit/internal/AssumptionViolatedException.java @@ -15,21 +15,21 @@ public class AssumptionViolatedException extends RuntimeException implements SelfDescribing { private static final long serialVersionUID = 2L; - private final String assumption; - private final boolean hasValue; - private final Object value; + private final String fAssumption; + private final boolean fValueMatcher; + private final Object fValue; - private final Matcher matcher; + private final Matcher fMatcher; /** * @deprecated Please use {@link org.junit.AssumptionViolatedException} instead. */ @Deprecated public AssumptionViolatedException(String assumption, boolean hasValue, Object value, Matcher matcher) { - this.assumption = assumption; - this.value = value; - this.matcher = matcher; - this.hasValue = hasValue; + this.fAssumption = assumption; + this.fValue = value; + this.fMatcher = matcher; + this.fValueMatcher = hasValue; if (value instanceof Throwable) { initCause((Throwable) value); @@ -85,21 +85,22 @@ public String getMessage() { } public void describeTo(Description description) { - if (assumption != null) { - description.appendText(assumption); + if (fAssumption != null) { + description.appendText(fAssumption); } - if (hasValue) { - if (assumption != null) { + if (fValueMatcher) { + // a value was passed in when this instance was constructed; print it + if (fAssumption != null) { description.appendText(": "); } description.appendText("got: "); - description.appendValue(value); + description.appendValue(fValue); - if (matcher != null) { + if (fMatcher != null) { description.appendText(", expected: "); - description.appendDescriptionOf(matcher); + description.appendDescriptionOf(fMatcher); } } }