32
32
import java .util .HashMap ;
33
33
import java .util .List ;
34
34
import java .util .Map ;
35
+ import java .util .Objects ;
35
36
import java .util .ServiceLoader ;
36
37
import java .util .function .Function ;
37
38
import java .util .function .IntFunction ;
@@ -256,12 +257,12 @@ public boolean supports(TransportVersion version) {
256
257
if (onOrAfter (version )) {
257
258
return true ;
258
259
}
259
- TransportVersion patchVersion = this .nextPatchVersion ;
260
- while (patchVersion != null ) {
260
+ TransportVersion nextPatchVersion = version .nextPatchVersion ;
261
+ while (nextPatchVersion != null ) {
261
262
if (isPatchFrom (version )) {
262
263
return true ;
263
264
}
264
- patchVersion = patchVersion .nextPatchVersion ;
265
+ nextPatchVersion = nextPatchVersion .nextPatchVersion ;
265
266
}
266
267
return false ;
267
268
}
@@ -274,9 +275,21 @@ public String toReleaseVersion() {
274
275
return VersionsHolder .VERSION_LOOKUP_BY_RELEASE .apply (id );
275
276
}
276
277
278
+ @ Override
279
+ public boolean equals (Object o ) {
280
+ if (o == null || getClass () != o .getClass ()) return false ;
281
+ TransportVersion that = (TransportVersion ) o ;
282
+ return id == that .id ;
283
+ }
284
+
285
+ @ Override
286
+ public int hashCode () {
287
+ return id ;
288
+ }
289
+
277
290
@ Override
278
291
public String toString () {
279
- return "TransportVersion{ " + "name='" + name + '\'' + ", id=" + id + ", patchVersion=" + nextPatchVersion + '}' ;
292
+ return "" + id ;
280
293
}
281
294
282
295
private static class VersionsHolder {
0 commit comments