<AWT Dev> RFR [16] 8246248: TransferHandler.exportToClipboard prints stacktrace even if succeeded
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Mon Jul 20 15:53:40 UTC 2020
+1
On 14.07.2020 00:01, Suman Rajkumaar Kodandarama wrote:
> Dear Sergey,
>
> Hope you are doing fine. Sorry, for the delayed reply.
>
> Firstly, as the issue was observed with JPEG flavor with alpha component, I have tested with regular JPEG image (without alpha) and the image was copied onto the clipboard and no exception was thrown as expected.
>
> Secondly, tested with JPEG flavor with alpha, there was no JPEG flavor copied onto the clipboard as the support was removed/dropped and the IOException is thrown as expected and is logged into the logger (seen after enabling the logging). Please find the attached file for reference. Please search for the log message "WARNING: Registered service providers failed to encode".
>
> Also, there are datatransfer tests available which was run and there were no new failures observed.
>
> This fix doesn't change any of the functionalities rather, cleans up the code and logs the exception to the logger instead of printing the same on the console.
>
> Best Regards,
> K Suman Rajkumaar
>
> On 09/07/2020 15:11, Sergey Bylokhov wrote:
>> Hi, Suman.
>>
>> Is it possible to write a test case which triggers this exception and also check that
>> after the fix the clipboard copy operation still works with/without alpha component.
>>
>>
>> On 07.07.2020 07:49, Suman Rajkumaar Kodandarama wrote:
>>> Hello All,
>>>
>>> Could you review a fix for the JDK 16, please?
>>>
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8246248
>>>
>>> webrev: http://cr.openjdk.java.net/~dmarkov/suman/8246248/webrev.00/
>>>
>>> Problem description:When copying an image with alpha component to the clipboard, IOException occurs and its stack trace is printed to the console. The IOException is thrown because JPEG flavor does not support alpha, which it has been dropped in JDK-8204187.
>>>
>>> Fix: Instead of printing the exception on the standard console, the fix replaces printing the stack trace of any exception that may occur while placing data to the clipboard with logging.
>>>
>>> Best Regards,
>>> K Suman Rajkumaar
>>
>>
--
Best regards, Sergey.
More information about the awt-dev
mailing list