This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 98395 - watches view not updated
Summary: watches view not updated
Status: VERIFIED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
: 99367 108601 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-20 21:07 UTC by Pavel Buzek
Modified: 2007-08-13 15:10 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2007-03-20 21:07:57 UTC
When I add or change a watch nothing changes in the view. If I switch to Local
Variables and back the watches view gets updated and I see my changes.
Comment 1 Martin Krauskopf 2007-03-20 22:10:47 UTC
Yes. Probably Watch.addPropertyChangeListener() manages this. Will fix soon.
Comment 2 Martin Krauskopf 2007-03-29 13:15:39 UTC
*** Issue 99367 has been marked as a duplicate of this issue. ***
Comment 3 Martin Krauskopf 2007-05-06 19:28:52 UTC
I did a lot of changes wrt. Watches and Locals Variables view in the last days.
This one seems to be fixed as well for me. Let me now and reopen or file a new
issue if you have any problem with this. Thanks.
(sorry, no commit log this time)
Comment 4 Martin Krauskopf 2007-07-02 08:04:30 UTC
This still does not work as James reports in issue 108601. One has to click to another view and back to force the
refresh or other nonintuitive workarounds. Quite odd -> P2.
Comment 5 Martin Krauskopf 2007-07-02 08:05:16 UTC
*** Issue 108601 has been marked as a duplicate of this issue. ***
Comment 6 Jiri Kovalsky 2007-07-03 14:14:02 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 7 Martin Krauskopf 2007-07-09 20:26:13 UTC
I'm not able to reproduce this issue. But I did not do anything related in the Ruby codebase. We spoke about this
problem with Martin (reassigning to) and we agreed that there should not be anything special needed from the
Ruby-debugger side. However the bug seems to be happening only with the Ruby debugger (so far no issues for Java, Ant,
... debuggers). So Martin will put some logging to some places in the general Debugger APIs.
If anybody would have some reliable steps to reproduce this issue, it would be really helpful.
Comment 8 jamespb 2007-07-09 20:54:19 UTC
Hit a breakpoint, right click in the 'watches' pane, type in "blarg" as the expression to watch, hit OK.

Result: nothing changes in the watch pane.

Hit F7 to step into the next call, or switch to a different pane and then back to watches.

Now see 'blarg' in the watch list, with the value of nil.  (blarg doesn't exist)

I get this 100% of the time.  I've never seen the correct behavior.  I'm running on Windows, maybe it's OS-dependent?

Product Version: NetBeans Ruby IDE 070708 Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06 System: Windows Vista
version 6.0 running on x86; Cp1252; en_US (nbrubyide) Userdir: C:\Users\James\AppData\Roaming\.nbrubyide\dev
Comment 9 jamespb 2007-07-09 20:57:43 UTC
I just noticed that i see the same thing for removing a watch.  Select the 'blarg' you just inserted, hit 'delete.' 
It's still showing in the list, until you switch to a different pane (call stack, whatever) and then back to watches. 
Now it's gone.
Comment 10 Martin Krauskopf 2007-07-10 05:10:53 UTC
I exactly know what you mean James.... Probably I've caught the culprit. It seems to be happening with Ruby IDE only. If
you have full-blown IDE with Java + installed Ruby cluster it seems to work. James or Pavle could you confirm that?
If so we probably need some more module dependency (we already include Debugger Core API and UI)?
Comment 11 Martin Krauskopf 2007-07-10 05:14:15 UTC
> Probably I've caught the culprit.... Ruby IDE only....

Umm, no. Just got the same behavior with the full-blown IDE. Quite RANDOM for me so far.
Comment 12 Martin Entlicher 2007-07-10 13:30:26 UTC
I've reproduced the bug without any problems. Do not know whether it was a luck or not though. It seems that the same
problem is when the watch is deleted.
Starting to search for the source of the problem. In JPDA debugger this works fine, strange...
Comment 13 Martin Entlicher 2007-07-10 15:52:31 UTC
It's not really random, it depends on whether the watches tree model from debugger core UI was active or not. When it
was active (e.g. a tiny moment when a debugging session is closing, or if Watches view is opened when there is no
debugging session running), then it works, because it sets up a listener on DebuggerManager.

When WatchesTreeModel from debugger core UI is used, it works without problem, because is listens on DebuggerManager
(see WatchesTreeModel.Listener). But when WatchesModel from ruby is used, it's not updated, because is does not listen
on DebuggerManager.

Therefore this needs to be fixed in ruby WatchesModel, or the TreeModel implementation might be removed from Ruby, if
the impl from debugger core UI is sufficient.

Therefore moving back to Ruby...
Comment 14 Martin Entlicher 2007-07-10 21:04:19 UTC
FYI: I've fixed this bug in ANT debugger by removal of TreeModel implementation.
You probably do not want to do this in Ruby, since you do some special work in getChildren(). Thus firing a model change
event after a watch is added/removed (like in WatchesTreeModel.Listener) should solve this.

/shared/data/ccvs/repository/ant/debugger/src/META-INF/debugger/AntSession/WatchesView/org.netbeans.spi.viewmodel.TreeModel,v
 <--  org.netbeans.spi.viewmodel.TreeModel
new revision: delete; previous revision: 1.1

/shared/data/ccvs/repository/ant/debugger/src/org/netbeans/modules/ant/debugger/WatchesModel.java,v  <--  WatchesModel.java
new revision: 1.6; previous revision: 1.5
Comment 15 Martin Krauskopf 2007-07-10 21:13:00 UTC
Thanks a lot for the help Martine. I'll take a look at it soon.
Comment 16 Martin Krauskopf 2007-07-16 14:14:37 UTC
So finally fixed according to Martin's hints. Thanks.
Let me know if there are still some problem.

debugger/src/org/netbeans/modules/ruby/debugger/model/VariablesModel.java;
new revision: 1.2; previous revision: 1.1
debugger/src/org/netbeans/modules/ruby/debugger/model/WatchesModel.java;
new revision: 1.2; previous revision: 1.1
Comment 17 Tomas Danek 2007-08-13 15:10:33 UTC
refreshing works fine now, 20070813. verified.