From f77da63b469231360f1b768b8bbfc5671a36657e Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 21 May 2015 16:03:34 +0200 Subject: [PATCH] a bit more diagnostics for EA-63193 - assert: MessageBusImpl.asRoot --- .../util/messages/impl/MessageBusImpl.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/platform/util/src/com/intellij/util/messages/impl/MessageBusImpl.java b/platform/util/src/com/intellij/util/messages/impl/MessageBusImpl.java index 92a7f65e762d..0057de3a8bba 100644 --- a/platform/util/src/com/intellij/util/messages/impl/MessageBusImpl.java +++ b/platform/util/src/com/intellij/util/messages/impl/MessageBusImpl.java @@ -79,14 +79,14 @@ public class MessageBusImpl implements MessageBus { private boolean myDisposed; public MessageBusImpl(@NotNull Object owner, @NotNull MessageBus parentBus) { - myOwner = owner.toString(); + myOwner = owner.toString() + " of " + owner.getClass(); myParentBus = (MessageBusImpl)parentBus; myOrder = myParentBus.notifyChildBusCreated(this); LOG.assertTrue(myParentBus.myChildBuses.contains(this)); } private MessageBusImpl(Object owner) { - myOwner = owner.toString(); + myOwner = owner.toString() + " of " + owner.getClass(); myOrder = Collections.emptyList(); } @@ -101,10 +101,15 @@ public class MessageBusImpl implements MessageBus { } private RootBus asRoot() { - if ((this instanceof RootBus)) { + if (this instanceof RootBus) { return (RootBus)this; } - throw new AssertionError("Accessing disposed message bus; " + myOwner); + throw new AssertionError("Accessing disposed message bus " + this); + } + + @Override + public String toString() { + return super.toString() + "; owner=" + myOwner + (myDisposed ? "; disposed" : ""); } private List notifyChildBusCreated(final MessageBusImpl childBus) { @@ -223,7 +228,7 @@ public class MessageBusImpl implements MessageBus { } private void checkNotDisposed() { - if (myDisposed) LOG.error("Already disposed: " + myOwner); + if (myDisposed) LOG.error("Already disposed: " + this); } private void calcSubscribers(Topic topic, List result) {