All the code I've looked at ends up calling Proc.getTasks().getFirst() to pull out the main task. Might as well give clients want they want.
Index: frysk-core/frysk/proc/ChangeLog 2005-11-20 Andrew Cagney <cagney@redhat.com> * LinuxHost.java: Pass the forked process's only task to Task .performeForked. * TaskObserver.java: Change .Forked.updateForked fork parameter to a Task. * TaskState.java: Update. * Task.java: Update. Index: frysk-gui/frysk/gui/monitor/ChangeLog 2005-11-20 Andrew Cagney <cagney@redhat.com> * observers/TaskForkedObserver.java: Update, frysk.proc.TaskObserver .Forked .updateForked passes in the processes Task. * EventLogger.java: Ditto.
Resultant cleanup Index: frysk-core/frysk/proc/ChangeLog 2005-11-20 Andrew Cagney <cagney@redhat.com> * Task.java: Refactor single constructor into separate unattached, attached clone, and attached main constructors. * Proc.java: Re-organize constructor code. Delete sendNewAttachedTask. * LinuxTask.java: Ditto. * LinuxProc.java: Update. * LinuxHost.java: Update. Explicitly create an attached processes first task.