Commit 4963cfd6 authored by Andy Wilkinson's avatar Andy Wilkinson

Reset thread's interrupted flag when catching InterruptedException

Closes gh-6360
parent e53d3167
...@@ -66,7 +66,7 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>> ...@@ -66,7 +66,7 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>>
Thread.sleep(500L); Thread.sleep(500L);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Swallow exception and continue Thread.currentThread().interrupt();
} }
ShutdownEndpoint.this.context.close(); ShutdownEndpoint.this.context.close();
} }
......
...@@ -91,7 +91,7 @@ public final class RemoteSpringApplication { ...@@ -91,7 +91,7 @@ public final class RemoteSpringApplication {
Thread.sleep(1000); Thread.sleep(1000);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore Thread.currentThread().interrupt();
} }
} }
} }
......
...@@ -52,7 +52,7 @@ class FileWatchingFailureHandler implements FailureHandler { ...@@ -52,7 +52,7 @@ class FileWatchingFailureHandler implements FailureHandler {
latch.await(); latch.await();
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore Thread.currentThread().interrupt();
} }
return Outcome.RETRY; return Outcome.RETRY;
} }
......
...@@ -239,7 +239,7 @@ public class FileSystemWatcher { ...@@ -239,7 +239,7 @@ public class FileSystemWatcher {
scan(); scan();
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore Thread.currentThread().interrupt();
} }
remainingScans = this.remainingScans.get(); remainingScans = this.remainingScans.get();
} }
......
...@@ -96,7 +96,7 @@ class DelayedLiveReloadTrigger implements Runnable { ...@@ -96,7 +96,7 @@ class DelayedLiveReloadTrigger implements Runnable {
this.liveReloadServer.triggerReload(); this.liveReloadServer.triggerReload();
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore Thread.currentThread().interrupt();
} }
} }
......
...@@ -98,7 +98,7 @@ public class TunnelClient implements SmartInitializingSingleton { ...@@ -98,7 +98,7 @@ public class TunnelClient implements SmartInitializingSingleton {
this.serverThread.join(2000); this.serverThread.join(2000);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore Thread.currentThread().interrupt();
} }
this.serverThread = null; this.serverThread = null;
} }
......
...@@ -273,6 +273,7 @@ public class HttpTunnelServer { ...@@ -273,6 +273,7 @@ public class HttpTunnelServer {
this.httpConnections.wait(HttpTunnelServer.this.longPollTimeout); this.httpConnections.wait(HttpTunnelServer.this.longPollTimeout);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
Thread.currentThread().interrupt();
closeHttpConnections(); closeHttpConnections();
} }
httpConnection = this.httpConnections.pollFirst(); httpConnection = this.httpConnections.pollFirst();
...@@ -442,7 +443,7 @@ public class HttpTunnelServer { ...@@ -442,7 +443,7 @@ public class HttpTunnelServer {
} }
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
// Ignore Thread.currentThread().interrupt();
} }
} }
} }
......
...@@ -252,6 +252,7 @@ public class RandomAccessDataFile implements RandomAccessData { ...@@ -252,6 +252,7 @@ public class RandomAccessDataFile implements RandomAccessData {
: file); : file);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IOException(ex); throw new IOException(ex);
} }
} }
...@@ -276,6 +277,7 @@ public class RandomAccessDataFile implements RandomAccessData { ...@@ -276,6 +277,7 @@ public class RandomAccessDataFile implements RandomAccessData {
} }
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IOException(ex); throw new IOException(ex);
} }
} }
......
...@@ -167,6 +167,7 @@ public class StartMojo extends AbstractRunMojo { ...@@ -167,6 +167,7 @@ public class StartMojo extends AbstractRunMojo {
this.lock.wait(wait); this.lock.wait(wait);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IllegalStateException( throw new IllegalStateException(
"Interrupted while waiting for Spring Boot app to start."); "Interrupted while waiting for Spring Boot app to start.");
} }
...@@ -275,6 +276,7 @@ public class StartMojo extends AbstractRunMojo { ...@@ -275,6 +276,7 @@ public class StartMojo extends AbstractRunMojo {
this.lock.wait(wait); this.lock.wait(wait);
} }
catch (InterruptedException ex) { catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IllegalStateException( throw new IllegalStateException(
"Interrupted while waiting for Spring Boot app to start."); "Interrupted while waiting for Spring Boot app to start.");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment