JDK-6997116 : The case automatically failed due to java.lang.ClassCastException.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7,7u10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows,windows_xp,windows_vista
  • CPU: x86
  • Submitted: 2010-11-03
  • Updated: 2013-08-19
  • Resolved: 2011-10-29
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 Availabitlity Release.

To download the current JDK release, click here.
7u40Fixed 8 b12Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Bug description:The case automatically failed due to java.lang.ClassCastException.
Testsuite name: AWT 
JDK/JRE tested: jdk-7-ea-bin-b116-windows-amd64-28_oct_2010.exe 
Reproducible: Always
Reproducible on machine: 
[If sometimes] Also reproducible on machine: 
Is it a platform specific regression: N 
[If yes] Is it a new platform support: N 
[If yes] Regression relative to OS version: 
Is it a Regression: Y
[If yes] Regression introduced in release/build: 7b115
[If yes] Test result on FCS: See the actual result. 
Test run log location: http://jsqalab.sfbay.sun.com/results/Evergreen/7/automation/7b116/awt/automation/winxp-x64/Standalone_awt_2010_11_02_14_57_06/Administrator.Windows_XP.amd64/ImageTransferTest.html_copy_1/ImageTransferTest.html.log
Test run result location: http://jsqalab.sfbay.sun.com/results/Evergreen/7/automation/7b116/awt/automation/winxp-x64/Standalone_awt_2010_11_02_14_57_06/Administrator.Windows_XP.amd64/ImageTransferTest.html_copy_1/
Steps to reproduce:
1.	Install test bundle JDK7b114 from
to  C:/Java/
2.	Install Jtreg from http://jre.sfbay.sun.com/java/re/jtreg/4.1/promoted/latest/binaries/latest/jtreg/
 locate at C:/jct4.1
3.	Download and unzip jdk7 ws from 
to C:/reg
4.	Modify the reg_awt.sh as:
export JAVA_HOME=C:/Java/jdk1.7.0
C:/jct4.1/jtreg/win32/bin/jtreg -g -v -m -jdk:C:/Java/jdk1.7.0 -r:C:/reg/report -w:C:/reg/work C:/reg/7_awt_reg/test
5.	Make printer work fine. 
6.	From command line, run sh reg_awt.sh
7.	After Jtreg launched, choose Current Configuration from View Filter:Status of ,  
8.	Choose  New Configuration from Configure of menu bar.
9.	Choose Yes form Specify Test to Run ,click Next button then choose From a List a File,click next button and click Browse button to choose C:/awt.list.
10.	Click next button and select the default option.
11.	Choose Yes button from Specify Keyword? then click next button and type manual on the textfield of Response and click Done button to save a *jti file.
12.	Click StartRunning Test  button to run the case.

Actual behavior:
  The case automatically failed due to java.lang.ClassCastException.

Log file:
java.lang.ClassCastException: [S cannot be cast to [I
at java.awt.image.DirectColorModel.getRGB(DirectColorModel.java:714)
at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(CustomComponent.java:145)
at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:560)
at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:541)
at sun.java2d.loops.MaskBlit$General.MaskBlit(MaskBlit.java:189)
at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Blit.java:204)
at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:953)
at sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:575)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:71)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1008)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3062)
at sun.awt.image.ImageRepresentation.drawToBufImage(ImageRepresentation.java:808)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1015)
at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:186)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3062)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3047)
at ImageTransferGUI$TestFrame.paint(ImageTransferGUI.java:193)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:781)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:728)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:677)
at javax.swing.RepaintManager.access$700(RepaintManager.java:59)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1621)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:660)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
STATUS:Failed.Applet thread threw exception: java.lang.ClassCastException: [S cannot be cast to [I

1.On platform  winvista x86  with same build the case is passed.
2.On the same platform with build 7b115 also has same issue.

SQE is ok to defer to 7u12. Does not seem to be Win 8 specific anymore. Removing the win8 label.

Adding win8 label as JDK-7194578 is Windows 8 specific and closed as Duplicate of this one

WORK AROUND -Dsun.java2d.d3d=false

EVALUATION The class cast exception here is caused by an inconsistent pair of color model and raster created by D3DSurfaceData. It happens if BITMASK transparency is used (i.e. alpha mask is 0x1000000). In this case, due to incorrect condition which allows INT transfer type only for 24bpp and 32bpp cases), we select USHORT transfer type for created raster. Suggested fix just makes produced pair of color model and raster a bit more consist.

SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/8/6997116