提交 e506f19d 编写于 作者: B bagiras

8027151: AWT_DnD/Basic_DnD/Automated/DnDMerlinQL/MultipleJVM failing on windows machine

Reviewed-by: anthony, pchelko
上级 54c17d29
/*
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -1740,6 +1740,14 @@ search:
}
theObject = files;
// Target data is a String. Strip terminating NUL bytes. Decode bytes
// into characters. Search-and-replace EOLN.
} else if (String.class.equals(flavor.getRepresentationClass()) &&
isFlavorCharsetTextType(flavor) && isTextFormat(format)) {
return translateBytesToString(inputStreamToByteArray(str),
format, localeTransferable);
// Special hack to maintain backwards-compatibility with the brokenness
// of StringSelection. Return a StringReader instead of an InputStream.
// Recur to obtain String and encapsulate.
......
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -271,14 +271,11 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
throw new InvalidDnDOperationException(e.getMessage());
}
} else if (ret instanceof InputStream) {
InputStream inputStream = (InputStream)ret;
try {
return DataTransferer.getInstance().
translateStream(inputStream, df, format, this);
translateStream((InputStream)ret, df, format, this);
} catch (IOException e) {
throw new InvalidDnDOperationException(e.getMessage());
} finally {
inputStream.close();
}
} else {
throw new IOException("no native data was transfered");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册