diff options
author | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-25 19:46:45 +0000 |
---|---|---|
committer | kgallowa <kgallowa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-25 19:46:45 +0000 |
commit | d9d4638365948713497fa256eda3314d81281057 (patch) | |
tree | ffe85bebe1030d3b4308652145f6fee26447e801 /libjava | |
parent | 01b54db5219a8bbc07e472fbed5d9d3ba819b235 (diff) | |
download | gcc-d9d4638365948713497fa256eda3314d81281057.tar.gz |
2007-04-25 Kyle Galloway <kgallowa@redhat.com>
* gnu/classpath/jdwp/VMIdManager.java (getObjectId): Deal with null
objects.
(get): Deal with ObjectId of 0.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124164 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/gnu/classpath/jdwp/VMIdManager.java | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 6c0fd9ecc37..f012fe7808a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2007-04-25 Kyle Galloway <kgallowa@redhat.com> + + * gnu/classpath/jdwp/VMIdManager.java (getObjectId): Deal with null + objects. + (get): Deal with ObjectId of 0. + 2007-04-24 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> PR libgcj/31084 diff --git a/libjava/gnu/classpath/jdwp/VMIdManager.java b/libjava/gnu/classpath/jdwp/VMIdManager.java index 8d423e9b0d6..f787a8cdc7f 100644 --- a/libjava/gnu/classpath/jdwp/VMIdManager.java +++ b/libjava/gnu/classpath/jdwp/VMIdManager.java @@ -1,7 +1,7 @@ /* VMIdManager.java -- A reference/example implementation of a manager for JDWP object/reference type IDs - Copyright (C) 2005, 2006 Free Software Foundation + Copyright (C) 2005, 2006, 2007 Free Software Foundation This file is part of GNU Classpath. @@ -337,6 +337,10 @@ public class VMIdManager */ public ObjectId getObjectId (Object theObject) { + // Special case: null object. + if (theObject == null) + return new NullObjectId (); + ReferenceKey ref = new ReferenceKey (theObject, _refQueue); ObjectId id = (ObjectId) _oidTable.get (ref); if (id == null) @@ -364,6 +368,10 @@ public class VMIdManager public ObjectId get (long id) throws InvalidObjectException { + // Special case: null object id. + if (id == 0) + return new NullObjectId (); + ObjectId oid = (ObjectId) _idTable.get (new Long (id)); if (oid == null) throw new InvalidObjectException (id); |