Added some todos.
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
index 83fe92a..2d42f58 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
@@ -41,7 +41,7 @@
}
private static HostId max(HostId one, HostId two) {
- return one.hashCode() > two.hashCode() ? one : two;
+ return one.hashCode() >= two.hashCode() ? one : two;
}
/**
diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java b/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java
index f23a448..4c11f57 100644
--- a/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java
+++ b/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java
@@ -37,8 +37,8 @@
*/
protected Intent(IntentId id, ApplicationId appId,
Collection<NetworkResource> resources) {
+ this.id = checkNotNull(id, "Intent ID cannot be null");
this.appId = checkNotNull(appId, "Application ID cannot be null");
- this.id = checkNotNull(id, "Fingerprint cannot be null");
this.resources = resources;
}
@@ -77,6 +77,7 @@
* @return intent identifier
*/
protected static IntentId id(Object... fields) {
+ // FIXME: spread the bits across the full long spectrum
return IntentId.valueOf(Objects.hash(fields));
}
@@ -90,12 +91,12 @@
}
@Override
- public int hashCode() {
+ public final int hashCode() {
return Objects.hash(id);
}
@Override
- public boolean equals(Object obj) {
+ public final boolean equals(Object obj) {
if (this == obj) {
return true;
}