On Thu, 29 May 2025 17:13:51 GMT, Matthias Bläsing <[email protected]>
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