JiriProjects.Project: Implement hashCode method
Since the class implements the equals method, it should also
implement the hashCode method.
Change-Id: I5ca90ab517f3b3ce2bb425bb019a7ae1a023a336
diff --git a/java/com/googlesource/gerrit/plugins/supermanifest/JiriProjects.java b/java/com/googlesource/gerrit/plugins/supermanifest/JiriProjects.java
index 31913b2..a7eb3a5 100644
--- a/java/com/googlesource/gerrit/plugins/supermanifest/JiriProjects.java
+++ b/java/com/googlesource/gerrit/plugins/supermanifest/JiriProjects.java
@@ -16,6 +16,7 @@
import java.util.Arrays;
import java.util.Comparator;
+import java.util.Objects;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import org.apache.commons.lang.StringUtils;
@@ -151,6 +152,11 @@
return true;
}
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, path, remote, remotebranch, revision);
+ }
+
public String toSubmodules() {
StringBuffer buf = new StringBuffer(String.format("[submodule \"%s\"]", name));
buf.append("\n\tpath = " + path);