From 2173f441589fbab7214bf59ea1330fff2c9f4c37 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 4 Sep 2018 14:23:14 +0900 Subject: [PATCH] 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 --- .../tst/org/eclipse/jgit/transport/UploadPackTest.java | 6 +++--- 1 file 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 4c6076a20..317ac32e6 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.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 void testV2CapabilitiesRefInWantNotAdvertisedIfAdvertisingForbidden() thr } @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 @@ private ReceivedPackStatistics parsePack(ByteArrayInputStream recvStream, Progre 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(); }