Skip to content

Commit

Permalink
Address review comments, to be squashed with f67f3ba
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasblaesing committed Sep 13, 2023
1 parent d3dd6c4 commit 4ca1453
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
}
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 4ca1453

Please sign in to comment.