Change applicationId's equality checking and hashing method
Application id in applicationId class is transient.
So it would be better to use application name to check equality.
Change-Id: I5f6807054e9a882316ff0a88242cb752eb78bcb9
diff --git a/core/api/src/main/java/org/onosproject/core/DefaultApplicationId.java b/core/api/src/main/java/org/onosproject/core/DefaultApplicationId.java
index aedfb0d..521e23f 100644
--- a/core/api/src/main/java/org/onosproject/core/DefaultApplicationId.java
+++ b/core/api/src/main/java/org/onosproject/core/DefaultApplicationId.java
@@ -58,7 +58,7 @@
@Override
public int hashCode() {
- return Short.hashCode(id);
+ return Objects.hash(name);
}
@Override
@@ -68,7 +68,7 @@
}
if (obj instanceof DefaultApplicationId) {
DefaultApplicationId other = (DefaultApplicationId) obj;
- return Objects.equals(this.id, other.id);
+ return Objects.equals(this.name, other.name);
}
return false;
}