8050091: (coll) LinkedList has incorrect implementation comment
authormartin
Mon, 29 Jun 2015 14:59:20 -0700
changeset 31425 276b895af81c
parent 31424 2a034eaf3aef
child 31426 9cd672654f97
8050091: (coll) LinkedList has incorrect implementation comment Summary: Rework implementation invariant comments Reviewed-by: igerasim
jdk/src/java.base/share/classes/java/util/LinkedList.java
--- a/jdk/src/java.base/share/classes/java/util/LinkedList.java	Tue Jun 30 01:17:45 2015 +0300
+++ b/jdk/src/java.base/share/classes/java/util/LinkedList.java	Mon Jun 29 14:59:20 2015 -0700
@@ -88,18 +88,22 @@
 
     /**
      * Pointer to first node.
-     * Invariant: (first == null && last == null) ||
-     *            (first.prev == null && first.item != null)
      */
     transient Node<E> first;
 
     /**
      * Pointer to last node.
-     * Invariant: (first == null && last == null) ||
-     *            (last.next == null && last.item != null)
      */
     transient Node<E> last;
 
+    /*
+    void dataStructureInvariants() {
+        assert (size == 0)
+            ? (first == null && last == null)
+            : (first.prev == null && last.next == null);
+    }
+    */
+
     /**
      * Constructs an empty list.
      */