Skip to content

Commit

Permalink
Fixed #204
Browse files Browse the repository at this point in the history
  • Loading branch information
hypfvieh committed Jan 11, 2023
1 parent 3b27362 commit 6d1d97e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions dbus-java-core/src/main/java/org/freedesktop/dbus/MethodTuple.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.freedesktop.dbus;

import java.util.Objects;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -20,13 +22,20 @@ public MethodTuple(String _name, String _sig) {
}

@Override
public boolean equals(Object _o) {
return _o.getClass().equals(MethodTuple.class) && ((MethodTuple) _o).name.equals(this.name) && ((MethodTuple) _o).sig.equals(this.sig);
public int hashCode() {
return Objects.hash(name, sig);
}

@Override
public int hashCode() {
return name.hashCode() + sig.hashCode();
public boolean equals(Object _obj) {
if (this == _obj) {
return true;
}
if (!(_obj instanceof MethodTuple)) {
return false;
}
MethodTuple other = (MethodTuple) _obj;
return Objects.equals(name, other.name) && Objects.equals(sig, other.sig);
}

public Logger getLogger() {
Expand Down

0 comments on commit 6d1d97e

Please sign in to comment.