From d0cf2a1190ef377451ddcb7cdcfb561a9df44da8 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Fri, 10 Oct 2008 09:55:47 +0400 Subject: [PATCH] code rearranged to avoid jvm bug (IDEADEV-26894) --- .../openapi/vfs/impl/jar/JarHandler.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java b/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java index 42c06563c7b1..7baf9e9c0166 100644 --- a/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java +++ b/platform-impl/src/com/intellij/openapi/vfs/impl/jar/JarHandler.java @@ -90,18 +90,18 @@ public class JarHandler implements FileSystemInterface { final ZipFile zip = getZip(); map = new THashMap(); - if (zip == null) return map; + if (zip != null) { + map.put("", new EntryInfo("", null, true)); + final Enumeration entries = zip.entries(); + while (entries.hasMoreElements()) { + ZipEntry entry = entries.nextElement(); + final String name = entry.getName(); + final boolean isDirectory = name.endsWith("/"); + getOrCreate(isDirectory ? name.substring(0, name.length() - 1) : name, isDirectory, map); + } - map.put("", new EntryInfo("", null, true)); - final Enumeration entries = zip.entries(); - while (entries.hasMoreElements()) { - ZipEntry entry = entries.nextElement(); - final String name = entry.getName(); - final boolean isDirectory = name.endsWith("/"); - getOrCreate(isDirectory ? name.substring(0, name.length() - 1) : name, isDirectory, map); + myRelPathsToEntries = new SoftReference>(map); } - - myRelPathsToEntries = new SoftReference>(map); } return map; }