javax/swing/PopupFactory/8048506/bug8048506.java
consistently fails in jtreg on windows, even when it is
the only test run.
The logs look like this
STATUS:Passed.
java.lang.NullPointerException: HDC for component
at java.desktop/sun.java2d.loops.ScaledBlit.Scale(Native Method)
at java.desktop/sun.java2d.pipe.DrawImage.scaleSurfaceData(DrawImage.java:1001)
at java.desktop/sun.java2d.pipe.DrawImage.renderImageScale(DrawImage.java:647)
at java.desktop/sun.java2d.pipe.DrawImage.tryCopyOrScale(DrawImage.java:319)
at java.desktop/sun.java2d.pipe.DrawImage.transformImage(DrawImage.java:258)
at java.desktop/sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:777)
at java.desktop/sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:1081)
at java.desktop/sun.java2d.pipe.ValidatePipe.scaleImage(ValidatePipe.java:219)
at java.desktop/sun.java2d.SunGraphics2D.scaleImage(SunGraphics2D.java:3188)
at java.desktop/sun.java2d.SunGraphics2D.drawHiDPIImage(SunGraphics2D.java:3114)
at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3407)
at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3391)
at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedFPScales(RepaintManager.java:1720)
at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1616)
at java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556)
at java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1323)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1060)
at java.desktop/java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
at java.desktop/sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:78)
at java.desktop/sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:115)
at java.desktop/java.awt.Container.paint(Container.java:2001)
at java.desktop/java.awt.Window.paint(Window.java:3940)
at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:876)
at java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:848)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:848)
at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:823)
at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:772)
at java.desktop/javax.swing.RepaintManager.access$1200(RepaintManager.java:69)
at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1890)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
STATUS:Failed.`main' threw exception: java.lang.NullPointerException: HDC for component
====
I think there are actually TWO problems here.
First the simple one. The test fails to call
poup1.hide();
poup2.hide();
frame.dispose();
This prevents the test exiting when run outside jtreg .. and is
presumably the lack of these causes the NPE when jtreg shuts
down the test.
With those lines the test exits standalone and does not throw NPE.
So the test should be updated.
But I am more interested in why it throws NPE.
That should not happen so we have a product bug which
may be in the 2D rendering or may be in AWT. Not sure.
In any case I've seen that same stack trace before so it
should be tracked down and understood and fixed since
we seem to have a reliable way to demonstrate it.