RFR: 8353950: Clipboard interaction on Windows is unstable [v3]
Damon Nguyen
dnguyen at openjdk.org
Mon Jun 2 22:27:57 UTC 2025
On Thu, 29 May 2025 17:13:51 GMT, Matthias Bläsing <mblaesing at openjdk.org> wrote:
>> src/java.desktop/windows/classes/sun/awt/windows/WClipboard.java line 189:
>>
>>> 187: checkChange(formats);
>>> 188: } catch (Throwable ex) {
>>> 189: System.getLogger(WClipboard.class.getName()).log(Level.WARNING, "Failed to process handleContentsChanged", ex);
>>
>> I'm not saying not to necessarily change this, but what are we hoping to see with logging this warning here?
>
> The idea here is to not silently swallow exceptions. This code is called from `AwtToolkit::WndProc`, which from my reading will not report exceptions/throwables. Pushing the exception to the system logger gives a chance to detect problems here.
Sounds reasonable but loggers don't seem to be used in `src` files as far as I can tell. They are used in tests to help detect issues as you mentioned, and I can find plenty of occurrences of loggers used in the `test` directory of the open JDK but I don't see any in `src`. Makes me think there's an alternative way to handle this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24614#discussion_r2122265091
More information about the client-libs-dev
mailing list