unhardcode <root> identifiers
This commit is contained in:
@@ -241,8 +241,7 @@ public final class DescriptorUtils {
|
|||||||
if (containedInModule) {
|
if (containedInModule) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//TODO
|
return containingDeclaration.getContainingDeclaration() instanceof ModuleDescriptor;
|
||||||
return containingDeclaration.getName().equals("<root>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -276,7 +275,7 @@ public final class DescriptorUtils {
|
|||||||
public static List<NamespaceDescriptor> getNamespaceDescriptorHierarchy(@NotNull NamespaceDescriptor namespaceDescriptor) {
|
public static List<NamespaceDescriptor> getNamespaceDescriptorHierarchy(@NotNull NamespaceDescriptor namespaceDescriptor) {
|
||||||
List<NamespaceDescriptor> result = Lists.newArrayList(namespaceDescriptor);
|
List<NamespaceDescriptor> result = Lists.newArrayList(namespaceDescriptor);
|
||||||
NamespaceDescriptor current = namespaceDescriptor;
|
NamespaceDescriptor current = namespaceDescriptor;
|
||||||
while (!current.getName().equals("<root>")) {
|
while (!(current.getContainingDeclaration() instanceof ModuleDescriptor)) {
|
||||||
result.add(current);
|
result.add(current);
|
||||||
if (current.getContainingDeclaration() instanceof NamespaceDescriptor) {
|
if (current.getContainingDeclaration() instanceof NamespaceDescriptor) {
|
||||||
current = (NamespaceDescriptor)current.getContainingDeclaration();
|
current = (NamespaceDescriptor)current.getContainingDeclaration();
|
||||||
|
|||||||
Reference in New Issue
Block a user