From 41e80ac80d27cf36dce7ccdfb141d657b118c750 Mon Sep 17 00:00:00 2001 From: anashaty Date: Tue, 8 Jul 2014 17:47:47 +0400 Subject: [PATCH] 8047066: Test test/sun/awt/image/bug8038000.java fails with ClassCastException Reviewed-by: bae, prr --- src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java | 3 ++- test/sun/awt/image/bug8038000.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java b/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java index 7fdab9bd6..89578cc32 100644 --- a/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java +++ b/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java @@ -383,7 +383,8 @@ class LCMSImageLayout { } public static LCMSImageLayout createImageLayout(Raster r) { LCMSImageLayout l = new LCMSImageLayout(); - if (r instanceof ByteComponentRaster) { + if (r instanceof ByteComponentRaster && + r.getSampleModel() instanceof ComponentSampleModel) { ByteComponentRaster br = (ByteComponentRaster)r; ComponentSampleModel csm = (ComponentSampleModel)r.getSampleModel(); diff --git a/test/sun/awt/image/bug8038000.java b/test/sun/awt/image/bug8038000.java index 2bfdc27d2..20affe806 100644 --- a/test/sun/awt/image/bug8038000.java +++ b/test/sun/awt/image/bug8038000.java @@ -23,11 +23,13 @@ /** * @test - * @bug 8038000 + * @bug 8038000 8047066 * * @summary Verifies that we could create different type of Rasters with height 1 * and strideline which exceeds raster width. * Also checks that a set of RasterOp work correctly with such kind of Rasters. + * For 8047066 verifies that ColorConvertOp could process + * Raster (ByteBuffer + SinglePixelPackedSampleModel) * * @run main bug8038000 */ -- GitLab