-
Bug
-
Resolution: Fixed
-
P3
-
5.0, 6
-
b91
-
x86
-
linux
A DESCRIPTION OF THE PROBLEM :
The documentation of the generic class AbstractList<E> as a whole contains these two texts:
set(int index, Object element)
add(int index, Object element)
Only a few lines below, those methods are referenced in their new (correct) form:
set(int index, E element)
add(int index, E element)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
To implement a modifiable list, the programmer must additionally override the set(int index, E element) method (which otherwise throws an UnsupportedOperationException. If the list is variable-size the programmer must additionally override the add(int index, E element) and remove(int index) methods.
ACTUAL -
To implement a modifiable list, the programmer must additionally override the set(int index, Object element) method (which otherwise throws an UnsupportedOperationException. If the list is variable-size the programmer must additionally override the add(int index, Object element) and remove(int index) methods.
URL OF FAULTY DOCUMENTATION :
http://download.java.net/jdk6/docs/api/java/util/AbstractList.html
The documentation of the generic class AbstractList<E> as a whole contains these two texts:
set(int index, Object element)
add(int index, Object element)
Only a few lines below, those methods are referenced in their new (correct) form:
set(int index, E element)
add(int index, E element)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
To implement a modifiable list, the programmer must additionally override the set(int index, E element) method (which otherwise throws an UnsupportedOperationException. If the list is variable-size the programmer must additionally override the add(int index, E element) and remove(int index) methods.
ACTUAL -
To implement a modifiable list, the programmer must additionally override the set(int index, Object element) method (which otherwise throws an UnsupportedOperationException. If the list is variable-size the programmer must additionally override the add(int index, Object element) and remove(int index) methods.
URL OF FAULTY DOCUMENTATION :
http://download.java.net/jdk6/docs/api/java/util/AbstractList.html
- duplicates
-
JDK-6494378 (coll) typo in Vector.insertElementAt javadoc
-
- Closed
-