safer toString in classes

This commit is contained in:
Stepan Koltsov
2011-12-31 00:53:43 +04:00
parent 0f1b534d7b
commit 94ef40fc51
2 changed files with 6 additions and 2 deletions
@@ -51,7 +51,7 @@ public abstract class DeclarationDescriptorImpl extends AnnotatedImpl implements
} catch (Throwable e) {
// DescriptionRenderer may throw if this is not yet completely initialized
// It is very inconvenient while debugging
return super.toString();
return this.getClass().getName() + "@" + System.identityHashCode(this);
}
}
}
@@ -165,7 +165,11 @@ public class TypeParameterDescriptor extends DeclarationDescriptorImpl implement
@Override
public String toString() {
return DescriptorRenderer.TEXT.render(this);
try {
return DescriptorRenderer.TEXT.render(this);
} catch (Exception e) {
return this.getClass().getName() + "@" + System.identityHashCode(this);
}
}
@NotNull