Community
Participate
Working Groups
Steps to reproduce: Create a new profile P and a connection C within that profile. Delete the profile P using the Team view. Create the profile P again. Attempt to create connection C in profile P again. Get either a "Widget Disposed" exceptino or an "IllegalArgumentException" This appears to be caused by a disposed widget being left in the element map of the StructuredViewer on which the SystemView is based. I suspect the widget representing the connection is being disposed, but that it is not being properly removed from the map due to ElementComparer problem. The problem is fairly rare but consistently reproducible.
The bug was in the way the absolute name was formed for deleted hosts. This is used in the hash calculation for the ElementComparer. The absolute name for a host includes its profile name. If a profile deletion caused the host deletion then the absolute name, and thus its hashcode determined by the comparer, changed. This was causing the map of objects->widgets to get mixed up and a disposed widget to be left in the map. The fix was to ensure that absolute host names, even for hosts with deleted profiles, included the profile name.
Thanks Dave. In fact the important point is that an absolute name must always uniquely identify an object and must never change -- that's what the Javadoc in IRemoteObjectIdentifier says.