Skip to content

Commit

Permalink
Call CallBooleanMethod instead of CallIntMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Apr 25, 2022
1 parent 7959d6f commit 2d084e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/c/jpy_jobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ int JObj_Equals(JNIEnv* jenv, JPy_JObj* obj1, JPy_JObj* obj2)
ref1 = obj1->objectRef;
ref2 = obj2->objectRef;

if ((*jenv)->IsSameObject(jenv, ref1, ref2)) {
if ((*jenv)->IsSameObject(jenv, ref1, ref2) || (*jenv)->CallBooleanMethod(jenv, ref1, JPy_Object_Equals_MID, ref2)) {
returnValue = 1;
} else {
returnValue = (*jenv)->CallIntMethod(jenv, ref1, JPy_Object_Equals_MID, ref2);
returnValue = 0;
}
(*jenv)->ExceptionClear(jenv); // we can't deal with exceptions here, so clear any
return returnValue;
Expand Down

0 comments on commit 2d084e7

Please sign in to comment.