JDK-4848001 : PIT: Java2Demo throws NullPointerException with Tiger PIT build
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2003-04-14
  • Updated: 2003-04-21
  • Resolved: 2003-04-21
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 :  
Relates :  
Description
Java2Demo throws NullPointerException when run with PIT build.
Start Java2Demo, go to Paint tab, click one of the drop-down memus
for choosing color in GradientPaint demo. when the menu is closed,
the following exception is thrown:
java.lang.NullPointerException: component argument pData
	at sun.awt.windows.Win32DDRenderer.doFillRectDD(Native Method)
	at sun.awt.windows.Win32DDRenderer.fillRect(Win32DDRenderer.java:167)
	at sun.java2d.pipe.ValidatePipe.fillRect(ValidatePipe.java:46)
	at sun.java2d.SunGraphics2D.fillRect(SunGraphics2D.java:2065)
	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:140)
	at javax.swing.JComponent.paintComponent(JComponent.java:541)
	at javax.swing.JComponent.paint(JComponent.java:808)
	at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4808)
	at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4761)
	at javax.swing.JComponent._paintImmediately(JComponent.java:4705)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4508)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:208)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:151)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:143)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:104)

Build version used: 
java version "Build:10-Apr-03@20:15.tiger"
Java(TM) 2 Runtime Environment, Standard Edition (build Build:10-Apr-03@20:15.tiger)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b04, mixed mode)

###@###.### 2003-04-14

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

SUGGESTED FIX http://javaweb.sfbay/jcg/1.5.0-tiger/2D/4848001 Reg. tests: automatic: test/sun/java2d/Win32NPEAfterCompDisposeTest/Win32NPEAfterCompDisposeTest.java manual: test/sun/java2d/Win32OffScreenGDILeakTest/Win32OffScreenGDILeakTest.java ###@###.### 2003-04-15
15-04-2003

EVALUATION This is a regression caused by the fix for PIT bug 4844721: PIT: Desktop becomes distorted while running PngTest with Tiger PIT build The problem is that we're using cached surface data to release a dc. For this we need to get a component peer, but if the component has been disposed, we can't get native peer data and throw an NPE in Win32SD_GetComp. We should not use cached in TLS wsdo because it may actually be disposed as well when we try to use it, and we have no means of knowing that. Instead, we just need to move the DC to the passive dc list for later disposal. But in order to avoid running into situation in bug 4844721, where we were moving the DCs to the passive dc list but never getting to releasing them, we should try to release the DCs in the passive list in GET_DC event handler prior to getting a new DC. Also note, that when the window is disposed, we release all DCs associated with it from the component peer's destructor, so we won't be leaking the DCs in case when we move some a DC to the passive list and never render to this component again - the DC will be disposed when the component goes away. ###@###.### 2003-04-14
14-04-2003