From 3136bde93516997bf14e0e46266cd6ff44c92ee9 Mon Sep 17 00:00:00 2001 From: "peter.gromov" Date: Thu, 11 Nov 2010 17:40:24 +0300 Subject: [PATCH] final one-element array not needed anymore --- .../completion/FilePathCompletionContributor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java index 2c34c45b8350..fc38b698fa13 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/FilePathCompletionContributor.java @@ -102,10 +102,10 @@ public class FilePathCompletionContributor extends CompletionContributor { throw new AssertionError("prefix should be some actual file string just before caret: " + prefix + "\n text=" + fragment + ";\npathString=" + set.getPathString() + ";\nelementText=" + e.getParent().getText()); } - final List[] pathPrefixParts = new List[] {null}; + List pathPrefixParts = null; int lastSlashIndex; if ((lastSlashIndex = prefix.lastIndexOf('/')) != -1) { - pathPrefixParts[0] = StringUtil.split(prefix.substring(0, lastSlashIndex), "/"); + pathPrefixParts = StringUtil.split(prefix.substring(0, lastSlashIndex), "/"); prefix = prefix.substring(lastSlashIndex + 1); } @@ -141,7 +141,7 @@ public class FilePathCompletionContributor extends CompletionContributor { final VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null && virtualFile.isValid() && virtualFile != contextFile) { if (contextHelper.isMine(project, virtualFile)) { - if (pathPrefixParts[0] == null || fileMatchesPathPrefix(contextHelper.getPsiFileSystemItem(project, virtualFile), pathPrefixParts[0])) { + if (pathPrefixParts == null || fileMatchesPathPrefix(contextHelper.getPsiFileSystemItem(project, virtualFile), pathPrefixParts)) { __result.addElement(new FilePathLookupItem(file, contextHelper)); } }