From 6901f0b6526ec41fcfbe78aba012f3c5c3d553fd Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 25 Jul 2007 19:07:59 +0000 Subject: [PATCH] add file --- Robust/src/ClassLibrary/ObjectJavaNT.java | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Robust/src/ClassLibrary/ObjectJavaNT.java diff --git a/Robust/src/ClassLibrary/ObjectJavaNT.java b/Robust/src/ClassLibrary/ObjectJavaNT.java new file mode 100644 index 00000000..57b50465 --- /dev/null +++ b/Robust/src/ClassLibrary/ObjectJavaNT.java @@ -0,0 +1,28 @@ +public class Object { + public int cachedCode; + public boolean cachedHash; + + 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; + } +} -- 2.34.1