mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Patches: do not use FileUtil in Main and Restarter to avoid native-code-and-class-loaders problem
This commit is contained in:
@@ -20,7 +20,7 @@ import com.intellij.ide.Bootstrap;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.util.Restarter;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Main {
|
||||
|
||||
File log = null;
|
||||
try {
|
||||
log = FileUtil.createTempFile("patch", ".log", false);
|
||||
log = FileUtilRt.createTempFile("patch", ".log", false);
|
||||
PrintWriter writer = new PrintWriter(log);
|
||||
try {
|
||||
e.printStackTrace(writer);
|
||||
@@ -124,11 +124,11 @@ public class Main {
|
||||
File copyPatchFile = new File(System.getProperty("java.io.tmpdir"), patchFileName + "_copy");
|
||||
|
||||
// always delete previous patch copy
|
||||
if (!FileUtil.delete(copyPatchFile)) throw new IOException("Cannot create temporary patch file");
|
||||
if (!FileUtilRt.delete(copyPatchFile)) throw new IOException("Cannot create temporary patch file");
|
||||
|
||||
if (!originalPatchFile.exists()) return;
|
||||
|
||||
if (!originalPatchFile.renameTo(copyPatchFile) || !FileUtil.delete(originalPatchFile)) {
|
||||
if (!originalPatchFile.renameTo(copyPatchFile) || !FileUtilRt.delete(originalPatchFile)) {
|
||||
throw new IOException("Cannot create temporary patch file");
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ package com.intellij.util;
|
||||
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.io.FileUtilRt;
|
||||
import com.intellij.openapi.util.io.StreamUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.sun.jna.Native;
|
||||
@@ -142,11 +142,11 @@ public class Restarter {
|
||||
}
|
||||
|
||||
public static File createTempExecutable(File executable) throws IOException {
|
||||
String ext = FileUtil.getExtension(executable.getName());
|
||||
File copy = FileUtil.createTempFile(FileUtil.getNameWithoutExtension(executable),
|
||||
StringUtil.isEmptyOrSpaces(ext) ? ".tmp" : ("." + ext),
|
||||
false);
|
||||
FileUtil.copy(executable, copy);
|
||||
String ext = FileUtilRt.getExtension(executable.getName());
|
||||
File copy = FileUtilRt.createTempFile(FileUtilRt.getNameWithoutExtension(executable.getName()),
|
||||
StringUtil.isEmptyOrSpaces(ext) ? ".tmp" : ("." + ext),
|
||||
false);
|
||||
FileUtilRt.copy(executable, copy);
|
||||
if (!copy.setExecutable(executable.canExecute())) throw new IOException("Cannot make file executable: " + copy);
|
||||
return copy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user