Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P2
-
Resolution: Fixed
-
Affects Version/s: 7
-
Fix Version/s: 7
-
Component/s: client-libs
-
Labels:
-
Subcomponent:
-
Resolved In Build:b120
-
CPU:generic
-
OS:generic
-
Verification:Verified
Description
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.