changeset 8214:260bc59ca253

8016563: Test closed/java/awt/dnd/ImageTransferTest/ImageTransferTest.html fails Reviewed-by: anthony, serb
author pchelko
date Fri, 27 Sep 2013 18:35:00 +0400
parents ad7db846c951
children bfff9e9120ec
files src/share/classes/sun/awt/datatransfer/DataTransferer.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Fri Sep 27 17:04:16 2013 +0400
+++ b/src/share/classes/sun/awt/datatransfer/DataTransferer.java	Fri Sep 27 18:35:00 2013 +0400
@@ -1793,8 +1793,17 @@
             } catch (Exception e) {
                 throw new IOException(e.getMessage());
             }
+            // Target data is Image
+        } else if (DataFlavor.imageFlavor.equals(flavor)) {
+            if (!isImageFormat(format)) {
+                throw new IOException("data translation failed");
+            }
+            theObject = platformImageBytesToImage(inputStreamToByteArray(str), format);
         }
 
+        if (theObject == null) {
+            throw new IOException("data translation failed");
+        }
 
         return theObject;