mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (inlines single-use method)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user