util: enable ZipFIle cache only under main class loader (condition tuned to pass...
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 15 Jan 2015 19:05:19 +0000 (20:05 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 15 Jan 2015 19:05:19 +0000 (20:05 +0100)
platform/util/src/com/intellij/openapi/util/io/ZipFileCache.java

index eb1bb827ceebdc8bada9280e443d4c1be8d7207d..bf98c0f63b6d290a249a2badf069178d9942e705 100644 (file)
@@ -19,7 +19,6 @@ import com.intellij.openapi.diagnostic.LogUtil;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.util.ConcurrencyUtil;
 import com.intellij.util.containers.ContainerUtil;
-import com.intellij.util.lang.UrlClassLoader;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -70,7 +69,7 @@ public class ZipFileCache {
   }
 
   private static final boolean ourEnabled =
-    ZipFileCache.class.getClassLoader().getClass().getName().equals(UrlClassLoader.class.getName());
+    ZipFileCache.class.getClassLoader().getResource("com/intellij/openapi/application/Application.class") != null;
 
   private static final Object ourLock = new Object();
   private static final Map<String, CacheRecord> ourPathCache = ContainerUtil.newTroveMap(FileUtil.PATH_HASHING_STRATEGY);