From fa9307d08c9c75ef7501d301954ecacc7a66d23e Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 20 Sep 2013 17:43:20 +0400 Subject: [PATCH] Delete unused method from VirtualFileFinder --- .../jvm/compiler/CliVirtualFileFinder.java | 9 ------- .../java/vfilefinder/VirtualFileFinder.java | 23 +++++++++++----- .../vfilefinder/IDEVirtualFileFinder.java | 27 +++++++++++++------ 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliVirtualFileFinder.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliVirtualFileFinder.java index 8d7159b7ee4..65f5c1854cf 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliVirtualFileFinder.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CliVirtualFileFinder.java @@ -17,7 +17,6 @@ package org.jetbrains.jet.cli.jvm.compiler; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.search.GlobalSearchScope; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.resolve.java.header.KotlinClassFileHeader; @@ -33,14 +32,6 @@ public class CliVirtualFileFinder implements VirtualFileFinder { classPath = path; } - - @Nullable - @Override - public VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope) { - //TODO: use scope - return find(className); - } - @Nullable @Override public VirtualFile find(@NotNull FqName className) { diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/vfilefinder/VirtualFileFinder.java b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/vfilefinder/VirtualFileFinder.java index cfea6e00d24..25cd6cce296 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/vfilefinder/VirtualFileFinder.java +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/vfilefinder/VirtualFileFinder.java @@ -1,17 +1,28 @@ +/* + * Copyright 2010-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.jet.lang.resolve.java.vfilefinder; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.psi.search.GlobalSearchScope; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.resolve.name.FqName; public interface VirtualFileFinder { - - @Nullable - VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope); - //NOTE: uses all scope by default - //TODO: should be removed, scope should always be passed + // TODO: support scope @Nullable VirtualFile find(@NotNull FqName className); } diff --git a/idea/src/org/jetbrains/jet/plugin/vfilefinder/IDEVirtualFileFinder.java b/idea/src/org/jetbrains/jet/plugin/vfilefinder/IDEVirtualFileFinder.java index 4230959252d..71d01afa1a1 100644 --- a/idea/src/org/jetbrains/jet/plugin/vfilefinder/IDEVirtualFileFinder.java +++ b/idea/src/org/jetbrains/jet/plugin/vfilefinder/IDEVirtualFileFinder.java @@ -1,3 +1,19 @@ +/* + * Copyright 2010-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.jetbrains.jet.plugin.vfilefinder; import com.intellij.openapi.diagnostic.Logger; @@ -24,8 +40,9 @@ public final class IDEVirtualFileFinder implements VirtualFileFinder { @Nullable @Override - public VirtualFile find(@NotNull FqName className, @NotNull GlobalSearchScope scope) { - Collection files = FileBasedIndex.getInstance().getContainingFiles(KotlinClassFileIndex.KEY, className, scope); + public VirtualFile find(@NotNull FqName className) { + Collection files = + FileBasedIndex.getInstance().getContainingFiles(KotlinClassFileIndex.KEY, className, GlobalSearchScope.allScope(project)); if (files.isEmpty()) { return null; } @@ -34,10 +51,4 @@ public final class IDEVirtualFileFinder implements VirtualFileFinder { } return files.iterator().next(); } - - @Nullable - @Override - public VirtualFile find(@NotNull FqName className) { - return find(className, GlobalSearchScope.allScope(project)); - } }