Community
Participate
Working Groups
Follow-up to bug 327004 The "Widget is disposed" exception from bug 327004 (and all the other similar bugs that could not be reproduced) has been traced back to two possible error conditions in the while-loop in AbstractTreeViewer#updateChildren(*): - data could be null (should AFAIK not happen) - the tree content provider returned multiple equal children for a parent node At least for the second problem, we should add a debug flag in JFace to make it easier for clients to find such problems. The patch from bug 327004 comment 6 already implemented such a message, but instead of only logging the problem in that specific error condition, the message should be written for *all* cases where this could happen. We could add the optional check to StructuredViewer#getRawChildren(Object) and all overriding methods, or probably even broader in StructuredViewer#assertElementsNotNull(Object). The latter should be called wherever children are fetched from a content provider (but it's missing is some places like AbstractTreeViewer#getRawChildren(Object)).
Created attachment 192217 [details] Fix - adds the org.eclipse.jface/debug/viewers/equalElements debug option (disabled by default) - fixes debug option support in JFaceUtil - adds missing assertElementsNotNull(*) to AbstractTreeViewer
Fixed in HEAD.
Verified in I20110426-2000.
The change in ui.workbench didn't make it into the 4.x stream. Manually cherry-picked now: Commit 2295bf6c7372f559353bb09ca40750d8d93f3448