Name: ooR10001 Date: 03/11/2001
Current javadoc for javax.swing.JToolBar.add(Action a) does not specify method
behavior when parameter 'a' is null. Under jdk 1.4 this method works differ
then under jkd1.3 - it causes compatibility problem.
Following test is demonstrate a bug:
-----------------------
import javax.swing.JToolBar;
public class test {
public static void main(String[] args) {
JToolBar tbar = new JToolBar();
try {
tbar.add((javax.swing.Action)null);
System.out.println("NPE or IAE expected but is not thrown");
} catch (IllegalArgumentException iae) {
System.out.println("IAE is thrown");
} catch (NullPointerException npe) {
System.out.println("NPE is thrown");
}
}
}
-----------------------
Output under jdk1.4:
---------------------
NPE or IAE expected but is not thrown
---------------------
Output under jdk1.3:
---------------------
NPE is thrown
---------------------
It needs to be fixed.
======================================================================