From 5635ffd0b9a9d71f1689659b4b9589f76756f4a2 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 9 Apr 1999 08:02:15 +0000 Subject: [PATCH] hashCode git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@529 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/bytecode/Reference.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/jode/jode/bytecode/Reference.java b/jode/jode/bytecode/Reference.java index 7b888a8..b727a74 100644 --- a/jode/jode/bytecode/Reference.java +++ b/jode/jode/bytecode/Reference.java @@ -42,11 +42,17 @@ public class Reference { * The member type. */ String memberType; + /** + * The cached hash code + */ + int cachedHashCode; public Reference(String className, String name, String type) { - this.className = className; - this.memberName = name; - this.memberType = type; + this.className = className.intern(); + this.memberName = name.intern(); + this.memberType = type.intern(); + cachedHashCode = + className.hashCode() ^ name.hashCode() ^ type.hashCode(); } public String getClazz() { @@ -86,4 +92,8 @@ public class Reference { } return false; } + + public int hashCode() { + return cachedHashCode; + } }