# HG changeset patch # User martin # Date 1435615160 25200 # Node ID 276b895af81c8cc93c27906340c4a56b35f1e83f # Parent 2a034eaf3aef9424456e7a5d60e0ae3f5cdbbbc5 8050091: (coll) LinkedList has incorrect implementation comment Summary: Rework implementation invariant comments Reviewed-by: igerasim diff -r 2a034eaf3aef -r 276b895af81c 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 first; /** * Pointer to last node. - * Invariant: (first == null && last == null) || - * (last.next == null && last.item != null) */ transient Node last; + /* + void dataStructureInvariants() { + assert (size == 0) + ? (first == null && last == null) + : (first.prev == null && last.next == null); + } + */ + /** * Constructs an empty list. */