Remove userMetadata from equals and hashCode

This caused test failures, regression from
a3376d4efe.
This commit is contained in:
Andrew Gaul 2016-01-26 14:08:39 -08:00
parent 68ff250c38
commit 3872b57483
2 changed files with 8 additions and 6 deletions

View File

@ -175,7 +175,8 @@ public class MutableResourceMetadataImpl<T extends Enum<T>> implements MutableRe
@Override
public int hashCode() {
return Objects.hashCode(id, location, name, type, uri, userMetadata);
// intentionally not hashing userMetadata
return Objects.hashCode(id, location, name, type, uri);
}
@Override
@ -191,8 +192,8 @@ public class MutableResourceMetadataImpl<T extends Enum<T>> implements MutableRe
&& Objects.equal(location, other.getLocation())
&& Objects.equal(name, other.getName())
&& Objects.equal(type, other.getType())
&& Objects.equal(uri, other.getUri())
&& Objects.equal(userMetadata, other.getUserMetadata());
&& Objects.equal(uri, other.getUri());
// intentionally not comparing userMetadata
}
}

View File

@ -114,13 +114,14 @@ public abstract class ResourceMetadataImpl<T extends Enum<T>> implements Resourc
return false;
ResourceMetadataImpl<?> that = ResourceMetadataImpl.class.cast(o);
return equal(this.getType(), that.getType()) && equal(this.providerId, that.providerId)
&& equal(this.name, that.name) && equal(this.location, that.location) && equal(this.uri, that.uri)
&& equal(this.userMetadata, that.userMetadata);
&& equal(this.name, that.name) && equal(this.location, that.location) && equal(this.uri, that.uri);
// intentionally not comparing userMetadata
}
@Override
public int hashCode() {
return Objects.hashCode(getType(), providerId, name, location, uri, userMetadata);
return Objects.hashCode(getType(), providerId, name, location, uri);
// intentionally not hashing userMetadata
}
@Override