Skip to content

Commit

Permalink
handle unhandled InterruptedException
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed May 20, 2024
1 parent 5a75aff commit 7d74296
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public void run() {
final BufferedImage newImg1 = newImg;
EventQueue.invokeLater(() -> loadItem._mfsImage.setImage(loadItem._uri, newImg1, wasScaled));
}
} catch (InterruptedException e) {
//
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ public void repaintRequested(final boolean doLayout) {
repaintRequestPending = false;
});
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
}
}).start();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ private boolean checkDocument() {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return false;
}
} catch (ClassCastException cce) {
Expand Down
6 changes: 3 additions & 3 deletions flying-saucer-examples/nomaven/misc/src/main/java/Review.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ public synchronized void waitForFlag() {
while (!isSet) {
try {
wait();
} catch (InterruptedException ie) {
// swallow
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
}
}
}
Expand All @@ -421,4 +421,4 @@ public synchronized void interruptibleWaitForFlag()
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public void createEvents() {
final String text = used + "M / " + total + "M";
SwingUtilities.invokeLater(() -> memory.setText(text));
Thread.sleep(5000);
} catch (InterruptedException e) {
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public synchronized void run() {
}
});
wait(REFRESH_INTERVAL);
} catch (InterruptedException e) {
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void run() {
while (queue.isEmpty()) {
try {
queue.wait();
} catch (InterruptedException e) {
// ignore
} catch (InterruptedException ignore) {
Thread.currentThread().interrupt();
}
task = (Runnable) queue.removeFirst();
try {
Expand Down

0 comments on commit 7d74296

Please sign in to comment.