From: bdemsky Date: Fri, 10 Aug 2007 07:59:50 +0000 (+0000) Subject: DSM code X-Git-Tag: preEdgeChange~485 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=91e668de647159ef8061095adc0546905af81ad7;p=IRC.git DSM code --- diff --git a/Robust/src/ClassLibrary/ObjectJavaDSM.java b/Robust/src/ClassLibrary/ObjectJavaDSM.java new file mode 100644 index 00000000..ff66f176 --- /dev/null +++ b/Robust/src/ClassLibrary/ObjectJavaDSM.java @@ -0,0 +1,30 @@ +public class Object { + public int cachedCode; //first field has to be a primitive + public boolean cachedHash; + public Object nextobject; /* Oid */ + public Object localcopy; + + public native int nativehashCode(); + + public int hashCode() { + if (!cachedHash) { + cachedCode=nativehashCode(); + cachedHash=true; + } + return cachedCode; + } + + /* DON'T USE THIS METHOD UNLESS NECESSARY */ + /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */ + public native int getType(); + + public String toString() { + return String.valueOf(this); + } + + public boolean equals(Object o) { + if (o==this) + return true; + return false; + } +}