Assert we are don't perform copy into itself

This commit is contained in:
Nikolay Krasko
2013-03-06 17:29:23 +04:00
parent 3345ae8c96
commit ecff401289
@@ -162,11 +162,15 @@ public class KotlinRuntimeLibraryUtil {
jarNotFoundHandler.run();
return;
}
VirtualFile runtimeJar = getLocalKotlinRuntimeJar(project);
assert runtimeJar != null;
try {
FileUtil.copy(runtimePath, new File(runtimeJar.getPath()));
File libraryJarPath = new File(runtimeJar.getPath());
assert !FileUtil.filesEqual(runtimePath, libraryJarPath) : "Shouldn't be called for updating same file";
FileUtil.copy(runtimePath, libraryJarPath);
}
catch (IOException e) {
throw new AssertionError(e);