File tree Expand file tree Collapse file tree
lib/src/main/java/com/diffplug/spotless Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,6 +174,20 @@ synchronized Sig sign(File fileInput) throws IOException {
174174 }
175175 }
176176
177+ @ Override
178+ public boolean equals (Object other ) {
179+ if (other instanceof FileSignature ) {
180+ return Arrays .equals (signatures , ((FileSignature ) other ).signatures );
181+ } else {
182+ return false ;
183+ }
184+ }
185+
186+ @ Override
187+ public int hashCode () {
188+ return Arrays .hashCode (signatures );
189+ }
190+
177191 @ SuppressFBWarnings ("SE_TRANSIENT_FIELD_NOT_RESTORED" )
178192 private static final class Sig implements Serializable {
179193 private static final long serialVersionUID = 6727302747168655222L ;
@@ -193,6 +207,21 @@ private static final class Sig implements Serializable {
193207 this .hash = hash ;
194208 this .lastModified = lastModified ;
195209 }
210+
211+ @ Override
212+ public boolean equals (Object other ) {
213+ if (other instanceof Sig ) {
214+ Sig o = (Sig ) other ;
215+ return name .equals (o .name ) && size == o .size && Arrays .equals (hash , o .hash );
216+ } else {
217+ return false ;
218+ }
219+ }
220+
221+ @ Override
222+ public int hashCode () {
223+ return Arrays .hashCode (hash ) | name .hashCode ();
224+ }
196225 }
197226
198227 /** Asserts that child is a subpath of root. and returns the subpath. */
You can’t perform that action at this time.
0 commit comments