summaryrefslogtreecommitdiff
path: root/gnu/classpath/jdwp/id/StringId.java
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2005-08-20 19:10:20 +0000
committerKeith Seitz <keiths@redhat.com>2005-08-20 19:10:20 +0000
commitc57c525cf50b37d401a193f3f4af1e69774fa90c (patch)
treeb4aeaa3a0f25a00720a5b22f94219892779fc1bd /gnu/classpath/jdwp/id/StringId.java
parent30782c610357d719c14e6b719154f90c235de9e8 (diff)
downloadclasspath-c57c525cf50b37d401a193f3f4af1e69774fa90c.tar.gz
* gnu/classpath/jdwp/id/ClassLoaderId.java (getClassLoader): New method.
* gnu/classpath/jdwp/id/ClassObjectId.java (getClassObject): New method. * gnu/classpath/jdwp/id/JdwpId.java (getReference): New method. (setReference): New method. * gnu/classpath/jdwp/id/ObjectId.java (getObject): New method. * gnu/classpath/jdwp/id/ReferenceTypeId.java (getType): New method. * gnu/classpath/jdwp/id/StringId.java (getString): New method. * gnu/classpath/jdwp/id/ThreadGroupId.java (getThreadGroup): New method. * gnu/classpath/jdwp/id/ThreadId.java (getThread): New method. * gnu/classpath/jdwp/id/ObjectId.java (setId): New method. (disableCollection): New method. (enableCollection): New method. * gnu/classpath/jdwp/id/JdwpId.java (equals): Remove test for class equality. (setId): Make public.
Diffstat (limited to 'gnu/classpath/jdwp/id/StringId.java')
-rw-r--r--gnu/classpath/jdwp/id/StringId.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/gnu/classpath/jdwp/id/StringId.java b/gnu/classpath/jdwp/id/StringId.java
index ea1a83a56..1ba8f6d4d 100644
--- a/gnu/classpath/jdwp/id/StringId.java
+++ b/gnu/classpath/jdwp/id/StringId.java
@@ -40,6 +40,7 @@ exception statement from your version. */
package gnu.classpath.jdwp.id;
import gnu.classpath.jdwp.JdwpConstants;
+import gnu.classpath.jdwp.exception.InvalidStringException;
/**
* A class which represents a JDWP string id
@@ -61,4 +62,21 @@ public class StringId
{
super (JdwpConstants.Tag.STRING);
}
+
+ /**
+ * Gets the String represented by this ID
+ *
+ * @throws InvalidStringException if String is garbage collected,
+ * or otherwise invalid
+ */
+ public String getString ()
+ throws InvalidStringException
+ {
+ String string = (String) _reference.get ();
+
+ if (string == null)
+ throw new InvalidStringException (getId ());
+
+ return string;
+ }
}