3232import java .util .HashMap ;
3333import java .util .List ;
3434import java .util .Map ;
35+ import java .util .Objects ;
3536import java .util .ServiceLoader ;
3637import java .util .function .Function ;
3738import java .util .function .IntFunction ;
@@ -256,12 +257,12 @@ public boolean supports(TransportVersion version) {
256257 if (onOrAfter (version )) {
257258 return true ;
258259 }
259- TransportVersion patchVersion = this .nextPatchVersion ;
260- while (patchVersion != null ) {
260+ TransportVersion nextPatchVersion = version .nextPatchVersion ;
261+ while (nextPatchVersion != null ) {
261262 if (isPatchFrom (version )) {
262263 return true ;
263264 }
264- patchVersion = patchVersion .nextPatchVersion ;
265+ nextPatchVersion = nextPatchVersion .nextPatchVersion ;
265266 }
266267 return false ;
267268 }
@@ -274,9 +275,21 @@ public String toReleaseVersion() {
274275 return VersionsHolder .VERSION_LOOKUP_BY_RELEASE .apply (id );
275276 }
276277
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+
277290 @ Override
278291 public String toString () {
279- return "TransportVersion{ " + "name='" + name + '\'' + ", id=" + id + ", patchVersion=" + nextPatchVersion + '}' ;
292+ return "" + id ;
280293 }
281294
282295 private static class VersionsHolder {
0 commit comments