ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.62 by jsr166, Mon Oct 11 05:40:41 2010 UTC vs.
Revision 1.94 by jsr166, Mon Jan 21 19:32:19 2013 UTC

# Line 1 | Line 1
1   /*
2   * Written by Doug Lea with assistance from members of JCP JSR-166
3   * Expert Group and released to the public domain, as explained at
4 < * http://creativecommons.org/licenses/publicdomain
4 > * http://creativecommons.org/publicdomain/zero/1.0/
5   * Other contributors include Andrew Wright, Jeffrey Hayes,
6   * Pat Fisher, Mike Judd.
7   */
8  
9   import junit.framework.*;
10 + import java.io.ByteArrayInputStream;
11 + import java.io.ByteArrayOutputStream;
12 + import java.io.ObjectInputStream;
13 + import java.io.ObjectOutputStream;
14 + import java.util.ArrayList;
15 + import java.util.Arrays;
16 + import java.util.Date;
17 + import java.util.Enumeration;
18 + import java.util.List;
19 + import java.util.NoSuchElementException;
20   import java.util.PropertyPermission;
21   import java.util.concurrent.*;
22 + import java.util.concurrent.atomic.AtomicBoolean;
23   import java.util.concurrent.atomic.AtomicReference;
24   import static java.util.concurrent.TimeUnit.MILLISECONDS;
25 + import static java.util.concurrent.TimeUnit.NANOSECONDS;
26   import java.security.CodeSource;
27   import java.security.Permission;
28   import java.security.PermissionCollection;
# Line 60 | Line 72 | import java.security.SecurityPermission;
72   *
73   * </ol>
74   *
75 < * <p> <b>Other notes</b>
75 > * <p><b>Other notes</b>
76   * <ul>
77   *
78   * <li> Usually, there is one testcase method per JSR166 method
# Line 131 | Line 143 | public class JSR166TestCase extends Test
143                  System.out.printf("%n%s: %d%n", toString(), elapsedMillis);
144          }
145      }
146 <    
146 >
147      /**
148 <     * Runs all JSR166 unit tests using junit.textui.TestRunner
148 >     * Runs all JSR166 unit tests using junit.textui.TestRunner.
149 >     * Optional command line arg provides the number of iterations to
150 >     * repeat running the tests.
151       */
152      public static void main(String[] args) {
153          if (useSecurityManager) {
# Line 251 | Line 265 | public class JSR166TestCase extends Test
265          return 50;
266      }
267  
254
268      /**
269       * Sets delays as multiples of SHORT_DELAY.
270       */
# Line 259 | Line 272 | public class JSR166TestCase extends Test
272          SHORT_DELAY_MS = getShortDelay();
273          SMALL_DELAY_MS  = SHORT_DELAY_MS * 5;
274          MEDIUM_DELAY_MS = SHORT_DELAY_MS * 10;
275 <        LONG_DELAY_MS   = SHORT_DELAY_MS * 50;
275 >        LONG_DELAY_MS   = SHORT_DELAY_MS * 200;
276 >    }
277 >
278 >    /**
279 >     * Returns a timeout in milliseconds to be used in tests that
280 >     * verify that operations block or time out.
281 >     */
282 >    long timeoutMillis() {
283 >        return SHORT_DELAY_MS / 4;
284 >    }
285 >
286 >    /**
287 >     * Returns a new Date instance representing a time delayMillis
288 >     * milliseconds in the future.
289 >     */
290 >    Date delayedDate(long delayMillis) {
291 >        return new Date(System.currentTimeMillis() + delayMillis);
292      }
293  
294      /**
# Line 283 | Line 312 | public class JSR166TestCase extends Test
312      }
313  
314      /**
315 +     * Extra checks that get done for all test cases.
316 +     *
317       * Triggers test case failure if any thread assertions have failed,
318       * by rethrowing, in the test harness thread, any exception recorded
319       * earlier by threadRecordFailure.
320 +     *
321 +     * Triggers test case failure if interrupt status is set in the main thread.
322       */
323      public void tearDown() throws Exception {
324 <        Throwable t = threadFailure.get();
324 >        Throwable t = threadFailure.getAndSet(null);
325          if (t != null) {
326              if (t instanceof Error)
327                  throw (Error) t;
# Line 303 | Line 336 | public class JSR166TestCase extends Test
336                  throw afe;
337              }
338          }
339 +
340 +        if (Thread.interrupted())
341 +            throw new AssertionFailedError("interrupt status set in main thread");
342      }
343  
344      /**
# Line 434 | Line 470 | public class JSR166TestCase extends Test
470          else {
471              AssertionFailedError afe =
472                  new AssertionFailedError("unexpected exception: " + t);
473 <            t.initCause(t);
473 >            afe.initCause(t);
474              throw afe;
475          }
476      }
477  
478      /**
479 +     * Delays, via Thread.sleep, for the given millisecond delay, but
480 +     * if the sleep is shorter than specified, may re-sleep or yield
481 +     * until time elapses.
482 +     */
483 +    static void delay(long millis) throws InterruptedException {
484 +        long startTime = System.nanoTime();
485 +        long ns = millis * 1000 * 1000;
486 +        for (;;) {
487 +            if (millis > 0L)
488 +                Thread.sleep(millis);
489 +            else // too short to sleep
490 +                Thread.yield();
491 +            long d = ns - (System.nanoTime() - startTime);
492 +            if (d > 0L)
493 +                millis = d / (1000 * 1000);
494 +            else
495 +                break;
496 +        }
497 +    }
498 +
499 +    /**
500       * Waits out termination of a thread pool or fails doing so.
501       */
502 <    public void joinPool(ExecutorService exec) {
502 >    void joinPool(ExecutorService exec) {
503          try {
504              exec.shutdown();
505              assertTrue("ExecutorService did not terminate in a timely manner",
506 <                       exec.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
506 >                       exec.awaitTermination(2 * LONG_DELAY_MS, MILLISECONDS));
507          } catch (SecurityException ok) {
508              // Allowed in case test doesn't have privs
509          } catch (InterruptedException ie) {
# Line 454 | Line 511 | public class JSR166TestCase extends Test
511          }
512      }
513  
514 +    /**
515 +     * Checks that thread does not terminate within the default
516 +     * millisecond delay of {@code timeoutMillis()}.
517 +     */
518 +    void assertThreadStaysAlive(Thread thread) {
519 +        assertThreadStaysAlive(thread, timeoutMillis());
520 +    }
521 +
522 +    /**
523 +     * Checks that thread does not terminate within the given millisecond delay.
524 +     */
525 +    void assertThreadStaysAlive(Thread thread, long millis) {
526 +        try {
527 +            // No need to optimize the failing case via Thread.join.
528 +            delay(millis);
529 +            assertTrue(thread.isAlive());
530 +        } catch (InterruptedException ie) {
531 +            fail("Unexpected InterruptedException");
532 +        }
533 +    }
534 +
535 +    /**
536 +     * Checks that the threads do not terminate within the default
537 +     * millisecond delay of {@code timeoutMillis()}.
538 +     */
539 +    void assertThreadsStayAlive(Thread... threads) {
540 +        assertThreadsStayAlive(timeoutMillis(), threads);
541 +    }
542 +
543 +    /**
544 +     * Checks that the threads do not terminate within the given millisecond delay.
545 +     */
546 +    void assertThreadsStayAlive(long millis, Thread... threads) {
547 +        try {
548 +            // No need to optimize the failing case via Thread.join.
549 +            delay(millis);
550 +            for (Thread thread : threads)
551 +                assertTrue(thread.isAlive());
552 +        } catch (InterruptedException ie) {
553 +            fail("Unexpected InterruptedException");
554 +        }
555 +    }
556 +
557 +    /**
558 +     * Checks that future.get times out, with the default timeout of
559 +     * {@code timeoutMillis()}.
560 +     */
561 +    void assertFutureTimesOut(Future future) {
562 +        assertFutureTimesOut(future, timeoutMillis());
563 +    }
564 +
565 +    /**
566 +     * Checks that future.get times out, with the given millisecond timeout.
567 +     */
568 +    void assertFutureTimesOut(Future future, long timeoutMillis) {
569 +        long startTime = System.nanoTime();
570 +        try {
571 +            future.get(timeoutMillis, MILLISECONDS);
572 +            shouldThrow();
573 +        } catch (TimeoutException success) {
574 +        } catch (Exception e) {
575 +            threadUnexpectedException(e);
576 +        } finally { future.cancel(true); }
577 +        assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
578 +    }
579  
580      /**
581       * Fails with message "should throw exception".
# Line 506 | Line 628 | public class JSR166TestCase extends Test
628          SecurityManager sm = System.getSecurityManager();
629          if (sm == null) {
630              r.run();
631 +        }
632 +        runWithSecurityManagerWithPermissions(r, permissions);
633 +    }
634 +
635 +    /**
636 +     * Runs Runnable r with a security policy that permits precisely
637 +     * the specified permissions.  If there is no current security
638 +     * manager, a temporary one is set for the duration of the
639 +     * Runnable.  We require that any security manager permit
640 +     * getPolicy/setPolicy.
641 +     */
642 +    public void runWithSecurityManagerWithPermissions(Runnable r,
643 +                                                      Permission... permissions) {
644 +        SecurityManager sm = System.getSecurityManager();
645 +        if (sm == null) {
646              Policy savedPolicy = Policy.getPolicy();
647              try {
648                  Policy.setPolicy(permissivePolicy());
649                  System.setSecurityManager(new SecurityManager());
650 <                runWithPermissions(r, permissions);
650 >                runWithSecurityManagerWithPermissions(r, permissions);
651              } finally {
652                  System.setSecurityManager(null);
653                  Policy.setPolicy(savedPolicy);
# Line 558 | Line 695 | public class JSR166TestCase extends Test
695              return perms.implies(p);
696          }
697          public void refresh() {}
698 +        public String toString() {
699 +            List<Permission> ps = new ArrayList<Permission>();
700 +            for (Enumeration<Permission> e = perms.elements(); e.hasMoreElements();)
701 +                ps.add(e.nextElement());
702 +            return "AdjustablePolicy with permissions " + ps;
703 +        }
704      }
705  
706      /**
# Line 585 | Line 728 | public class JSR166TestCase extends Test
728       */
729      void sleep(long millis) {
730          try {
731 <            Thread.sleep(millis);
731 >            delay(millis);
732          } catch (InterruptedException ie) {
733              AssertionFailedError afe =
734                  new AssertionFailedError("Unexpected InterruptedException");
# Line 595 | Line 738 | public class JSR166TestCase extends Test
738      }
739  
740      /**
741 <     * Sleeps until the timeout has elapsed, or interrupted.
742 <     * Does <em>NOT</em> throw InterruptedException.
741 >     * Spin-waits up to the specified number of milliseconds for the given
742 >     * thread to enter a wait state: BLOCKED, WAITING, or TIMED_WAITING.
743       */
744 <    void sleepTillInterrupted(long timeoutMillis) {
745 <        try {
746 <            Thread.sleep(timeoutMillis);
747 <        } catch (InterruptedException wakeup) {}
744 >    void waitForThreadToEnterWaitState(Thread thread, long timeoutMillis) {
745 >        long startTime = System.nanoTime();
746 >        for (;;) {
747 >            Thread.State s = thread.getState();
748 >            if (s == Thread.State.BLOCKED ||
749 >                s == Thread.State.WAITING ||
750 >                s == Thread.State.TIMED_WAITING)
751 >                return;
752 >            else if (s == Thread.State.TERMINATED)
753 >                fail("Unexpected thread termination");
754 >            else if (millisElapsedSince(startTime) > timeoutMillis) {
755 >                threadAssertTrue(thread.isAlive());
756 >                return;
757 >            }
758 >            Thread.yield();
759 >        }
760 >    }
761 >
762 >    /**
763 >     * Waits up to LONG_DELAY_MS for the given thread to enter a wait
764 >     * state: BLOCKED, WAITING, or TIMED_WAITING.
765 >     */
766 >    void waitForThreadToEnterWaitState(Thread thread) {
767 >        waitForThreadToEnterWaitState(thread, LONG_DELAY_MS);
768 >    }
769 >
770 >    /**
771 >     * Returns the number of milliseconds since time given by
772 >     * startNanoTime, which must have been previously returned from a
773 >     * call to {@link System.nanoTime()}.
774 >     */
775 >    long millisElapsedSince(long startNanoTime) {
776 >        return NANOSECONDS.toMillis(System.nanoTime() - startNanoTime);
777      }
778  
779      /**
# Line 625 | Line 797 | public class JSR166TestCase extends Test
797          } catch (InterruptedException ie) {
798              threadUnexpectedException(ie);
799          } finally {
800 <            if (t.isAlive()) {
800 >            if (t.getState() != Thread.State.TERMINATED) {
801                  t.interrupt();
802                  fail("Test timed out");
803              }
804          }
805      }
806  
807 +    /**
808 +     * Waits for LONG_DELAY_MS milliseconds for the thread to
809 +     * terminate (using {@link Thread#join(long)}), else interrupts
810 +     * the thread (in the hope that it may terminate later) and fails.
811 +     */
812 +    void awaitTermination(Thread t) {
813 +        awaitTermination(t, LONG_DELAY_MS);
814 +    }
815 +
816      // Some convenient Runnable classes
817  
818      public abstract class CheckedRunnable implements Runnable {
# Line 694 | Line 875 | public class JSR166TestCase extends Test
875                  realRun();
876                  threadShouldThrow("InterruptedException");
877              } catch (InterruptedException success) {
878 +                threadAssertFalse(Thread.interrupted());
879              } catch (Throwable t) {
880                  threadUnexpectedException(t);
881              }
# Line 723 | Line 905 | public class JSR166TestCase extends Test
905                  threadShouldThrow("InterruptedException");
906                  return result;
907              } catch (InterruptedException success) {
908 +                threadAssertFalse(Thread.interrupted());
909              } catch (Throwable t) {
910                  threadUnexpectedException(t);
911              }
# Line 746 | Line 929 | public class JSR166TestCase extends Test
929  
930      public Callable<String> latchAwaitingStringTask(final CountDownLatch latch) {
931          return new CheckedCallable<String>() {
932 <            public String realCall() {
932 >            protected String realCall() {
933                  try {
934                      latch.await();
935                  } catch (InterruptedException quittingTime) {}
# Line 754 | Line 937 | public class JSR166TestCase extends Test
937              }};
938      }
939  
940 +    public Runnable awaiter(final CountDownLatch latch) {
941 +        return new CheckedRunnable() {
942 +            public void realRun() throws InterruptedException {
943 +                await(latch);
944 +            }};
945 +    }
946 +
947 +    public void await(CountDownLatch latch) {
948 +        try {
949 +            assertTrue(latch.await(LONG_DELAY_MS, MILLISECONDS));
950 +        } catch (Throwable t) {
951 +            threadUnexpectedException(t);
952 +        }
953 +    }
954 +
955 +    public void await(Semaphore semaphore) {
956 +        try {
957 +            assertTrue(semaphore.tryAcquire(LONG_DELAY_MS, MILLISECONDS));
958 +        } catch (Throwable t) {
959 +            threadUnexpectedException(t);
960 +        }
961 +    }
962 +
963 + //     /**
964 + //      * Spin-waits up to LONG_DELAY_MS until flag becomes true.
965 + //      */
966 + //     public void await(AtomicBoolean flag) {
967 + //         await(flag, LONG_DELAY_MS);
968 + //     }
969 +
970 + //     /**
971 + //      * Spin-waits up to the specified timeout until flag becomes true.
972 + //      */
973 + //     public void await(AtomicBoolean flag, long timeoutMillis) {
974 + //         long startTime = System.nanoTime();
975 + //         while (!flag.get()) {
976 + //             if (millisElapsedSince(startTime) > timeoutMillis)
977 + //                 throw new AssertionFailedError("timed out");
978 + //             Thread.yield();
979 + //         }
980 + //     }
981 +
982      public static class NPETask implements Callable<String> {
983          public String call() { throw new NullPointerException(); }
984      }
# Line 764 | Line 989 | public class JSR166TestCase extends Test
989  
990      public class ShortRunnable extends CheckedRunnable {
991          protected void realRun() throws Throwable {
992 <            Thread.sleep(SHORT_DELAY_MS);
992 >            delay(SHORT_DELAY_MS);
993          }
994      }
995  
996      public class ShortInterruptedRunnable extends CheckedInterruptedRunnable {
997          protected void realRun() throws InterruptedException {
998 <            Thread.sleep(SHORT_DELAY_MS);
998 >            delay(SHORT_DELAY_MS);
999          }
1000      }
1001  
1002      public class SmallRunnable extends CheckedRunnable {
1003          protected void realRun() throws Throwable {
1004 <            Thread.sleep(SMALL_DELAY_MS);
1004 >            delay(SMALL_DELAY_MS);
1005          }
1006      }
1007  
1008      public class SmallPossiblyInterruptedRunnable extends CheckedRunnable {
1009          protected void realRun() {
1010              try {
1011 <                Thread.sleep(SMALL_DELAY_MS);
1011 >                delay(SMALL_DELAY_MS);
1012              } catch (InterruptedException ok) {}
1013          }
1014      }
1015  
1016      public class SmallCallable extends CheckedCallable {
1017          protected Object realCall() throws InterruptedException {
1018 <            Thread.sleep(SMALL_DELAY_MS);
1018 >            delay(SMALL_DELAY_MS);
1019              return Boolean.TRUE;
1020          }
1021      }
1022  
1023      public class MediumRunnable extends CheckedRunnable {
1024          protected void realRun() throws Throwable {
1025 <            Thread.sleep(MEDIUM_DELAY_MS);
1025 >            delay(MEDIUM_DELAY_MS);
1026          }
1027      }
1028  
1029      public class MediumInterruptedRunnable extends CheckedInterruptedRunnable {
1030          protected void realRun() throws InterruptedException {
1031 <            Thread.sleep(MEDIUM_DELAY_MS);
1031 >            delay(MEDIUM_DELAY_MS);
1032          }
1033      }
1034  
1035 +    public Runnable possiblyInterruptedRunnable(final long timeoutMillis) {
1036 +        return new CheckedRunnable() {
1037 +            protected void realRun() {
1038 +                try {
1039 +                    delay(timeoutMillis);
1040 +                } catch (InterruptedException ok) {}
1041 +            }};
1042 +    }
1043 +
1044      public class MediumPossiblyInterruptedRunnable extends CheckedRunnable {
1045          protected void realRun() {
1046              try {
1047 <                Thread.sleep(MEDIUM_DELAY_MS);
1047 >                delay(MEDIUM_DELAY_MS);
1048              } catch (InterruptedException ok) {}
1049          }
1050      }
# Line 818 | Line 1052 | public class JSR166TestCase extends Test
1052      public class LongPossiblyInterruptedRunnable extends CheckedRunnable {
1053          protected void realRun() {
1054              try {
1055 <                Thread.sleep(LONG_DELAY_MS);
1055 >                delay(LONG_DELAY_MS);
1056              } catch (InterruptedException ok) {}
1057          }
1058      }
# Line 842 | Line 1076 | public class JSR166TestCase extends Test
1076                  public boolean isDone() { return done; }
1077                  public void run() {
1078                      try {
1079 <                        Thread.sleep(timeoutMillis);
1079 >                        delay(timeoutMillis);
1080                          done = true;
1081                      } catch (InterruptedException ok) {}
1082                  }
# Line 853 | Line 1087 | public class JSR166TestCase extends Test
1087          public volatile boolean done = false;
1088          public void run() {
1089              try {
1090 <                Thread.sleep(SHORT_DELAY_MS);
1090 >                delay(SHORT_DELAY_MS);
1091                  done = true;
1092              } catch (InterruptedException ok) {}
1093          }
# Line 863 | Line 1097 | public class JSR166TestCase extends Test
1097          public volatile boolean done = false;
1098          public void run() {
1099              try {
1100 <                Thread.sleep(SMALL_DELAY_MS);
1100 >                delay(SMALL_DELAY_MS);
1101                  done = true;
1102              } catch (InterruptedException ok) {}
1103          }
# Line 873 | Line 1107 | public class JSR166TestCase extends Test
1107          public volatile boolean done = false;
1108          public void run() {
1109              try {
1110 <                Thread.sleep(MEDIUM_DELAY_MS);
1110 >                delay(MEDIUM_DELAY_MS);
1111                  done = true;
1112              } catch (InterruptedException ok) {}
1113          }
# Line 883 | Line 1117 | public class JSR166TestCase extends Test
1117          public volatile boolean done = false;
1118          public void run() {
1119              try {
1120 <                Thread.sleep(LONG_DELAY_MS);
1120 >                delay(LONG_DELAY_MS);
1121                  done = true;
1122              } catch (InterruptedException ok) {}
1123          }
# Line 900 | Line 1134 | public class JSR166TestCase extends Test
1134          public volatile boolean done = false;
1135          public Object call() {
1136              try {
1137 <                Thread.sleep(SMALL_DELAY_MS);
1137 >                delay(SMALL_DELAY_MS);
1138                  done = true;
1139              } catch (InterruptedException ok) {}
1140              return Boolean.TRUE;
# Line 947 | Line 1181 | public class JSR166TestCase extends Test
1181      }
1182  
1183      /**
1184 <     * A CyclicBarrier that fails with AssertionFailedErrors instead
1185 <     * of throwing checked exceptions.
1184 >     * A CyclicBarrier that uses timed await and fails with
1185 >     * AssertionFailedErrors instead of throwing checked exceptions.
1186       */
1187      public class CheckedBarrier extends CyclicBarrier {
1188          public CheckedBarrier(int parties) { super(parties); }
1189  
1190          public int await() {
1191              try {
1192 <                return super.await();
1192 >                return super.await(2 * LONG_DELAY_MS, MILLISECONDS);
1193 >            } catch (TimeoutException e) {
1194 >                throw new AssertionFailedError("timed out");
1195              } catch (Exception e) {
1196                  AssertionFailedError afe =
1197                      new AssertionFailedError("Unexpected exception: " + e);
# Line 965 | Line 1201 | public class JSR166TestCase extends Test
1201          }
1202      }
1203  
1204 +    void checkEmpty(BlockingQueue q) {
1205 +        try {
1206 +            assertTrue(q.isEmpty());
1207 +            assertEquals(0, q.size());
1208 +            assertNull(q.peek());
1209 +            assertNull(q.poll());
1210 +            assertNull(q.poll(0, MILLISECONDS));
1211 +            assertEquals(q.toString(), "[]");
1212 +            assertTrue(Arrays.equals(q.toArray(), new Object[0]));
1213 +            assertFalse(q.iterator().hasNext());
1214 +            try {
1215 +                q.element();
1216 +                shouldThrow();
1217 +            } catch (NoSuchElementException success) {}
1218 +            try {
1219 +                q.iterator().next();
1220 +                shouldThrow();
1221 +            } catch (NoSuchElementException success) {}
1222 +            try {
1223 +                q.remove();
1224 +                shouldThrow();
1225 +            } catch (NoSuchElementException success) {}
1226 +        } catch (InterruptedException ie) {
1227 +            threadUnexpectedException(ie);
1228 +        }
1229 +    }
1230 +
1231 +    void assertSerialEquals(Object x, Object y) {
1232 +        assertTrue(Arrays.equals(serialBytes(x), serialBytes(y)));
1233 +    }
1234 +
1235 +    void assertNotSerialEquals(Object x, Object y) {
1236 +        assertFalse(Arrays.equals(serialBytes(x), serialBytes(y)));
1237 +    }
1238 +
1239 +    byte[] serialBytes(Object o) {
1240 +        try {
1241 +            ByteArrayOutputStream bos = new ByteArrayOutputStream();
1242 +            ObjectOutputStream oos = new ObjectOutputStream(bos);
1243 +            oos.writeObject(o);
1244 +            oos.flush();
1245 +            oos.close();
1246 +            return bos.toByteArray();
1247 +        } catch (Throwable t) {
1248 +            threadUnexpectedException(t);
1249 +            return new byte[0];
1250 +        }
1251 +    }
1252 +
1253 +    @SuppressWarnings("unchecked")
1254 +    <T> T serialClone(T o) {
1255 +        try {
1256 +            ObjectInputStream ois = new ObjectInputStream
1257 +                (new ByteArrayInputStream(serialBytes(o)));
1258 +            T clone = (T) ois.readObject();
1259 +            assertSame(o.getClass(), clone.getClass());
1260 +            return clone;
1261 +        } catch (Throwable t) {
1262 +            threadUnexpectedException(t);
1263 +            return null;
1264 +        }
1265 +    }
1266   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines