File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
test/com/esotericsoftware/kryo/serializers Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -436,17 +436,29 @@ public boolean equals (Object obj) {
436436 if (obj == null ) return false ;
437437 if (getClass () != obj .getClass ()) return false ;
438438 ClassWithMap other = (ClassWithMap )obj ;
439- if (values == null ) {
440- if (other .values != null ) return false ;
441- } else if (!values .toString ().equals (other .values .toString ())) return false ;
442- return true ;
439+ return Objects .equals (values , other .values );
440+ }
441+
442+ @ Override
443+ public int hashCode () {
444+ return Objects .hash (values );
443445 }
444446
445447 public static class MapKey {
446448 public String field1 , field2 ;
447449
448- public String toString () {
449- return field1 + ":" + field2 ;
450+ @ Override
451+ public boolean equals (Object obj ) {
452+ if (this == obj ) return true ;
453+ if (!(obj instanceof MapKey )) return false ;
454+ MapKey other = (MapKey ) obj ;
455+ return Objects .equals (field1 , other .field1 ) &&
456+ Objects .equals (field2 , other .field2 );
457+ }
458+
459+ @ Override
460+ public int hashCode () {
461+ return Objects .hash (field1 , field2 );
450462 }
451463 }
452464 }
You can’t perform that action at this time.
0 commit comments