diff --git a/updater/src/com/intellij/updater/BaseUpdateAction.java b/updater/src/com/intellij/updater/BaseUpdateAction.java index 846a2f8dd934..58f8c8e811a9 100644 --- a/updater/src/com/intellij/updater/BaseUpdateAction.java +++ b/updater/src/com/intellij/updater/BaseUpdateAction.java @@ -120,13 +120,6 @@ public abstract class BaseUpdateAction extends PatchAction { } } - protected void writeDiff(File olderFile, File newerFile, OutputStream patchOutput) throws IOException { - try (BufferedInputStream olderFileIn = new BufferedInputStream(Utils.newFileInputStream(olderFile, myPatch.isNormalized())); - BufferedInputStream newerFileIn = new BufferedInputStream(new FileInputStream(newerFile))) { - writeDiff(olderFileIn, newerFileIn, patchOutput); - } - } - protected void writeDiff(InputStream olderFileIn, InputStream newerFileIn, OutputStream patchOutput) throws IOException { Runner.logger().info("writing diff"); ByteArrayOutputStream diffOutput = new OpenByteArrayOutputStream(); diff --git a/updater/src/com/intellij/updater/UpdateAction.java b/updater/src/com/intellij/updater/UpdateAction.java index 02905b4ada1f..b7770109e323 100644 --- a/updater/src/com/intellij/updater/UpdateAction.java +++ b/updater/src/com/intellij/updater/UpdateAction.java @@ -27,7 +27,10 @@ public class UpdateAction extends BaseUpdateAction { FileType type = getFileType(newerFile); if (type == FileType.SYMLINK) throw new IOException("Unexpected symlink: " + newerFile); writeFileType(patchOutput, type); - writeDiff(olderFile, newerFile, patchOutput); + try (BufferedInputStream olderFileIn = new BufferedInputStream(Utils.newFileInputStream(olderFile, myPatch.isNormalized())); + BufferedInputStream newerFileIn = new BufferedInputStream(new FileInputStream(newerFile))) { + writeDiff(olderFileIn, newerFileIn, patchOutput); + } patchOutput.closeEntry(); }