more accurate work with same jar files with different timestamps, we don't need to...
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 2 May 2016 12:24:50 +0000 (14:24 +0200)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 2 May 2016 12:26:07 +0000 (14:26 +0200)
platform/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java

index b089dec7a135aceb8d0b1db5582a4e44c99c7cb1..fd0672a9305824df1e7473d394033377f81b2363 100644 (file)
@@ -162,9 +162,9 @@ public class JarHandler extends ZipHandler {
       String mirrorName = getSnapshotName(originalFile.getName(), sha1.digest());
       mirrorFile = new File(jarDir, mirrorName);
 
-      if (mirrorDiffers(originalAttributes, FileSystemUtil.getAttributes(mirrorFile), true)) {
+      FileAttributes mirrorFileAttributes = FileSystemUtil.getAttributes(mirrorFile);
+      if (mirrorFileAttributes == null) {
         try {
-          FileUtil.delete(mirrorFile);
           FileUtil.rename(tempJarFile, mirrorFile);
           FileUtil.setLastModified(mirrorFile, originalAttributes.lastModified);
         }
@@ -177,7 +177,7 @@ public class JarHandler extends ZipHandler {
         FileUtil.delete(tempJarFile);
       }
 
-      info = new CacheLibraryInfo(mirrorFile.getName(), originalAttributes.lastModified, originalAttributes.length);
+      info = new CacheLibraryInfo(mirrorFile.getName(),  originalAttributes.lastModified, originalAttributes.length);
       CacheLibraryInfo.ourCachedLibraryInfo.put(path, info);
       return mirrorFile;
     }