ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Collection/IteratorMicroBenchmark.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Collection/IteratorMicroBenchmark.java (file contents):
Revision 1.44 by jsr166, Wed May 9 17:43:01 2018 UTC vs.
Revision 1.45 by jsr166, Fri May 11 18:19:10 2018 UTC

# Line 34 | Line 34 | import static java.util.stream.Collector
34   import java.lang.ref.ReferenceQueue;
35   import java.lang.ref.WeakReference;
36   import java.util.ArrayDeque;
37 + import java.util.Arrays;
38   import java.util.ArrayList;
39   import java.util.Collection;
40   import java.util.Collections;
# Line 562 | Line 563 | public class IteratorMicroBenchmark {
563                      for (int i = 0; i < iterations; i++) {
564                          sum[0] = 0;
565                          x.replaceAll(sneakyAdder);
566 <                        check.sum(sum[0]);}}});
566 >                        check.sum(sum[0]);}}},
567 >            new Job(klazz + " hashCode") {
568 >                public void work() throws Throwable {
569 >                    int hashCode = Arrays.hashCode(x.toArray());
570 >                    for (int i = 0; i < iterations; i++) {
571 >                        if (x.hashCode() != hashCode)
572 >                            throw new AssertionError();}}});
573      }
574   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines