diff --git a/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java b/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java index 410b6b11a6c0..7d44bc5d88c1 100644 --- a/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java +++ b/platform/o.n.bootstrap/src/org/netbeans/NbClipboard.java @@ -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