Skip to content

Commit 741dc37

Browse files
committed
Nit fix
1 parent 460c908 commit 741dc37

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core-api/src/main/java/com/optimizely/ab/config/audience/match/SemanticVersion.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public String toString() {
108108
return ret.toString();
109109
}
110110

111+
@Override
112+
public int hashCode() {
113+
return toString().hashCode();
114+
}
115+
111116
@Override
112117
public boolean equals(Object other) {
113118
if (this == other) {
@@ -117,7 +122,9 @@ public boolean equals(Object other) {
117122
return false;
118123
}
119124
SemanticVersion ov = (SemanticVersion) other;
120-
if (ov.major != major || ov.minor != minor || ov.patch != patch) {
125+
if (!ov.major.equals(major) ||
126+
!ov.minor.equals(minor) ||
127+
!ov.patch.equals(patch)) {
121128
return false;
122129
}
123130
if (ov.preRelease.length != preRelease.length) {

0 commit comments

Comments
 (0)