From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22507 invoked by alias); 27 Feb 2008 21:19:47 -0000 Received: (qmail 22477 invoked by uid 367); 27 Feb 2008 21:19:45 -0000 Date: Wed, 27 Feb 2008 21:19:00 -0000 Message-ID: <20080227211945.22462.qmail@sourceware.org> From: cagney@sourceware.org To: frysk-cvs@sourceware.org Subject: [SCM] master: Fold Id into TaskId. X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: f0bc57dd50f9c00eddfc9b054fd9e5f2e717de36 X-Git-Newrev: 85b7a239f83c060989244bb0d234db0afe059a05 Mailing-List: contact frysk-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-cvs-owner@sourceware.org Reply-To: frysk@sourceware.org X-SW-Source: 2008-q1/txt/msg00270.txt.bz2 The branch, master has been updated via 85b7a239f83c060989244bb0d234db0afe059a05 (commit) from f0bc57dd50f9c00eddfc9b054fd9e5f2e717de36 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 85b7a239f83c060989244bb0d234db0afe059a05 Author: Andrew Cagney Date: Wed Feb 27 16:18:40 2008 -0500 Fold Id into TaskId. frysk-core/frysk/proc/ChangeLog 2008-02-27 Andrew Cagney * Id.java: Delete. * TaskId.java: Update. ----------------------------------------------------------------------- Summary of changes: frysk-core/frysk/proc/ChangeLog | 3 + frysk-core/frysk/proc/Id.java | 111 ------------------------------------- frysk-core/frysk/proc/TaskId.java | 62 ++++++++++++++------- 3 files changed, 44 insertions(+), 132 deletions(-) delete mode 100644 frysk-core/frysk/proc/Id.java First 500 lines of diff: diff --git a/frysk-core/frysk/proc/ChangeLog b/frysk-core/frysk/proc/ChangeLog index 863fd83..6ee5f3e 100644 --- a/frysk-core/frysk/proc/ChangeLog +++ b/frysk-core/frysk/proc/ChangeLog @@ -1,5 +1,8 @@ 2008-02-27 Andrew Cagney + * Id.java: Delete. + * TaskId.java: Update. + * ProcEvent.java (getProcFromTaskId()): Delete. * Host.java (get(TaskId)): Delete. * Proc.java (getMainTask()): Use taskPool, not Host. diff --git a/frysk-core/frysk/proc/Id.java b/frysk-core/frysk/proc/Id.java deleted file mode 100644 index f96ec9b..0000000 --- a/frysk-core/frysk/proc/Id.java +++ /dev/null @@ -1,111 +0,0 @@ -// This file is part of the program FRYSK. -// -// Copyright 2005, 2006, 2007, Red Hat Inc. -// -// FRYSK is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// FRYSK is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with FRYSK; if not, write to the Free Software Foundation, -// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. -// -// In addition, as a special exception, Red Hat, Inc. gives You the -// additional right to link the code of FRYSK with code not covered -// under the GNU General Public License ("Non-GPL Code") and to -// distribute linked combinations including the two, subject to the -// limitations in this paragraph. Non-GPL Code permitted under this -// exception must only link to the code of FRYSK through those well -// defined interfaces identified in the file named EXCEPTION found in -// the source code files (the "Approved Interfaces"). The files of -// Non-GPL Code may instantiate templates or use macros or inline -// functions from the Approved Interfaces without causing the -// resulting work to be covered by the GNU General Public -// License. Only Red Hat, Inc. may make changes or additions to the -// list of Approved Interfaces. You must obey the GNU General Public -// License in all respects for all of the FRYSK code and other code -// used in conjunction with FRYSK except the Non-GPL Code covered by -// this exception. If you modify this file, you may extend this -// exception to your version of the file, but you are not obligated to -// do so. If you do not wish to provide this exception without -// modification, you must delete this exception statement from your -// version and license this file solely under the GPL without -// exception. - -package frysk.proc; - -/** - * Light weight identifier. - * - * This implements comparable so can be used for searching and the - * like. Anything wanting to search for a task should use this. - */ - -class Id - implements Comparable -{ - /** - * XXX: Should not be public, but some code likes to poke it so - * that it has a re-usable ID. - */ - public int id; - protected Id () - { - id = -1; - } - protected Id (int id) - { - this.id = id; - } - /** - * From the point of view of IDs, is THIS class and the Object - * compatible? - * - * For the object hierarchy Task extends TaskId extends Id, Task - * and TaskId are considered compatible. - */ - protected boolean isCompatible (Object o) - { - return (o instanceof Id); - } - /** - * Is the object equals to this one. - */ - public boolean equals (Object o) - { - if (isCompatible (o)) - return ((Id)o).id == id; - else - return false; - } - /** - * Return the hash code for this ID (hash on the underlying ID - * value). - */ - public int hashCode () - { - return id; - } - /** - * Assuming that the two objects are the same, do a relative - * comparison. - */ - public int compareTo (Object o) - { - Id rhs = (Id)o; - // Should this be calling isCompatible? - return rhs.id - this.id; - } - /** - * Return a string representation of the object. - */ - public String toString () - { - return "" + id; - } -} diff --git a/frysk-core/frysk/proc/TaskId.java b/frysk-core/frysk/proc/TaskId.java index f347111..ac33b30 100644 --- a/frysk-core/frysk/proc/TaskId.java +++ b/frysk-core/frysk/proc/TaskId.java @@ -1,6 +1,6 @@ // This file is part of the program FRYSK. // -// Copyright 2005, 2006, 2007, Red Hat Inc. +// Copyright 2005, 2006, 2007, 2008, Red Hat Inc. // // FRYSK is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by @@ -45,33 +45,53 @@ package frysk.proc; * This implements comparable so can be used for searching and the * like. Anything wanting to search for a task should use this. */ - -public class TaskId - extends Id -{ - public TaskId () - { - super (); +class TaskId implements Comparable { + /** + * XXX: Should not be public, but some code likes to poke it so + * that it has a re-usable ID. + */ + public int id; + TaskId() { + id = -1; } - public TaskId (int id) - { - super (id); + TaskId(int id) { + this.id = id; } - public String toString () - { - return ("{TaskId," + super.toString () + "}"); + /** + * Is the object equals to this one. + */ + public boolean equals(Object o) { + if (o instanceof TaskId) + return ((TaskId)o).id == id; + else + return false; } - protected boolean isCompatible (Object o) - { - return (o instanceof TaskId); + /** + * Return the hash code for this ID (hash on the underlying ID + * value). + */ + public int hashCode() { + return id; + } + /** + * Assuming that the two objects are the same, do a relative + * comparison. + */ + public int compareTo(Object o) { + TaskId rhs = (TaskId)o; + return rhs.id - this.id; + } + /** + * Return a string representation of the object. + */ + public String toString() { + return ("{TaskId," + super.toString () + "}"); } - /** * Get the TID for this TaskID. * @return the TID */ - public int intValue() - { - return id; // field in superclass + public int intValue() { + return id; // field in superclass } } hooks/post-receive -- frysk system monitor/debugger