From a153fcd8f2a009b0c5ef35a02ee32f131d0a8d0a Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Fri, 11 Nov 2011 12:02:48 +0400 Subject: [PATCH] EA-30655 - CME: JspFileViewProviderImpl.getKnownTaglibPrefixes IDEA-76746 Complete freeze of the UI --- .../src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java index 95faccc432d0..e2ac1f0a0d2d 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/VfsImplUtil.java @@ -15,6 +15,7 @@ */ package com.intellij.openapi.vfs.newvfs; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NonNls; @@ -24,8 +25,14 @@ import org.jetbrains.annotations.Nullable; import java.io.File; public class VfsImplUtil { + + private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vfs.newvfs.VfsImplUtil"); + @NonNls private static final String FILE_SEPARATORS = "/" + File.separator; + private VfsImplUtil() { + } + @Nullable public static VirtualFile findFileByPath(NewVirtualFileSystem vfs, @NotNull @NonNls final String path) { final String normalizedPath = vfs.normalize(path); @@ -83,6 +90,7 @@ public class VfsImplUtil { NewVirtualFile file = ManagingFS.getInstance().findRoot(basePath, vfs); if (file == null || !file.exists()) return null; + LOG.assertTrue(basePath.length() <= normalizedPath.length(), vfs + " failed to extract root path: " + basePath + " from " + normalizedPath); for (String pathElement : StringUtil.tokenize(normalizedPath.substring(basePath.length()), FILE_SEPARATORS)) { if (pathElement.length() == 0 || ".".equals(pathElement)) continue; if ("..".equals(pathElement)) {