JDK-4647115 : JTabbedPane.remove(component) doesn't throw NPE
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2002-03-05
  • Updated: 2003-05-13
  • Resolved: 2003-05-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Relates :  
Description
JTabbedPane.remove(Component component)  should throw NullPointerException if component is "null". But what's happening right now is that, no exception is thrown.
Attached is the test case which reveals the bug.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b07
14-06-2004

SUGGESTED FIX --- JTabbedPane.java *************** *** 826,835 **** /** * Removes the specified <code>Component</code> from the ! * <code>JTabbedPane</code>. * * @param component the component to remove from the tabbedpane - * @exception NullPointerException if <code>component</code> is null. * @see #addTab * @see #removeTabAt */ --- 826,835 ---- /** * Removes the specified <code>Component</code> from the ! * <code>JTabbedPane</code>. The method does nothing ! * if the <code>component</code> is null. * * @param component the component to remove from the tabbedpane * @see #addTab * @see #removeTabAt */
11-06-2004

EVALUATION I ran the test against a older versions. It looks like we never really threw a NullPointerException on a null component removal. We should update the documentation and get rid of this clause. ###@###.### 2002-06-10
10-06-2002