I think it is a pretty bad idea to have hashCode depend on things that can be changed later on. This will invalidate the hash code. A hash code should never change during the lifetime of an object.