-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: ooR10001 Date: 12/28/2000
javax.swing.SpinnerListModel(List) constructor has incorrect behaviour becuase it does
not throw IllegalArgumentException when passed argument is null or has zero length.
The javadoc says:
----------------------
SpinnerListModel
public SpinnerListModel(List values)
Construct a SpinnerModel whose sequence of values is defined by the
specified List. The intial value (current element) of the model will
be values.get(0). If values is null or has zero size then an
IllegalArgumentException is thrown.
----------------------------------------------
Following test is demonstrate this bug:
----------------------------------------------
import javax.swing.SpinnerListModel;
import java.util.List;
public class test {
public static void main(String[] args) {
String status = "FAILED";
try {
SpinnerListModel model = new SpinnerListModel((List)null);
} catch (IllegalArgumentException npe) {
status = "OKAY";
}
System.out.println(status);
}
}
----------------------
Test output:
----------------------
FAILED
----------------------
This needs to be fixed.
======================================================================
- duplicates
-
JDK-4398441 javax.swing.SpinnerListModel(Object[]) constructor has incorrect behaviour
- Resolved