From 4ca1453858aef971b11feb71719c8915d304c945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Wed, 13 Sep 2023 17:08:06 +0200 Subject: [PATCH] Address review comments, to be squashed with f67f3ba17cc6b086e0c53765c9795cb5d2c720b3 --- .../o.n.bootstrap/src/org/netbeans/NbClipboard.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java b/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java index e15a81937e21..410b6b11a6c0 100644 --- a/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java +++ b/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java @@ -439,12 +439,13 @@ public void run() { for (int i = 0; i < MAX_TRIES; i++) { try { transferable = systemClipboard.getContents(this); - log.log(Level.FINE, "fetching content from system clipboard took {0} tries", i + 1); // NOI18N break; } catch (IllegalStateException ex) { // Throw exception if retries failed if(i == (MAX_TRIES - 1)) { throw ex; + } else { + log.log(Level.INFO, "systemClipboard#getContents threw IllegalStateException (try: {0})", i + 1); // NOI18N } Thread.sleep(20); // Give system time to settle } @@ -462,7 +463,7 @@ public void run() { throw ex; } catch (InterruptedException | RuntimeException ex) { - log.log(Level.FINE, "systemClipboard not available", ex); // NOI18N + log.log(Level.INFO, "systemClipboard not available", ex); // NOI18N } } } @@ -482,7 +483,11 @@ public void run() { systemClipboard.setContents(cnts, ownr); } catch (IllegalStateException e) { //#139616 - log.log(Level.FINE, "systemClipboard not available", e); // NOI18N + if(log.isLoggable(Level.FINE)) { + log.log(Level.FINE, "systemClipboard not available", e); // NOI18N + } else { + log.log(Level.INFO, "systemClipboard#setContents threw IllegalStateException"); // NOI18N + } scheduleSetContents(cnts, ownr, 100); return; }