Bug 2802

Summary: User is able to select Observer/tagset before selecting target Session = NullPointerException
Product: frysk Reporter: Len DiMaggio <ldimaggi>
Component: generalAssignee: Phil Muldoon <pmuldoon>
Status: RESOLVED FIXED    
Severity: normal CC: rmoseley
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 3401    
Attachments: Screen shot

Description Len DiMaggio 2006-06-19 16:55:51 UTC
Observers persisted into Session file, but not displayed in GUI

In FryskGui as built from CVS head on 20060616 - perform the following steps to
recreate problem:

1) In FryskGui, create new session
2) Select a process to monitor (e.g., tcsh)
3) Select an observer to configure with process (e.g., Fork Observer)
4) Quit FryskGui
5) Verify that $HOME/.frysk/Sessions/yourNewSession file is correct:

----------------------------------
<Session type="frysk.gui.sessions.Session" name="csh" tooltip="NoTootip">
  <procs>
    <elements>
      <element type="frysk.gui.sessions.DebugProcess" name="tcsh" tooltip="tcsh"
executablePath="/bin/tcsh">
        <observers>
          <element name="Fork Observer" />
        </observers>
        <tagsets />
      </element>
    </elements>
  </procs>
</Session>
----------------------------------

6) Start up FryskGui again
7) Select and edit the newly created Session object
8) On the observers tab, note that no observers are selected (see attachment)
9) Select an Observer to configure with the Session (e.g., Fork Observer)
10) This exception results:

java.lang.NullPointerException
   at frysk.gui.druid.CreateFryskSessionDruid$7.cellRendererToggleEvent(FryskGui)
   at org.gnu.gtk.CellRendererToggle.fireCellRendererToggleEvent(libgtkjava-2.8.so)
   at org.gnu.gtk.CellRendererToggle.handleToggled(libgtkjava-2.8.so)
   at org.gnu.gtk.Gtk.gtk_main(libgtkjava-2.8.so)
   at org.gnu.gtk.Gtk.main(libgtkjava-2.8.so)
   at frysk.gui.Gui.gui(FryskGui)
   at frysk.gui.FryskGui.main(FryskGui)

11) But - the observer is configured - anytime after step 3 - the session does
execute the observer.
Comment 1 Len DiMaggio 2006-06-19 16:58:28 UTC
Created attachment 1102 [details]
Screen shot
Comment 2 Len DiMaggio 2006-06-19 17:02:45 UTC
Hang on - this is partially a user error and partially the Gui not protecting
the user from himself.

The problem displayed in the attached screen shot is that the user did not first
select a process before selecting an observer. That explains the
NullPointerException!
Comment 3 Phil Muldoon 2006-06-19 19:31:21 UTC
Thanks for the clarification. I think I just fixed the unselected tree situation
with Changelog indication below. Please retest and close if so. Thanks.

2006-06-19  Phil Muldoon  <pmuldoon@redhat.com>

	* ListView.java (add): (Plus add() overrides). Make sure that
	if add() is the first object in the tree, select it. Fixes bz 2802.
Comment 4 Phil Muldoon 2006-07-19 16:14:48 UTC
I've tested this today, and it seems to fulfill the bug requirements. The
Changelog patch seems to have resolved the issue. Closing - please reopen if
behaviour occurs again.
Comment 5 Andrew Cagney 2006-11-21 23:08:19 UTC
*** Bug 2811 has been marked as a duplicate of this bug. ***