changeset 25757:463491af0c8f

8047066: Test test/sun/awt/image/bug8038000.java fails with ClassCastException Reviewed-by: bae, prr
author anashaty
date Tue, 08 Jul 2014 16:42:23 +0400
parents b19f3d4193a2
children 7b1757bad3fa
files jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java jdk/test/sun/awt/image/bug8038000.java
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java	Tue Jul 08 16:01:18 2014 +0400
+++ b/jdk/src/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java	Tue Jul 08 16:42:23 2014 +0400
@@ -384,7 +384,8 @@
     }
     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();
--- a/jdk/test/sun/awt/image/bug8038000.java	Tue Jul 08 16:01:18 2014 +0400
+++ b/jdk/test/sun/awt/image/bug8038000.java	Tue Jul 08 16:42:23 2014 +0400
@@ -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
  */