JDK-7172749 : Xrender: Class cast exception in 2D code running an AWT regression test
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux,solaris_11
  • CPU: x86
  • Submitted: 2012-05-30
  • Updated: 2017-12-01
  • Resolved: 2016-05-26
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 8 JDK 9
8u112Fixed 9 b124Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Try to run a manual regression test closed/java/awt/event/MouseEvent/MouseEventsDuringDrag on XToolkit with jdk8 (circa b38). Chance is, you will get 
 
java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData
	at sun.java2d.xr.XRRenderer.validateSurface(XRRenderer.java:65)
	at sun.java2d.xr.XRRenderer.drawLine(XRRenderer.java:84)
	at sun.java2d.SunGraphics2D.drawLine(SunGraphics2D.java:2137)
	at sun.awt.X11.XTextAreaPeer$BevelBorder.paintBorder(XTextAreaPeer.java:1233)
	at javax.swing.border.CompoundBorder.paintBorder(CompoundBorder.java:117)
	at javax.swing.JComponent.paintBorder(JComponent.java:947)
	at javax.swing.JComponent.paint(JComponent.java:1055)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5224)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1486)
	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1417)
	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:306)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1210)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5172)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4983)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4995)
	at sun.awt.X11.XTextAreaPeer$AWTTextArea.repaintNow(XTextAreaPeer.java:994)
	at sun.awt.X11.XTextAreaPeer.repaintText(XTextAreaPeer.java:283)
	at sun.awt.X11.XTextAreaPeer.setText(XTextAreaPeer.java:461)
	at java.awt.TextComponent.setText(TextComponent.java:239)
	at TestDialog.printInstructions(MouseEventsDuringDrag.java:266)
	at Sysout.createDialogWithInstructions(MouseEventsDuringDrag.java:203)
	at MouseEventsDuringDrag.init(MouseEventsDuringDrag.java:107)
	at com.sun.javatest.regtest.AppletWrapper$AppletRunnable.run(AppletWrapper.java:150)
	at java.lang.Thread.run(Thread.java:722)


Linux Ubuntu 11.10 x586
(Ubuntu) version of libxrender1 is 1:0.9.6-2 while the last note from Changelog is: "Bump Standards-Version to 3.9.2."

Comments
I get this exception every time my Ubuntu notebook is woke up from sleep. This does not happen with JDK 7, but happens every time with JDK 8. As a result of a series of these exceptions, UI of the application is not fully drawn.
27-11-2015

RULE closed/java/awt/dnd/FileDialogDropTargetTest/FileDialogDropTargetTest.java Exception java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData
20-07-2015

this is with Jake, so jdk9 RULE 2D_ImageIOTiger/ImageIOWriterCompressionTest Exception java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData (in module: java.desktop) cannot be cast to sun.java2d.xr.XRSurfaceData (in module: java.desktop)
26-06-2015

RULE java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java Exception java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData
20-05-2015

Bug reproduces in JDK 9 b20 Solaris 11 x64 intel java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData at sun.java2d.xr.XRRenderer.validateSurface(XRRenderer.java:72) at sun.java2d.xr.XRRenderer.drawLine(XRRenderer.java:87) at sun.java2d.SunGraphics2D.drawLine(SunGraphics2D.java:2220) at sun.awt.X11.XScrollbar.paintArrows(XScrollbar.java:326) at sun.awt.X11.XScrollbar.paint(XScrollbar.java:240) at sun.awt.X11.XListPeer$ListPainter.paintScrollBar(XListPeer.java:1947) at sun.awt.X11.XListPeer$ListPainter.paintVerScrollbar(XListPeer.java:1972) at sun.awt.X11.XListPeer$ListPainter.paint(XListPeer.java:1843) at sun.awt.X11.XListPeer$ListPainter.paint(XListPeer.java:1772) at sun.awt.X11.XListPeer$ListPainter.access$100(XListPeer.java:1701) at sun.awt.X11.XListPeer.paintPeer(XListPeer.java:420) at sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:62) at sun.awt.RepaintArea.paint(RepaintArea.java:240) at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:587) at java.awt.Component.dispatchEventImpl(Component.java:4968) at java.awt.Component.dispatchEvent(Component.java:4714) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746) at java.awt.EventQueue.access$400(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:697) at java.awt.EventQueue$3.run(EventQueue.java:691) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:719) at java.awt.EventQueue$4.run(EventQueue.java:717) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:716) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
30-07-2014

closed/java/awt/FileDialog/ISCthrownByFileListTest/ISCthrownByFileListTest.java
19-06-2014

We have similar bug reports in NetBeans, see https://netbeans.org/bugzilla/show_bug.cgi?id=241231 Please re-evaluate, thanks.
03-02-2014

Neither SQE nor DEV can reproduce this problem. So I am closing as not reproducible although we are not sure how it got fixed. We can re-open if new information comes in.
23-10-2013

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. Kind regards, Mathias
29-08-2013

Converted "8-client-defer-candidate" label to "8-defer-request" by SQE' OK.
15-08-2013

*This is anti-deferral criteria list*: - P2 -------------- Engineering's Criteria ------------------------------------- - tck-red labeled - conformance labeled - P3 regressions reported/labeled against jdk8 - findbugs, parfait, eht labeled bugs - CAP <1 year reported - netbeans <1 year reported Victor ----------------- SQE's OK --------------------------------- Yes, we are ok with that thanks, Mikhail
15-08-2013

EVALUATION This looks the same as 7179454: Xrender: FileDialogDropTargetTest.java sometimes failed on OEL 6 with jdk 8
31-07-2012