Name: dsC58869 Date: 06/18/98
The JLS for java.awt.List.add(String item, int index) constructor is wrong.
It says:
/**
* Adds the specified item to the end of the scrolling list.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* The index is zero-based. If value of the index is
* <code>-1</code> then the item is added to the end.
* If value of the index is greater than the number of
* items in the list, the item is added at the end.
* @param item the item to be added.
* @param index the position at which to add the item.
* @since JDK1.1
*/
public synchronized void add(String item, int index) {
But the method adds item at the index position.
Besides, the docs does not say about index less than -1.
In this case method adds item to the end of list.
======================================================================
Justification:
Wrong specification, should be fixed for JCK testing.
======================================================================
- duplicates
-
JDK-4112312 AWT List spec has incorrect summary of method add(String,int) in Method Summary
-
- Closed
-