Show uninitialized descriptor's name in DeclarationDescriptor.toString()
This commit is contained in:
+8
-2
@@ -53,12 +53,18 @@ public abstract class DeclarationDescriptorImpl extends AnnotatedImpl implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
return toString(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
/* package */ static String toString(@NotNull DeclarationDescriptor descriptor) {
|
||||||
try {
|
try {
|
||||||
return DescriptorRenderer.DEBUG_TEXT.render(this) + "[" + getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(this)) + "]";
|
return DescriptorRenderer.DEBUG_TEXT.render(descriptor) +
|
||||||
|
"[" + descriptor.getClass().getSimpleName() + "@" + Integer.toHexString(System.identityHashCode(descriptor)) + "]";
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
// DescriptionRenderer may throw if this is not yet completely initialized
|
// DescriptionRenderer may throw if this is not yet completely initialized
|
||||||
// It is very inconvenient while debugging
|
// It is very inconvenient while debugging
|
||||||
return this.getClass().getName() + "@" + System.identityHashCode(this);
|
return descriptor.getClass().getSimpleName() + " " + descriptor.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -368,4 +368,9 @@ public class MutableClassDescriptor extends ClassDescriptorBase implements Class
|
|||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return DeclarationDescriptorImpl.toString(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user