File tree 1 file changed +29
-0
lines changed
lib/src/main/java/com/diffplug/spotless
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,20 @@ synchronized Sig sign(File fileInput) throws IOException {
174
174
}
175
175
}
176
176
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
+
177
191
@ SuppressFBWarnings ("SE_TRANSIENT_FIELD_NOT_RESTORED" )
178
192
private static final class Sig implements Serializable {
179
193
private static final long serialVersionUID = 6727302747168655222L ;
@@ -193,6 +207,21 @@ private static final class Sig implements Serializable {
193
207
this .hash = hash ;
194
208
this .lastModified = lastModified ;
195
209
}
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
+ }
196
225
}
197
226
198
227
/** Asserts that child is a subpath of root. and returns the subpath. */
You can’t perform that action at this time.
0 commit comments