-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P2
-
Affects Version/s: 7
-
Component/s: client-libs
-
b120
-
generic
-
generic
-
Verified
Methods java.awt.Container.add(...) specify
"Throws: NullPointerException - if comp is null"
while java.awt.Container.remove(...) doesn't. In fact it throws NPE for null arg:
public class TestNPE {
public static void main(String[] args) {
new java.awt.Container().remove((java.awt.Component) null);
}
}
Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.remove(Container.java:1228)
at temp.TestNPE.main(TestNPE.java:5)
...
This behavior should be documented.
"Throws: NullPointerException - if comp is null"
while java.awt.Container.remove(...) doesn't. In fact it throws NPE for null arg:
public class TestNPE {
public static void main(String[] args) {
new java.awt.Container().remove((java.awt.Component) null);
}
}
Exception in thread "main" java.lang.NullPointerException
at java.awt.Container.remove(Container.java:1228)
at temp.TestNPE.main(TestNPE.java:5)
...
This behavior should be documented.