JDK-6717780 : (coll spec) LinkedList api documentation provides the wrong method name
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2008-06-23
  • Updated: 2012-10-08
  • Resolved: 2011-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b105Fixed
Description
A DESCRIPTION OF THE PROBLEM :
In the javadoc for java.util.LinkedList, it mentioned:

"the LinkedList class provides uniformly named methods to get, remove and insert an element at the beginning and end of the list."

but there is not insert method in the class. perhaps it meant the add(int,E) method.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
add instead of insert?
ACTUAL -
Linked list implementation of the List interface. Implements all optional list operations, and permits all elements (including null). In addition to implementing the List interface, the LinkedList class provides uniformly named methods to get, remove and insert an element at the beginning and end of the list. These operations allow linked lists to be used as a stack, queue, or double-ended queue.

URL OF FAULTY DOCUMENTATION :
http://java.sun.com/javase/6/docs/api/java/util/LinkedList.html

Comments
SUGGESTED FIX # HG changeset patch # User martin # Date 1280157470 25200 # Node ID db21b420d038901c86dcebc49e7f34e59c8eec3d # Parent 402ff3e81922acf51446423fca1583f26d76d635 6717780: (coll spec) LinkedList api documentation provides the wrong method name Summary: Cleanup by simply making Deque equal status with List Reviewed-by: darcy --- a/src/share/classes/java/util/LinkedList.java Mon Jul 26 17:21:51 2010 +0800 +++ b/src/share/classes/java/util/LinkedList.java Mon Jul 26 08:17:50 2010 -0700 @@ -26,18 +26,9 @@ package java.util; package java.util; /** - * Linked list implementation of the {@code List} interface. Implements all - * optional list operations, and permits all elements (including - * {@code null}). In addition to implementing the {@code List} interface, - * the {@code LinkedList} class provides uniformly named methods to - * {@code get}, {@code remove} and {@code insert} an element at the - * beginning and end of the list. These operations allow linked lists to be - * used as a stack, {@linkplain Queue queue}, or {@linkplain Deque - * double-ended queue}. - * - * <p>The class implements the {@code Deque} interface, providing - * first-in-first-out queue operations for {@code add}, - * {@code poll}, along with other stack and deque operations. + * Linked list implementation of the {@link List} and {@link Deque} interfaces. + * Implements all optional operations, and permits all elements (including + * {@code null}). * * <p>All of the operations perform as could be expected for a doubly-linked * list. Operations that index into the list will traverse the list from
26-07-2010

PUBLIC COMMENTS See http://hg.openjdk.java.net/jdk7/tl/jdk/rev/db21b420d038
26-07-2010

EVALUATION Should be fixed.
22-07-2010