From aff9ac65cfebd1b090ffedeb9a5f2b0845cb3c21 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Mon, 19 Jan 2015 16:41:54 +0300 Subject: [PATCH] Remove unnecessary intermediate class --- .../kotlin/load/java/JavaClassFinderImpl.java | 8 ++-- .../resolve/jvm/KotlinJavaPsiFacade.java | 39 ------------------- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/KotlinJavaPsiFacade.java diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/JavaClassFinderImpl.java b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/JavaClassFinderImpl.java index adc599a5c72..a68141295fb 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/JavaClassFinderImpl.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/JavaClassFinderImpl.java @@ -24,6 +24,7 @@ import com.intellij.psi.search.DelegatingGlobalSearchScope; import com.intellij.psi.search.GlobalSearchScope; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.kotlin.idea.JetFileType; import org.jetbrains.kotlin.load.java.structure.JavaClass; import org.jetbrains.kotlin.load.java.structure.JavaPackage; import org.jetbrains.kotlin.load.java.structure.impl.JavaClassImpl; @@ -31,9 +32,8 @@ import org.jetbrains.kotlin.load.java.structure.impl.JavaPackageImpl; import org.jetbrains.kotlin.name.ClassId; import org.jetbrains.kotlin.name.FqName; import org.jetbrains.kotlin.name.FqNameUnsafe; -import org.jetbrains.kotlin.idea.JetFileType; import org.jetbrains.kotlin.resolve.jvm.JavaClassFinderPostConstruct; -import org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade; +import org.jetbrains.kotlin.resolve.jvm.JavaPsiFacadeImpl; import javax.annotation.PostConstruct; import javax.inject.Inject; @@ -43,7 +43,7 @@ public class JavaClassFinderImpl implements JavaClassFinder { private GlobalSearchScope baseScope; private GlobalSearchScope javaSearchScope; - private KotlinJavaPsiFacade javaFacade; + private JavaPsiFacadeImpl javaFacade; @Inject public void setProject(@NotNull Project project) { @@ -75,7 +75,7 @@ public class JavaClassFinderImpl implements JavaClassFinder { return project; } }; - javaFacade = new KotlinJavaPsiFacade(project, javaSearchScope); + javaFacade = new JavaPsiFacadeImpl(project, javaSearchScope); } @Nullable diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/KotlinJavaPsiFacade.java b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/KotlinJavaPsiFacade.java deleted file mode 100644 index e74a0049e06..00000000000 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/KotlinJavaPsiFacade.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2010-2015 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.kotlin.resolve.jvm; - -import com.intellij.openapi.project.Project; -import com.intellij.psi.PsiClass; -import com.intellij.psi.PsiPackage; -import com.intellij.psi.search.GlobalSearchScope; -import org.jetbrains.annotations.NotNull; - -public class KotlinJavaPsiFacade { - private final JavaPsiFacadeImpl javaPsiFacadeWrapper; - - public KotlinJavaPsiFacade(Project project, GlobalSearchScope searchScope) { - javaPsiFacadeWrapper = new JavaPsiFacadeImpl(project, searchScope); - } - - public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) { - return javaPsiFacadeWrapper.findClass(qualifiedName, scope); - } - - public PsiPackage findPackage(@NotNull String qualifiedName) { - return javaPsiFacadeWrapper.findPackage(qualifiedName); - } -}