8015453: java/awt/DataFlavor/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java failed on windows with jdk8 since b86
Reviewed-by: art, serb
--- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java Fri Sep 13 11:58:39 2013 +0400
+++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java Fri Sep 13 17:25:31 2013 +0400
@@ -1765,7 +1765,14 @@
Reader reader = new InputStreamReader(is, unicode);
theObject = constructFlavoredObject(reader, flavor, Reader.class);
-
+ // Target data is a byte array
+ } else if (byteArrayClass.equals(flavor.getRepresentationClass())) {
+ if(isFlavorCharsetTextType(flavor) && isTextFormat(format)) {
+ theObject = translateBytesToString(inputStreamToByteArray(str), format, localeTransferable)
+ .getBytes(DataTransferer.getTextCharset(flavor));
+ } else {
+ theObject = inputStreamToByteArray(str);
+ }
// Target data is an RMI object
} else if (flavor.isRepresentationClassRemote()) {