Bug 166360 - [DataBinding] Need nice toString implementations on all IObservable classes to facilitate debugging
Summary: [DataBinding] Need nice toString implementations on all IObservable classes t...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-30 10:50 EST by Dave Orme CLA
Modified: 2019-09-06 16:07 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Orme CLA 2006-11-30 10:50:26 EST
When debugging it would be nice to be able to call the toString method of an IObservable to find out the class of the observable, the class of the thing the observable is bound to, and some hint of the current value of the thing--say, the actual value if it's an IObservableValue, or the first few elements if it's a list or set.
Comment 1 Matthew Hall CLA 2009-01-22 18:56:28 EST
When debugging an IObservableCollection or IObservableMap, a call to toString() results in a getterCalled().  On a few occasions this has made it really difficult to track down bugs related to ObservableTracker.getterCalled().  For example, set a breakpoint in ObservableTracker.getterCalled(), then set another breakpoint in a method where an observable collection/map is visible in the Variables view.  It makes for some instructive lessons on the Heisenberg principle.  ;)

Also, the default collection/map implementations override toString() by default to return a string representation of the collection/map contents.  This is not guaranteed in API but is conventional throughout the collections API.  Do we want to override this?
Comment 2 Boris Bokowski CLA 2009-01-23 10:52:57 EST
Do you think we could change our toString() implementations so that they don't end up calling getterCalled()? We would need to document this somehow, and it would be a change in behavior, but my guess would be that this is what you want in 99% of all cases. In the remaining 1%, clients would have to make sure that their read access has been tracked.
Comment 3 Matthew Hall CLA 2009-01-23 12:40:39 EST
(In reply to comment #2)
> Do you think we could change our toString() implementations so that they don't
> end up calling getterCalled()?

I don't see how this would be possible since building the string requires iterating the collection, which would necessarily invoke getterCalled().  Am I missing some other option you're thinking of?
Comment 4 Boris Bokowski CLA 2009-01-23 12:43:35 EST
Maybe calling internal methods that can iterate without causing the getterCalled()?
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:07:41 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.