Преглед на файлове

GitSmartHttpTools: Open SideBandOutputStream in try-with-resource

Change-Id: Ie7c17f98579e7241f2b5c8204435c76686eeb568
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
tags/v5.3.0.201903061415-rc1
David Pursehouse преди 5 години
родител
ревизия
f5614e03f1
променени са 1 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 5
    4
      org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java

+ 5
- 4
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java Целия файл

@@ -299,10 +299,11 @@ public class GitSmartHttpTools {

private static void writeSideBand(OutputStream out, String textForGit)
throws IOException {
@SuppressWarnings("resource" /* java 7 */)
OutputStream msg = new SideBandOutputStream(CH_ERROR, SMALL_BUF, out);
msg.write(Constants.encode("error: " + textForGit));
msg.flush();
try (OutputStream msg = new SideBandOutputStream(CH_ERROR, SMALL_BUF,
out)) {
msg.write(Constants.encode("error: " + textForGit));
msg.flush();
}
}

private static void writePacket(PacketLineOut pckOut, String textForGit)

Loading…
Отказ
Запис