JDK-6963870 : NPE in CompoundBorder.getInsets()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-06-24
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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.
JDK 7 Other
7 b102Fixed OpenJDK6Fixed
Description
It is possible to get an NPE from CompoundBorder.getBorderInsets(). While it checks if inner and outer borders are non-null before calling their getBorderInsets() methods, there is no check that a non-null Insets object is returned.

Comments
EVALUATION The real question is why we get null border insets. It turns out GTKPainter.ListTableFocusBorder.getBorderInsets() uses null Insets, probably as an optimization.
24-06-2010