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 14, 2023
1 parent 4ca1453 commit ffe687f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,14 @@ public void run() {
// indefinitely. Running the access loop here is deemed similar
// in nature.
final int MAX_TRIES = 50;
final long start = System.currentTimeMillis();
for (int i = 0; i < MAX_TRIES; i++) {
try {
transferable = systemClipboard.getContents(this);
break;
} catch (IllegalStateException ex) {
// Throw exception if retries failed
if(i == (MAX_TRIES - 1)) {
if (i == (MAX_TRIES - 1) || (System.currentTimeMillis() - start) > 980L) {
throw ex;
} else {
log.log(Level.INFO, "systemClipboard#getContents threw IllegalStateException (try: {0})", i + 1); // NOI18N
Expand Down

0 comments on commit ffe687f

Please sign in to comment.