/** * {@inheritDoc} */ public int hashCode() { // TODO: probably better using commons-lang HashCodeBuilder int hashCode = 1; hashCode = hashCode * HASH_PRIME + getArtifact().hashCode(); // DefaultArtifact.hashCode does not consider scope hashCode = hashCode * HASH_PRIME + nullHashCode( getArtifact().getScope() ); // TODO: use parent's artifact to prevent recursion - how can we improve this? hashCode = hashCode * HASH_PRIME + nullHashCode( nullGetArtifact( getParent() ) ); hashCode = hashCode * HASH_PRIME + getChildren().hashCode(); hashCode = hashCode * HASH_PRIME + getState(); hashCode = hashCode * HASH_PRIME + nullHashCode( getRelatedArtifact() ); hashCode = hashCode * HASH_PRIME + nullHashCode( getPremanagedVersion() ); hashCode = hashCode * HASH_PRIME + nullHashCode( getPremanagedScope() ); hashCode = hashCode * HASH_PRIME + nullHashCode( getOriginalScope() ); hashCode = hashCode * HASH_PRIME + nullHashCode( getFailedUpdateScope() ); hashCode = hashCode * HASH_PRIME + nullHashCode( getVersionSelectedFromRange() ); hashCode = hashCode * HASH_PRIME + nullHashCode( getAvailableVersions() ); return hashCode; }