Got rid of "namespace" term in descriptors module.

This commit is contained in:
Evgeny Gerashchenko
2014-01-09 23:34:37 +04:00
parent 997d3597a9
commit 7e7908b831
6 changed files with 9 additions and 9 deletions
@@ -59,7 +59,7 @@ public class JetNamespaceHeader extends JetReferenceExpression {
@NotNull
public Name getNameAsName() {
PsiElement nameIdentifier = getNameIdentifier();
return nameIdentifier == null ? SpecialNames.ROOT_NAMESPACE : Name.identifier(nameIdentifier.getText());
return nameIdentifier == null ? SpecialNames.ROOT_PACKAGE : Name.identifier(nameIdentifier.getText());
}
public boolean isRoot() {
@@ -25,6 +25,6 @@ import org.jetbrains.jet.lang.types.PackageType;
public class JetModuleUtil {
public static PackageType getRootPackageType(JetElement expression) {
// TODO: this is a stub: at least the modules' root namespaces must be indexed here
return new PackageType(SpecialNames.ROOT_NAMESPACE, JetScope.EMPTY, ReceiverValue.NO_RECEIVER);
return new PackageType(SpecialNames.ROOT_PACKAGE, JetScope.EMPTY, ReceiverValue.NO_RECEIVER);
}
}
@@ -96,7 +96,7 @@ public class LazyResolveTestUtil {
JetNamespaceHeader header = file.getNamespaceHeader();
if (header != null) {
List<JetSimpleNameExpression> names = header.getNamespaceNames();
Name name = names.isEmpty() ? SpecialNames.ROOT_NAMESPACE : names.get(0).getReferencedNameAsName();
Name name = names.isEmpty() ? SpecialNames.ROOT_PACKAGE : names.get(0).getReferencedNameAsName();
shortNames.add(name);
}
else {
@@ -463,7 +463,7 @@ public class DescriptorUtils {
}
/**
* @return true iff {@code descriptor}'s first non-class container is a namespace
* @return true iff {@code descriptor}'s first non-class container is a package
*/
public static boolean isTopLevelOrInnerClass(@NotNull ClassDescriptor descriptor) {
DeclarationDescriptor containing = descriptor.getContainingDeclaration();
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.NotNull;
public class SpecialNames {
public static final Name NO_NAME_PROVIDED = Name.special("<no name provided>");
public static final Name ROOT_NAMESPACE = Name.special("<root namespace>");
public static final Name ROOT_PACKAGE = Name.special("<root package>");
private static final String CLASS_OBJECT_FOR = "<class-object-for-";
@@ -240,8 +240,8 @@ public class WritableScopeImpl extends WritableScopeWithImports {
public VariableDescriptor getLocalVariable(@NotNull Name name) {
checkMayRead();
Map<Name, DeclarationDescriptor> variableClassOrNamespaceDescriptors = getVariableOrClassDescriptors();
DeclarationDescriptor descriptor = variableClassOrNamespaceDescriptors.get(name);
Map<Name, DeclarationDescriptor> variableOrClassDescriptors = getVariableOrClassDescriptors();
DeclarationDescriptor descriptor = variableOrClassDescriptors.get(name);
if (descriptor instanceof VariableDescriptor && !getPropertyGroups().get(name).contains(descriptor)) {
return (VariableDescriptor) descriptor;
}
@@ -368,8 +368,8 @@ public class WritableScopeImpl extends WritableScopeWithImports {
public ClassifierDescriptor getClassifier(@NotNull Name name) {
checkMayRead();
Map<Name, DeclarationDescriptor> variableClassOrNamespaceDescriptors = getVariableOrClassDescriptors();
DeclarationDescriptor descriptor = variableClassOrNamespaceDescriptors.get(name);
Map<Name, DeclarationDescriptor> variableOrClassDescriptors = getVariableOrClassDescriptors();
DeclarationDescriptor descriptor = variableOrClassDescriptors.get(name);
if (descriptor instanceof ClassifierDescriptor) return (ClassifierDescriptor) descriptor;
ClassifierDescriptor classifierDescriptor = getWorkerScope().getClassifier(name);