ctubbsii commented on code in PR #77:
URL:
https://github.com/apache/accumulo-classloaders/pull/77#discussion_r2835910748
##########
modules/caching-classloader/src/main/java/org/apache/accumulo/classloader/ccl/manifest/Manifest.java:
##########
@@ -121,23 +120,15 @@ public Set<Resource> getResources() {
@Override
public int hashCode() {
- return hash(monitorIntervalSeconds, resources);
+ return toJson().hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- Manifest other = (Manifest) obj;
- return monitorIntervalSeconds == other.monitorIntervalSeconds
- && Objects.equals(resources, other.resources);
+ return obj instanceof Manifest ? Objects.equals(toJson(), ((Manifest)
obj).toJson()) : false;
Review Comment:
Yeah I thought about simplifying this but I liked the way it looks, so I
didn't bother to change it. I don't feel strongly either way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]