JDK-6661484 : FullScreen tests failing with NullPointer Exception in 6u10b12 PIT
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-02-11
  • Updated: 2011-01-19
  • Resolved: 2008-02-14
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 6 JDK 7
6u10 b12Fixed 7Resolved
Related Reports
Relates :  
Description
Following Regression Testcases are failing with "NullPointerException" in Windows Xp with the
6u10b12 pit build.
They pass in mustang as well as 6u10b11 promoted build.
The failure stack trace is attached.

java/awt/FullScreen/BufferStrategyExceptionTest/BufferStrategyExceptionTest.java
java/awt/FullScreen/DisplayMode/DeadlockTest.java
java/awt/FullScreen/NonExistentDisplayModeTest/NonExistentDisplayModeTest.java
java/awt/FullScreen/SetFSWindow/FSFrame.java
java/awt/FullScreen/VramExaustionFSTest/VramExaustionFSTest.java
java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java

Comments
EVALUATION This is a regression of 6633275. This happens due to the code added into the setFullScreen() method in order to disable all the effects for windows going into the full-screen mode. However, the setFullScreen() method is allowed to get 'null' as a valid argument. Therefore, we should guard our code verifying that the passed Window argument is not null.
11-02-2008

SUGGESTED FIX --- old/src/share/classes/java/awt/GraphicsDevice.java 2008-02-11 15:46:54.000000000 +0300 +++ new/src/share/classes/java/awt/GraphicsDevice.java 2008-02-11 15:46:54.000000000 +0300 @@ -219,15 +219,17 @@ * @since 1.4 */ public void setFullScreenWindow(Window w) { - //XXX: The actions should be documented in some non-update release. - if (AWTAccessor.getWindowAccessor().getShape(w) != null) { - AWTAccessor.getWindowAccessor().setShape(w, null); - } - if (!AWTAccessor.getWindowAccessor().isOpaque(w)) { - AWTAccessor.getWindowAccessor().setOpaque(w, true); - } - if (AWTAccessor.getWindowAccessor().getOpacity(w) < 1.0f) { - AWTAccessor.getWindowAccessor().setOpacity(w, 1.0f); + if (w != null) { + //XXX: The actions should be documented in some non-update release. + if (AWTAccessor.getWindowAccessor().getShape(w) != null) { + AWTAccessor.getWindowAccessor().setShape(w, null); + } + if (!AWTAccessor.getWindowAccessor().isOpaque(w)) { + AWTAccessor.getWindowAccessor().setOpaque(w, true); + } + if (AWTAccessor.getWindowAccessor().getOpacity(w) < 1.0f) { + AWTAccessor.getWindowAccessor().setOpacity(w, 1.0f); + } } if (fullScreenWindow != null && windowedModeBounds != null) {
11-02-2008