Browse Source

HttpClientTests: Open OutputStream in try-with-resource

Change-Id: Ib690b0af6d562765f43ad54d3855200a17eaa90b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.1
David Pursehouse 6 years ago
parent
commit
3151bc33ea
  1. 4
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java

4
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java

@ -419,12 +419,12 @@ public class HttpClientTests extends HttpTestCase {
// properly. Tests for other commands go in // properly. Tests for other commands go in
// UploadPackTest.java. // UploadPackTest.java.
OutputStream os = c.getOutputStream(); try (OutputStream os = c.getOutputStream()) {
PacketLineOut pckOut = new PacketLineOut(os); PacketLineOut pckOut = new PacketLineOut(os);
pckOut.writeString("command=ls-refs"); pckOut.writeString("command=ls-refs");
pckOut.writeDelim(); pckOut.writeDelim();
pckOut.end(); pckOut.end();
os.close(); }
PacketLineIn pckIn = new PacketLineIn(c.getInputStream()); PacketLineIn pckIn = new PacketLineIn(c.getInputStream());

Loading…
Cancel
Save