-
Bug
-
Resolution: Fixed
-
P3
-
5.0u22, 6, 7
-
b118
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2185278 | 6-pool | Sergey Bylokhov | P4 | Closed | Won't Fix | |
JDK-2184129 | 5.0-pool | Unassigned | P4 | Closed | Incomplete |
The spec for TableCellRenderer.getTableCellRendererComponent() says:
* @param table the <code>JTable</code> that is asking the
* renderer to draw; can be <code>null</code>
But DefaultTableCellRenderer implementation will throw NPE if 'null' table is passed. Please see the following code sample:
---
import javax.swing.*;
public class NPE {
public static void main(String[] args) {
new JTable().getDefaultRenderer(Object.class).
getTableCellRendererComponent(null, "a value", true, true, 0, 0);
}
}
---
Exception in thread "main" java.lang.NullPointerException
at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(DefaultTableCellRenderer.java:177)
...
---
The following JCK test fails:
api/javax_swing/table/TableCellRenderer/index.html#GetComponent[TableCellRenderer0001]
JCK-runtime-7 b03
JDK: 6, 7
Platforms: Windows, Solaris
There is no this test in jdk 1.5.0 but the same problem exists.
* @param table the <code>JTable</code> that is asking the
* renderer to draw; can be <code>null</code>
But DefaultTableCellRenderer implementation will throw NPE if 'null' table is passed. Please see the following code sample:
---
import javax.swing.*;
public class NPE {
public static void main(String[] args) {
new JTable().getDefaultRenderer(Object.class).
getTableCellRendererComponent(null, "a value", true, true, 0, 0);
}
}
---
Exception in thread "main" java.lang.NullPointerException
at javax.swing.table.DefaultTableCellRenderer.getTableCellRendererComponent(DefaultTableCellRenderer.java:177)
...
---
The following JCK test fails:
api/javax_swing/table/TableCellRenderer/index.html#GetComponent[TableCellRenderer0001]
JCK-runtime-7 b03
JDK: 6, 7
Platforms: Windows, Solaris
There is no this test in jdk 1.5.0 but the same problem exists.
- backported by
-
JDK-2184129 javax.swing.DefaultTableCellRender.getTableCellRendererComponent() doesn't allow passing null Tables
- Closed
-
JDK-2185278 javax.swing.DefaultTableCellRender.getTableCellRendererComponent() doesn't allow passing null Tables
- Closed