JDK-8047220 : ClassCastException when doing ColorConvertOp on a Raster (ByteBuffer + SinglePixelPackedSampleModel)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8u5,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: windows
  • CPU: generic
  • Submitted: 2014-06-18
  • Updated: 2014-06-18
  • Resolved: 2014-06-18
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.
Related Reports
Duplicate :  
import java.awt.color.ColorSpace;
import java.awt.image.*;

public class ColorOpTest {
    public static void main(String[] args) {
        new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_sRGB),
                ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), null).
                filter(Raster.createPackedRaster(new DataBufferByte(10), 10, 1, 10,
                        new int[]{0x01, 0x02, 0x04}, null), null);

Exception in thread "main" java.lang.ClassCastException: java.awt.image.SinglePixelPackedSampleModel cannot be cast to java.awt.image.ComponentSampleModel
	at sun.java2d.cmm.lcms.LCMSImageLayout.createImageLayout(LCMSImageLayout.java:389)
	at sun.java2d.cmm.lcms.LCMSTransform.colorConvert(LCMSTransform.java:465)
	at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:571)
	at ColorOpTest.main(ColorOpTest.java:17)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Reproducible with 8u5, 9. 
Not Reproducible with 7u66, 7u45
I'd better fix that problem under JDK-8047066 to not breed issues

I'll take care of this bug...