From: adam Date: Tue, 19 Oct 2004 07:49:19 +0000 (+0000) Subject: hacks ot make Hash serializable X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e1076a62356975f3b8c308146185fefd0e23fa2d;p=org.ibex.util.git hacks ot make Hash serializable darcs-hash:20041019074919-5007d-540daced6a4702f8b74976b20b0310bc201c33cd.gz --- diff --git a/src/org/ibex/util/Hash.java b/src/org/ibex/util/Hash.java index 4b38870..6952e82 100644 --- a/src/org/ibex/util/Hash.java +++ b/src/org/ibex/util/Hash.java @@ -16,13 +16,14 @@ import java.util.*; * * Not threadsafe. */ -public class Hash { +public class Hash implements java.io.Serializable { /** this object is inserted as key in a slot when the * corresponding value is removed -- this ensures that the * probing sequence for any given key remains the same even if * other keys are removed. */ - private static Object placeholder = new Object(); + // FIXME: this should have been static except that that makes it nonserializable + private Object placeholder = new java.io.Serializable() { }; /** the number of entries with at least one non-null key */ private int usedslots = 0; diff --git a/src/org/ibex/util/Vec.java b/src/org/ibex/util/Vec.java index d3fe00e..6d1fbd5 100644 --- a/src/org/ibex/util/Vec.java +++ b/src/org/ibex/util/Vec.java @@ -71,7 +71,7 @@ public final class Vec implements Serializable { public void push(Object o) { addElement(o); } public Object pop() { Object ret = lastElement(); - if (size > 0) store[size--] = null; + if (size > 0) store[--size] = null; return ret; }