Log.warn when descriptors reach TO_STRING diagnostic renderer

This commit is contained in:
Alexander Udalov
2014-04-17 19:20:19 +04:00
parent a5cc894ecd
commit 369472a6e2
@@ -57,6 +57,11 @@ public class Renderers {
@NotNull
@Override
public String render(@NotNull Object element) {
if (element instanceof DeclarationDescriptor) {
LOG.warn("Diagnostic renderer TO_STRING was used to render an instance of DeclarationDescriptor.\n" +
"This is usually a bad idea, because descriptors' toString() includes some debug information, " +
"which should not be seen by the user.\nDescriptor: " + element);
}
return element.toString();
}