This change breaks several unit tests, as they didn't expect the user metadata 
to be taken into account (see the recent jclouds builds).
I'm not sure if adding the metadata here is good or not. In several other 
places we are only taking into account the id (see the 
[ComputeMetadata](https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/domain/internal/ComputeMetadataImpl.java))
 and ignoring information such as tags, etc.

I understand the pattern of having every field in the equals/hashCode for 
consistency (but in that case we could just drop all equals/hashCode and just 
use the default Object's implementation). Since we are overriding them to 
provide some "higher level meaning", I think we should ask ourselves if the 
"userMetadata" field is relevant enough to be decisive when testing if two 
objects (Image, Node, etc) are the same.

IMHO I'd say no and I'd rather keep the metadata out of the formula. Also take 
into account that this will break user's code (I know it would be a major 
version change so it's good) in a difficult to troubleshoot way. Changing how 
equals and hashCode behave will affect collections of these objects they might 
be already using.

We have the two options: revert the metadata change, or fix the tests Thoughts?
/cc @demobox 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/commit/a3376d4efe86fafc38b631d3b741444f3df50493#commitcomment-15671741

Reply via email to