GitSmartHttpTools: Open SideBandOutputStream in try-with-resource
Change-Id: Ie7c17f98579e7241f2b5c8204435c76686eeb568 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
95d74f22fb
commit
f5614e03f1
|
@ -299,10 +299,11 @@ private static boolean isReceivePackSideBand(HttpServletRequest req) {
|
||||||
|
|
||||||
private static void writeSideBand(OutputStream out, String textForGit)
|
private static void writeSideBand(OutputStream out, String textForGit)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
@SuppressWarnings("resource" /* java 7 */)
|
try (OutputStream msg = new SideBandOutputStream(CH_ERROR, SMALL_BUF,
|
||||||
OutputStream msg = new SideBandOutputStream(CH_ERROR, SMALL_BUF, out);
|
out)) {
|
||||||
msg.write(Constants.encode("error: " + textForGit));
|
msg.write(Constants.encode("error: " + textForGit));
|
||||||
msg.flush();
|
msg.flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void writePacket(PacketLineOut pckOut, String textForGit)
|
private static void writePacket(PacketLineOut pckOut, String textForGit)
|
||||||
|
|
Loading…
Reference in New Issue