Issue 79 in gmock: Default behaviors for hashCode() and equals() on the Java side in record stage

2 views
Skip to first unread message

codesite...@google.com

unread,
Mar 31, 2009, 3:02:16 AM3/31/09
to gmoc...@googlegroups.com
Status: New
Owner: JohnnyJianHY
CC: julien.gagnet
Labels: Type-Defect Priority-Medium Milestone-0.8

New issue 79 by JohnnyJianHY: Default behaviors for hashCode() and equals()
on the Java side in record stage
http://code.google.com/p/gmock/issues/detail?id=79

I was facing a problem when I was working on the collaborator sample. When
I called "classUnderTest.addListener(mock)" in the setup() method, it threw
an ClassCastException. I looked into the code of ClassUnderTest, and found:

public void addListener(Collaborator listener) {
listeners.add(listener);
}

here listeners is a HashMap, and mock.hashCode() returned a MethodRecorder
instead of an integer, so it failed.

I think we should do the same thing for hashCode() and equals() as
toString() in JavaMethodInterceptor.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply all
Reply to author
Forward
0 new messages