Skip to content

Commit

Permalink
Merge pull request #1719 from kluever/patch-2
Browse files Browse the repository at this point in the history
Fix "ReturnValueIgnored" errors flagged by error-prone

* Update AssertTest.java to use `assertNotNull()` on places where the return value of `e.getMessage()` is ignored
  • Loading branch information
kcooney authored Nov 21, 2022
2 parents d5db99d + 86b979e commit 5cc2cdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/junit/tests/framework/AssertTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ public void testAssertStringNotEqualsNull() {
assertEquals("foo", null);
fail();
} catch (ComparisonFailure e) {
e.getMessage(); // why no assertion?
assertNotNull(e.getMessage());
}
}

public void testAssertNullNotEqualsNull() {
try {
assertEquals(null, new Object());
} catch (AssertionFailedError e) {
e.getMessage(); // why no assertion?
assertNotNull(e.getMessage());
return;
}
fail();
Expand Down Expand Up @@ -168,4 +168,4 @@ public void testAssertNotSameFailsNull() {
}
fail();
}
}
}

0 comments on commit 5cc2cdc

Please sign in to comment.