JDK-6499736 : NPE is thrown from XToolkit.getScreenInsets() if no window manager is present
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7,7u10
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,solaris
  • CPU: generic,x86
  • Submitted: 2006-12-01
  • Updated: 2012-10-01
  • 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
7 b07Fixed
Related Reports
Duplicate :  
Relates :  
Description
In XToolkit.getScreenInsets() the first check is that _NET protocol is active, with 'if (!netProto.active())'. However, this check throws NPE is netProto is NULL, that occurs with no WM present in the system.

Comments
EVALUATION The bug is introduced with the fix for 4737732 (screen insets).
01-12-2006

SUGGESTED FIX --- XToolkit.java 2006-12-01 19:05:43.000000000 +0300 *************** *** 709,715 **** public Insets getScreenInsets(GraphicsConfiguration gc) { XNETProtocol netProto = XWM.getWM().getNETProtocol(); ! if (!netProto.active()) { return super.getScreenInsets(gc); } --- 709,715 ---- public Insets getScreenInsets(GraphicsConfiguration gc) { XNETProtocol netProto = XWM.getWM().getNETProtocol(); ! if ((netProto == null) || !netProto.active()) { return super.getScreenInsets(gc); }
01-12-2006

EVALUATION Additional check 'netProto == NULL' should be added.
01-12-2006