diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-04 14:23:14 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-05 08:39:32 +0900 |
commit | 2173f441589fbab7214bf59ea1330fff2c9f4c37 (patch) | |
tree | e483cc8a9c7fd6c13137cda818c81d0b48e3afd4 | |
parent | 559c68cb012b971bf506d12aaf0a0f0504c9780b (diff) | |
download | jgit-2173f441589fbab7214bf59ea1330fff2c9f4c37.tar.gz jgit-2173f441589fbab7214bf59ea1330fff2c9f4c37.zip |
UploadPackTest: Avoid unnecessarily boxing int into Integer
The statement:
assertThat(recvStream.available(), is(0));
results in a warning from Eclipse:
The expression of type int is boxed into Integer
because recvStream.available() returns int, but the hamcrest is()
method takes an Integer.
Replace it with the equivalent JUnit assertion.
Also remove the suppression of another similar warning and fix that
in the same way.
Change-Id: I6f18b304a540bcd0a10aec7d3abc7dc6f047fe80
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java index 4c6076a20b..317ac32e6d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java @@ -5,6 +5,7 @@ import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.theInstance; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @@ -577,12 +578,11 @@ public class UploadPackTest { } @Test - @SuppressWarnings("boxing") public void testV2EmptyRequest() throws Exception { ByteArrayInputStream recvStream = uploadPackV2(PacketLineIn.END); // Verify that there is nothing more after the capability // advertisement. - assertThat(recvStream.available(), is(0)); + assertEquals(0, recvStream.available()); } @Test @@ -735,7 +735,7 @@ public class UploadPackTest { pp.parse(NullProgressMonitor.INSTANCE); // Ensure that there is nothing left in the stream. - assertThat(recvStream.read(), is(-1)); + assertEquals(-1, recvStream.read()); return pp.getReceivedPackStatistics(); } |