@@ -211,6 +211,32 @@ public String toString() {
211
211
return String .format ("[items=%s, skips=%s]" , items , skips );
212
212
}
213
213
214
+ @ Override
215
+ public boolean equals (Object obj ) {
216
+ if (obj == this ) {
217
+ return true ;
218
+ }
219
+ if (!(obj instanceof Chunk )) {
220
+ return false ;
221
+ }
222
+ Chunk <?> other = (Chunk <?>) obj ;
223
+ return Objects .equals (this .items , other .items ) && Objects .equals (this .skips , other .skips )
224
+ && Objects .equals (this .errors , other .errors ) && Objects .equals (this .userData , other .userData )
225
+ && this .end == other .end && this .busy == other .busy ;
226
+ }
227
+
228
+ @ Override
229
+ public int hashCode () {
230
+ int result = 17 ;
231
+ result = 31 * result + items .hashCode ();
232
+ result = 31 * result + skips .hashCode ();
233
+ result = 31 * result + errors .hashCode ();
234
+ result = 31 * result + Objects .hashCode (userData );
235
+ result = 31 * result + (end ? 1 : 0 );
236
+ result = 31 * result + (busy ? 1 : 0 );
237
+ return result ;
238
+ }
239
+
214
240
/**
215
241
* Special iterator for a chunk providing the {@link #remove(Throwable)} method for
216
242
* dynamically removing an item and adding it to the skips.
@@ -262,25 +288,6 @@ public String toString() {
262
288
return String .format ("[items=%s, skips=%s]" , items , skips );
263
289
}
264
290
265
- @ Override
266
- public int hashCode () {
267
- return Objects .hash (items , skips , errors , userData , end , busy );
268
- }
269
-
270
- @ Override
271
- public boolean equals (Object obj ) {
272
- if (this == obj ) {
273
- return true ;
274
- }
275
- if (!(obj instanceof Chunk )) {
276
- return false ;
277
- }
278
- Chunk <?> other = (Chunk <?>) obj ;
279
- return Objects .equals (items , other .items ) && Objects .equals (skips , other .skips )
280
- && Objects .equals (errors , other .errors ) && Objects .equals (userData , other .userData )
281
- && end == other .end && busy == other .busy ;
282
- }
283
-
284
291
}
285
292
286
293
}
0 commit comments