From 7c38e36b3385a6de0bf2ee7c2023efdb2b29840d Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 29 Sep 2013 11:59:06 +0400 Subject: [PATCH] [log] Fix graph tests: implement SimpleHash#equals --- .../intellij/vcs/log/parser/SimpleHash.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/platform/vcs-log/graph/test/com/intellij/vcs/log/parser/SimpleHash.java b/platform/vcs-log/graph/test/com/intellij/vcs/log/parser/SimpleHash.java index 92ad9e7a67f1..ae88b28be21e 100644 --- a/platform/vcs-log/graph/test/com/intellij/vcs/log/parser/SimpleHash.java +++ b/platform/vcs-log/graph/test/com/intellij/vcs/log/parser/SimpleHash.java @@ -40,4 +40,22 @@ class SimpleHash implements Hash { public String toShortString() { return myHash.substring(0, 7); } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + SimpleHash that = (SimpleHash)o; + + if (myHash != null ? !myHash.equals(that.myHash) : that.myHash != null) return false; + + return true; + } + + @Override + public int hashCode() { + return myHash != null ? myHash.hashCode() : 0; + } + }