From 260cd97ae17461dc6291728269622f17d47c2af7 Mon Sep 17 00:00:00 2001 From: Violeta Georgieva Date: Thu, 2 Jun 2022 12:56:18 +0300 Subject: [PATCH] Fix checkstyle warnings --- .../http/client/AbstractHttpClientMetricsHandler.java | 9 ++++++--- .../http/server/AbstractHttpServerMetricsHandler.java | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/AbstractHttpClientMetricsHandler.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/AbstractHttpClientMetricsHandler.java index 6f95fd74a0..d6244114b3 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/client/AbstractHttpClientMetricsHandler.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/AbstractHttpClientMetricsHandler.java @@ -91,7 +91,8 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) promise.addListener(future -> { try { recordWrite(address); - } catch (RuntimeException e) { + } + catch (RuntimeException e) { log.warn("Exception caught while recording metrics.", e); // Allow request-response exchange to continue, unaffected by metrics problem } @@ -116,7 +117,8 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { recordRead(ctx.channel().remoteAddress()); reset(); } - } catch (RuntimeException e) { + } + catch (RuntimeException e) { log.warn("Exception caught while recording metrics.", e); // Allow request-response exchange to continue, unaffected by metrics problem } @@ -127,7 +129,8 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { try { recordException(ctx); - } catch (RuntimeException e) { + } + catch (RuntimeException e) { log.warn("Exception caught while recording metrics.", e); // Allow request-response exchange to continue, unaffected by metrics problem } diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java index b954202029..f87c1a3749 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/AbstractHttpServerMetricsHandler.java @@ -31,7 +31,6 @@ import reactor.util.annotation.Nullable; import java.time.Duration; -import java.util.function.Consumer; import java.util.function.Function; /** @@ -115,7 +114,8 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) recordInactiveConnection(ops); } } - } catch (RuntimeException e) { + } + catch (RuntimeException e) { log.warn("Exception caught while recording metrics.", e); // Allow request-response exchange to continue, unaffected by metrics problem } @@ -154,7 +154,8 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { dataReceived = 0; } - } catch (RuntimeException e) { + } + catch (RuntimeException e) { log.warn("Exception caught while recording metrics.", e); // Allow request-response exchange to continue, unaffected by metrics problem } @@ -171,7 +172,8 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { // Always take the remote address from the operations in order to consider proxy information recordException(ops, uriTagValue == null ? ops.path : uriTagValue.apply(ops.path)); } - } catch (RuntimeException e) { + } + catch (RuntimeException e) { log.warn("Exception caught while recording metrics.", e); // Allow request-response exchange to continue, unaffected by metrics problem }