mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Revert: vcs: Refactored "FilePath" implementations not to create new "File" instances on each "getIOFile()" call - reuse same "File" instance created in constructor instead (d962b00bb5)
This commit is contained in:
@@ -42,12 +42,10 @@ import java.nio.charset.Charset;
|
||||
@Deprecated
|
||||
public class FilePathImpl implements FilePath {
|
||||
@NotNull private final String myPath;
|
||||
@NotNull private final File myIOFile;
|
||||
private final boolean myIsDirectory;
|
||||
|
||||
public FilePathImpl(@NotNull String path, boolean isDirectory) {
|
||||
myPath = FileUtil.toCanonicalPath(path);
|
||||
myIOFile = new File(myPath);
|
||||
myIsDirectory = isDirectory;
|
||||
}
|
||||
public FilePathImpl(@NotNull VirtualFile file) {
|
||||
@@ -122,7 +120,7 @@ public class FilePathImpl implements FilePath {
|
||||
@Override
|
||||
@NotNull
|
||||
public File getIOFile() {
|
||||
return myIOFile;
|
||||
return new File(myPath);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -35,12 +35,10 @@ import java.nio.charset.Charset;
|
||||
|
||||
public class LocalFilePath implements FilePath {
|
||||
@NotNull private final String myPath;
|
||||
@NotNull private final File myIOFile;
|
||||
private final boolean myIsDirectory;
|
||||
|
||||
public LocalFilePath(@NotNull String path, boolean isDirectory) {
|
||||
myPath = FileUtil.toCanonicalPath(path);
|
||||
myIOFile = new File(myPath);
|
||||
myIsDirectory = isDirectory;
|
||||
}
|
||||
|
||||
@@ -112,7 +110,7 @@ public class LocalFilePath implements FilePath {
|
||||
@Override
|
||||
@NotNull
|
||||
public File getIOFile() {
|
||||
return myIOFile;
|
||||
return new File(myPath);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -37,12 +37,10 @@ public class RemoteFilePath implements FilePath {
|
||||
private static final TObjectHashingStrategy<String> CASE_SENSITIVE_STRATEGY = FilePathHashingStrategy.create(true);
|
||||
|
||||
@NotNull private final String myPath;
|
||||
@NotNull private final File myIOFile;
|
||||
private final boolean myIsDirectory;
|
||||
|
||||
public RemoteFilePath(@NotNull String path, boolean isDirectory) {
|
||||
myPath = path;
|
||||
myIOFile = new File(myPath);
|
||||
myIsDirectory = isDirectory;
|
||||
}
|
||||
|
||||
@@ -61,7 +59,7 @@ public class RemoteFilePath implements FilePath {
|
||||
@NotNull
|
||||
@Override
|
||||
public File getIOFile() {
|
||||
return myIOFile;
|
||||
return new File(myPath);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user