remove constructor parameter of JavaNamespaceDescriptor
This commit is contained in:
-2
@@ -37,7 +37,6 @@ import org.jetbrains.jet.lang.resolve.constants.StringValue;
|
||||
import org.jetbrains.jet.lang.resolve.java.kt.JetClassAnnotation;
|
||||
import org.jetbrains.jet.lang.resolve.java.kt.PsiAnnotationWithFlags;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.name.NamePredicate;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
@@ -694,7 +693,6 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
JavaNamespaceDescriptor ns = new JavaNamespaceDescriptor(
|
||||
parentNs,
|
||||
Collections.<AnnotationDescriptor>emptyList(), // TODO
|
||||
qualifiedName.isRoot() ? FqNameUnsafe.ROOT_NAME : qualifiedName.shortName(),
|
||||
qualifiedName
|
||||
);
|
||||
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ public class JavaNamespaceDescriptor extends AbstractNamespaceDescriptorImpl {
|
||||
private final FqName qualifiedName;
|
||||
|
||||
public JavaNamespaceDescriptor(NamespaceDescriptorParent containingDeclaration, List<AnnotationDescriptor> annotations,
|
||||
@NotNull Name name, @NotNull FqName qualifiedName) {
|
||||
super(containingDeclaration, annotations, name);
|
||||
@NotNull FqName qualifiedName) {
|
||||
super(containingDeclaration, annotations, qualifiedName.shortNameOrSpecial());
|
||||
this.qualifiedName = qualifiedName;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,11 @@ public class FqName extends FqNameBase {
|
||||
return fqName.shortName();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Name shortNameOrSpecial() {
|
||||
return fqName.shortNameOrSpecial();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<FqName> path() {
|
||||
final List<FqName> path = Lists.newArrayList();
|
||||
|
||||
@@ -146,6 +146,16 @@ public class FqNameUnsafe extends FqNameBase {
|
||||
return shortName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Name shortNameOrSpecial() {
|
||||
if (isRoot()) {
|
||||
return ROOT_NAME;
|
||||
}
|
||||
else {
|
||||
return shortName();
|
||||
}
|
||||
}
|
||||
|
||||
interface WalkCallback {
|
||||
void segment(@NotNull Name shortName, @NotNull FqNameUnsafe fqName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user