make sure ClassDescriptor.toString does not crash so we can use it in exception messages

This commit is contained in:
Stepan Koltsov
2012-03-12 22:53:55 +04:00
parent 8be79b3f22
commit 88f55100ca
@@ -330,7 +330,11 @@ public class MutableClassDescriptorLite extends MutableDeclarationDescriptor imp
@Override
public String toString() {
return DescriptorRenderer.TEXT.render(this) + "[" + getClass().getCanonicalName() + "@" + System.identityHashCode(this) + "]";
try {
return DescriptorRenderer.TEXT.render(this) + "[" + getClass().getCanonicalName() + "@" + System.identityHashCode(this) + "]";
} catch (Throwable e) {
return super.toString();
}
}
@Override