mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-30655 - CME: JspFileViewProviderImpl.getKnownTaglibPrefixes
IDEA-76746 Complete freeze of the UI
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user