diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java index 3c62fd2f5f5..b106a5f0018 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetNamespaceHeader.java @@ -18,12 +18,10 @@ package org.jetbrains.jet.lang.psi; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiReference; -import com.intellij.psi.PsiReferenceService; -import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.JetNodeTypes; +import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.resolve.name.Name; @@ -69,7 +67,7 @@ public class JetNamespaceHeader extends JetReferenceExpression { @NotNull public Name getNameAsName() { PsiElement nameIdentifier = getNameIdentifier(); - return nameIdentifier == null ? JetPsiUtil.ROOT_NAMESPACE_NAME : Name.identifier(nameIdentifier.getText()); + return nameIdentifier == null ? DescriptorUtils.ROOT_NAMESPACE_NAME : Name.identifier(nameIdentifier.getText()); } public boolean isRoot() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java index 65c74a9e8e5..8198e936ca6 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetPsiUtil.java @@ -49,7 +49,6 @@ import java.util.Set; public class JetPsiUtil { public static final Name NO_NAME_PROVIDED = Name.special(""); - public static final Name ROOT_NAMESPACE_NAME = Name.special(""); private JetPsiUtil() { } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java index eeea8bcb6d9..b994fd7a8c2 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DescriptorUtils.java @@ -40,6 +40,8 @@ import java.util.*; import static org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER; public class DescriptorUtils { + public static final Name ROOT_NAMESPACE_NAME = Name.special(""); + private DescriptorUtils() { } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/JetModuleUtil.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/JetModuleUtil.java index 3b98d8332a7..6422bf6b470 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/JetModuleUtil.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/JetModuleUtil.java @@ -17,13 +17,12 @@ package org.jetbrains.jet.lang.resolve; import org.jetbrains.jet.lang.psi.JetElement; -import org.jetbrains.jet.lang.psi.JetPsiUtil; import org.jetbrains.jet.lang.resolve.scopes.JetScope; import org.jetbrains.jet.lang.types.NamespaceType; public class JetModuleUtil { public static NamespaceType getRootNamespaceType(JetElement expression) { // TODO: this is a stub: at least the modules' root namespaces must be indexed here - return new NamespaceType(JetPsiUtil.ROOT_NAMESPACE_NAME, JetScope.EMPTY); + return new NamespaceType(DescriptorUtils.ROOT_NAMESPACE_NAME, JetScope.EMPTY); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java index 4c2f97aa7f1..646cfc6eb78 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/lang/KotlinBuiltIns.java @@ -27,7 +27,6 @@ import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.descriptors.impl.NamespaceDescriptorImpl; import org.jetbrains.jet.lang.descriptors.impl.ValueParameterDescriptorImpl; -import org.jetbrains.jet.lang.psi.JetPsiUtil; import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.lazy.storage.LockBasedStorageManager; import org.jetbrains.jet.lang.resolve.name.FqName; @@ -164,7 +163,7 @@ public class KotlinBuiltIns { private static void loadBuiltIns(@NotNull ModuleDescriptorImpl module) throws IOException { NamespaceDescriptorImpl rootNamespace = - new NamespaceDescriptorImpl(module, Collections.emptyList(), JetPsiUtil.ROOT_NAMESPACE_NAME); + new NamespaceDescriptorImpl(module, Collections.emptyList(), DescriptorUtils.ROOT_NAMESPACE_NAME); rootNamespace.initialize( new WritableScopeImpl(JetScope.EMPTY, rootNamespace, RedeclarationHandler.DO_NOTHING, "members of root namespace")); diff --git a/compiler/tests/org/jetbrains/jet/JetTestUtils.java b/compiler/tests/org/jetbrains/jet/JetTestUtils.java index 8dea3381a87..df471af18e2 100644 --- a/compiler/tests/org/jetbrains/jet/JetTestUtils.java +++ b/compiler/tests/org/jetbrains/jet/JetTestUtils.java @@ -52,11 +52,7 @@ import org.jetbrains.jet.lang.diagnostics.Severity; import org.jetbrains.jet.lang.diagnostics.rendering.DefaultErrorMessages; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.lang.psi.JetPsiFactory; -import org.jetbrains.jet.lang.psi.JetPsiUtil; -import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.BindingTrace; -import org.jetbrains.jet.lang.resolve.ImportPath; +import org.jetbrains.jet.lang.resolve.*; import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM; import org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestUtil; import org.jetbrains.jet.lang.resolve.name.Name; @@ -648,7 +644,7 @@ public class JetTestUtils { public static NamespaceDescriptorImpl createTestNamespace(@NotNull Name testPackageName) { ModuleDescriptorImpl module = AnalyzerFacadeForJVM.createJavaModule(""); NamespaceDescriptorImpl rootNamespace = - new NamespaceDescriptorImpl(module, Collections.emptyList(), JetPsiUtil.ROOT_NAMESPACE_NAME); + new NamespaceDescriptorImpl(module, Collections.emptyList(), DescriptorUtils.ROOT_NAMESPACE_NAME); module.setRootNamespace(rootNamespace); NamespaceDescriptorImpl test = new NamespaceDescriptorImpl(rootNamespace, Collections.emptyList(), testPackageName); test.initialize(new WritableScopeImpl(JetScope.EMPTY, test, RedeclarationHandler.DO_NOTHING, "members of test namespace"));