From b1dd46b9a424ca27f7f770be6561faa84d812e5b Mon Sep 17 00:00:00 2001 From: Violeta Georgieva Date: Tue, 31 Oct 2023 11:12:47 +0200 Subject: [PATCH] [chores] 'static' modifier out of order --- .../src/main/java/reactor/netty/ByteBufFlux.java | 8 ++++---- .../src/main/java/reactor/netty/FutureMono.java | 8 ++++---- .../src/main/java/reactor/netty/ReactorNetty.java | 14 +++++++------- .../netty/resources/NewConnectionProvider.java | 6 +++--- .../netty/resources/PooledConnectionProvider.java | 2 +- .../MicrometerEventLoopMeterRegistrar.java | 4 ++-- .../PooledConnectionProviderCustomMetricsTest.java | 6 +++--- .../src/main/java/reactor/netty/http/Cookies.java | 8 ++++---- .../java/reactor/netty/http/HttpOperations.java | 4 ++-- .../netty/http/client/FailedHttpClientRequest.java | 4 ++-- .../netty/http/client/HttpClientOperations.java | 2 +- .../MicrometerHttpClientMetricsRecorder.java | 4 ++-- .../netty/http/client/UriEndpointFactory.java | 14 +++++++++++--- .../http/client/WebsocketClientOperations.java | 2 +- .../netty/http/server/HttpServerOperations.java | 4 ++-- .../MicrometerHttpServerMetricsRecorder.java | 10 +++++----- .../http/server/WebsocketServerOperations.java | 2 +- .../test/java/reactor/netty/http/Http2Tests.java | 8 ++++---- .../netty/http/HttpMetricsHandlerTests.java | 8 ++++---- .../reactor/netty/http/server/HttpServerTests.java | 14 +++++++------- 20 files changed, 70 insertions(+), 62 deletions(-) diff --git a/reactor-netty-core/src/main/java/reactor/netty/ByteBufFlux.java b/reactor-netty-core/src/main/java/reactor/netty/ByteBufFlux.java index 710cf3d864..62549f47d8 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/ByteBufFlux.java +++ b/reactor-netty-core/src/main/java/reactor/netty/ByteBufFlux.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2011-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ static ByteBufFlux maybeFuse(Flux source, ByteBufAllocator allocator) { /** * A channel object to {@link ByteBuf} transformer */ - final static Function bytebufExtractor = o -> { + static final Function bytebufExtractor = o -> { if (o instanceof ByteBuf) { return (ByteBuf) o; } @@ -363,9 +363,9 @@ static ByteBufFlux maybeFuse(Flux source, ByteBufAllocator allocator) { throw new IllegalArgumentException("Object " + o + " of type " + o.getClass() + " " + "cannot be converted to ByteBuf"); }; - final static int MAX_CHUNK_SIZE = 1024 * 512; //500k + static final int MAX_CHUNK_SIZE = 1024 * 512; //500k - final static Logger log = Loggers.getLogger(ByteBufFlux.class); + static final Logger log = Loggers.getLogger(ByteBufFlux.class); static void safeRelease(ByteBuf byteBuf) { if (byteBuf.refCnt() > 0) { diff --git a/reactor-netty-core/src/main/java/reactor/netty/FutureMono.java b/reactor-netty-core/src/main/java/reactor/netty/FutureMono.java index 6ed480d0fd..65e4e1a516 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/FutureMono.java +++ b/reactor-netty-core/src/main/java/reactor/netty/FutureMono.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2011-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ public static > Mono deferFuture(Supplier deferr return new DeferredFutureMono<>(deferredFuture); } - final static class ImmediateFutureMono> extends FutureMono { + static final class ImmediateFutureMono> extends FutureMono { final F future; @@ -84,7 +84,7 @@ public void subscribe(final CoreSubscriber s) { } } - final static class DeferredFutureMono> extends FutureMono { + static final class DeferredFutureMono> extends FutureMono { final Supplier deferredFuture; @@ -151,7 +151,7 @@ static > void doSubscribe(CoreSubscriber s, } } - final static class FutureSubscription> + static final class FutureSubscription> implements GenericFutureListener, Subscription, Supplier { final CoreSubscriber s; diff --git a/reactor-netty-core/src/main/java/reactor/netty/ReactorNetty.java b/reactor-netty-core/src/main/java/reactor/netty/ReactorNetty.java index dec6b58eb9..e62e9fa3ba 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/ReactorNetty.java +++ b/reactor-netty-core/src/main/java/reactor/netty/ReactorNetty.java @@ -792,7 +792,7 @@ public Mono then() { } } - final static class OutboundIdleStateHandler extends IdleStateHandler { + static final class OutboundIdleStateHandler extends IdleStateHandler { final Runnable onWriteIdle; @@ -811,7 +811,7 @@ protected void channelIdle(ChannelHandlerContext ctx, } } - final static class InboundIdleStateHandler extends IdleStateHandler { + static final class InboundIdleStateHandler extends IdleStateHandler { final Runnable onReadIdle; @@ -830,35 +830,35 @@ protected void channelIdle(ChannelHandlerContext ctx, } } - final static ConnectionObserver.State CONNECTED = new ConnectionObserver.State() { + static final ConnectionObserver.State CONNECTED = new ConnectionObserver.State() { @Override public String toString() { return "[connected]"; } }; - final static ConnectionObserver.State ACQUIRED = new ConnectionObserver.State() { + static final ConnectionObserver.State ACQUIRED = new ConnectionObserver.State() { @Override public String toString() { return "[acquired]"; } }; - final static ConnectionObserver.State CONFIGURED = new ConnectionObserver.State() { + static final ConnectionObserver.State CONFIGURED = new ConnectionObserver.State() { @Override public String toString() { return "[configured]"; } }; - final static ConnectionObserver.State RELEASED = new ConnectionObserver.State() { + static final ConnectionObserver.State RELEASED = new ConnectionObserver.State() { @Override public String toString() { return "[released]"; } }; - final static ConnectionObserver.State DISCONNECTING = new ConnectionObserver.State() { + static final ConnectionObserver.State DISCONNECTING = new ConnectionObserver.State() { @Override public String toString() { return "[disconnecting]"; diff --git a/reactor-netty-core/src/main/java/reactor/netty/resources/NewConnectionProvider.java b/reactor-netty-core/src/main/java/reactor/netty/resources/NewConnectionProvider.java index cb27066fa0..d609c03b12 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/resources/NewConnectionProvider.java +++ b/reactor-netty-core/src/main/java/reactor/netty/resources/NewConnectionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2018-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,9 +51,9 @@ */ final class NewConnectionProvider implements ConnectionProvider { - final static Logger log = Loggers.getLogger(NewConnectionProvider.class); + static final Logger log = Loggers.getLogger(NewConnectionProvider.class); - final static NewConnectionProvider INSTANCE = new NewConnectionProvider(); + static final NewConnectionProvider INSTANCE = new NewConnectionProvider(); @Override public Mono acquire(TransportConfig config, diff --git a/reactor-netty-core/src/main/java/reactor/netty/resources/PooledConnectionProvider.java b/reactor-netty-core/src/main/java/reactor/netty/resources/PooledConnectionProvider.java index edd19aba14..1f127a8408 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/resources/PooledConnectionProvider.java +++ b/reactor-netty-core/src/main/java/reactor/netty/resources/PooledConnectionProvider.java @@ -76,7 +76,7 @@ public abstract class PooledConnectionProvider implements /** * Context key used to propagate the caller event loop in the connection pool subscription. */ - protected final static String CONTEXT_CALLER_EVENTLOOP = "callereventloop"; + protected static final String CONTEXT_CALLER_EVENTLOOP = "callereventloop"; final PoolFactory defaultPoolFactory; final Map> poolFactoryPerRemoteHost = new HashMap<>(); diff --git a/reactor-netty-core/src/main/java/reactor/netty/transport/MicrometerEventLoopMeterRegistrar.java b/reactor-netty-core/src/main/java/reactor/netty/transport/MicrometerEventLoopMeterRegistrar.java index 3b5ce56b36..1dd422a09b 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/transport/MicrometerEventLoopMeterRegistrar.java +++ b/reactor-netty-core/src/main/java/reactor/netty/transport/MicrometerEventLoopMeterRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2021-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ final class MicrometerEventLoopMeterRegistrar { static final String PENDING_TASKS_DESCRIPTION = "Event loop pending scheduled tasks."; - final static MicrometerEventLoopMeterRegistrar INSTANCE = new MicrometerEventLoopMeterRegistrar(); + static final MicrometerEventLoopMeterRegistrar INSTANCE = new MicrometerEventLoopMeterRegistrar(); private final ConcurrentMap cache = new ConcurrentHashMap<>(); diff --git a/reactor-netty-core/src/test/java/reactor/netty/resources/PooledConnectionProviderCustomMetricsTest.java b/reactor-netty-core/src/test/java/reactor/netty/resources/PooledConnectionProviderCustomMetricsTest.java index 777b31c081..968248a015 100644 --- a/reactor-netty-core/src/test/java/reactor/netty/resources/PooledConnectionProviderCustomMetricsTest.java +++ b/reactor-netty-core/src/test/java/reactor/netty/resources/PooledConnectionProviderCustomMetricsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,9 +50,9 @@ class PooledConnectionProviderCustomMetricsTest { private ConnectionProvider pool; - private final static int MAX_ALLOC_SIZE = 100; + private static final int MAX_ALLOC_SIZE = 100; - private final static int MAX_PENDING_ACQUIRE_SIZE = 1000; + private static final int MAX_PENDING_ACQUIRE_SIZE = 1000; @BeforeEach void setUp() { diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/Cookies.java b/reactor-netty-http/src/main/java/reactor/netty/http/Cookies.java index 0532d129bb..b7d44d718e 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/Cookies.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/Cookies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2011-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,9 +63,9 @@ public static Cookies newServerRequestHolder(HttpHeaders headers, ServerCookieDe } - final static int NOT_READ = 0; - final static int READING = 1; - final static int READ = 2; + static final int NOT_READ = 0; + static final int READING = 1; + static final int READ = 2; final HttpHeaders nettyHeaders; final CharSequence cookiesHeaderName; diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/HttpOperations.java b/reactor-netty-http/src/main/java/reactor/netty/http/HttpOperations.java index 4f881c840e..8a9f059665 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/HttpOperations.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/HttpOperations.java @@ -443,11 +443,11 @@ HttpMessage prepareHttpMessage(ByteBuf buffer) { } @SuppressWarnings("rawtypes") - final static AtomicIntegerFieldUpdater HTTP_STATE = + static final AtomicIntegerFieldUpdater HTTP_STATE = AtomicIntegerFieldUpdater.newUpdater(HttpOperations.class, "statusAndHeadersSent"); - final static ChannelInboundHandler HTTP_EXTRACTOR = NettyPipeline.inboundHandler( + static final ChannelInboundHandler HTTP_EXTRACTOR = NettyPipeline.inboundHandler( (ctx, msg) -> { if (msg instanceof ByteBufHolder) { if (msg instanceof FullHttpMessage) { diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/FailedHttpClientRequest.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/FailedHttpClientRequest.java index 03b620850b..f02f60121e 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/client/FailedHttpClientRequest.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/FailedHttpClientRequest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -157,5 +157,5 @@ public HttpVersion version() { return HttpVersion.HTTP_1_1; } - final static String[] EMPTY = new String[0]; + static final String[] EMPTY = new String[0]; } diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientOperations.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientOperations.java index 377d951449..5efb7cac7a 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientOperations.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientOperations.java @@ -124,7 +124,7 @@ class HttpClientOperations extends HttpOperations BiConsumer redirectRequestBiConsumer; volatile Throwable unprocessedOutboundError; - final static String INBOUND_CANCEL_LOG = "Http client inbound receiver cancelled, closing channel."; + static final String INBOUND_CANCEL_LOG = "Http client inbound receiver cancelled, closing channel."; HttpClientOperations(HttpClientOperations replaced) { super(replaced); diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/MicrometerHttpClientMetricsRecorder.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/MicrometerHttpClientMetricsRecorder.java index 2f44cd8849..7ef78840dc 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/client/MicrometerHttpClientMetricsRecorder.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/MicrometerHttpClientMetricsRecorder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2019-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ */ final class MicrometerHttpClientMetricsRecorder extends MicrometerHttpMetricsRecorder implements HttpClientMetricsRecorder { - final static MicrometerHttpClientMetricsRecorder INSTANCE = new MicrometerHttpClientMetricsRecorder(); + static final MicrometerHttpClientMetricsRecorder INSTANCE = new MicrometerHttpClientMetricsRecorder(); private MicrometerHttpClientMetricsRecorder() { super(HTTP_CLIENT_PREFIX, "http"); diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/client/UriEndpointFactory.java b/reactor-netty-http/src/main/java/reactor/netty/http/client/UriEndpointFactory.java index 2c32a529ee..efb2ad05d6 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/client/UriEndpointFactory.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/client/UriEndpointFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2017-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ final class UriEndpointFactory { static final Pattern URL_PATTERN = Pattern.compile( "(?:(\\w+)://)?((?:\\[.+?])|(? connectAddress, boolean defaultSecure, BiFunction inetSocketAddressFunction) { @@ -52,7 +53,7 @@ UriEndpoint createUriEndpoint(String url, boolean isWs, Supplier COMPRESSION_DISABLED = (req, res) -> false; - final static FullHttpResponse CONTINUE = + static final FullHttpResponse CONTINUE = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.CONTINUE, EMPTY_BUFFER); diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/MicrometerHttpServerMetricsRecorder.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/MicrometerHttpServerMetricsRecorder.java index 348210be2f..1fda8ba955 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/MicrometerHttpServerMetricsRecorder.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/MicrometerHttpServerMetricsRecorder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2019-2023 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,10 +51,10 @@ */ final class MicrometerHttpServerMetricsRecorder extends MicrometerHttpMetricsRecorder implements HttpServerMetricsRecorder { - final static MicrometerHttpServerMetricsRecorder INSTANCE = new MicrometerHttpServerMetricsRecorder(); - private final static String PROTOCOL_VALUE_HTTP = "http"; - private final static String ACTIVE_CONNECTIONS_DESCRIPTION = "The number of http connections currently processing requests"; - private final static String ACTIVE_STREAMS_DESCRIPTION = "The number of HTTP/2 streams currently active on the server"; + static final MicrometerHttpServerMetricsRecorder INSTANCE = new MicrometerHttpServerMetricsRecorder(); + private static final String PROTOCOL_VALUE_HTTP = "http"; + private static final String ACTIVE_CONNECTIONS_DESCRIPTION = "The number of http connections currently processing requests"; + private static final String ACTIVE_STREAMS_DESCRIPTION = "The number of HTTP/2 streams currently active on the server"; private final LongAdder activeConnectionsAdder = new LongAdder(); private final LongAdder activeStreamsAdder = new LongAdder(); private final ConcurrentMap activeConnectionsCache = new ConcurrentHashMap<>(); diff --git a/reactor-netty-http/src/main/java/reactor/netty/http/server/WebsocketServerOperations.java b/reactor-netty-http/src/main/java/reactor/netty/http/server/WebsocketServerOperations.java index bb2dfe5086..d4419b8af8 100644 --- a/reactor-netty-http/src/main/java/reactor/netty/http/server/WebsocketServerOperations.java +++ b/reactor-netty-http/src/main/java/reactor/netty/http/server/WebsocketServerOperations.java @@ -65,7 +65,7 @@ final class WebsocketServerOperations extends HttpServerOperations volatile int closeSent; - final static String INBOUND_CANCEL_LOG = "WebSocket server inbound receiver cancelled, closing Websocket."; + static final String INBOUND_CANCEL_LOG = "WebSocket server inbound receiver cancelled, closing Websocket."; @SuppressWarnings("FutureReturnValueIgnored") WebsocketServerOperations(String wsUrl, WebsocketServerSpec websocketServerSpec, HttpServerOperations replaced) { diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/Http2Tests.java b/reactor-netty-http/src/test/java/reactor/netty/http/Http2Tests.java index d19614d5be..20016b42cc 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/Http2Tests.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/Http2Tests.java @@ -66,15 +66,15 @@ * @since 1.0.0 */ class Http2Tests extends BaseHttpTest { - private final static String H2_WITHOUT_TLS_SERVER = "Configured H2 protocol without TLS. Use" + + private static final String H2_WITHOUT_TLS_SERVER = "Configured H2 protocol without TLS. Use" + " a Clear-Text H2 protocol via HttpServer#protocol or configure TLS" + " via HttpServer#secure"; - private final static String H2C_WITH_TLS_SERVER = "Configured H2 Clear-Text protocol with TLS. Use" + + private static final String H2C_WITH_TLS_SERVER = "Configured H2 Clear-Text protocol with TLS. Use" + " the non Clear-Text H2 protocol via HttpServer#protocol or disable TLS" + " via HttpServer#noSSL())"; - private final static String H2_WITHOUT_TLS_CLIENT = "Configured H2 protocol without TLS. Use H2 Clear-Text " + + private static final String H2_WITHOUT_TLS_CLIENT = "Configured H2 protocol without TLS. Use H2 Clear-Text " + "protocol via HttpClient#protocol or configure TLS via HttpClient#secure"; - private final static String H2C_WITH_TLS_CLIENT = "Configured H2 Clear-Text protocol with TLS. " + + private static final String H2C_WITH_TLS_CLIENT = "Configured H2 Clear-Text protocol with TLS. " + "Use the non Clear-Text H2 protocol via HttpClient#protocol or disable TLS " + "via HttpClient#noSSL()"; diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/HttpMetricsHandlerTests.java b/reactor-netty-http/src/test/java/reactor/netty/http/HttpMetricsHandlerTests.java index 8f53d946cd..f98be7d93e 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/HttpMetricsHandlerTests.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/HttpMetricsHandlerTests.java @@ -1578,8 +1578,8 @@ public void recordResolveAddressTime(SocketAddress socketAddress, Duration durat * Metrics are up-to-date when the latch is counted down. */ static final class ResponseSentHandler extends ChannelOutboundHandlerAdapter { - final static String HANDLER_NAME = "ServerCompletedHandler.handler"; - final static ResponseSentHandler INSTANCE = new ResponseSentHandler(); + static final String HANDLER_NAME = "ServerCompletedHandler.handler"; + static final ResponseSentHandler INSTANCE = new ResponseSentHandler(); AtomicReference latchRef; void register(AtomicReference latchRef, ChannelPipeline pipeline) { @@ -1613,8 +1613,8 @@ public boolean isSharable() { * Metrics are up-to-date when the latch is counted down. */ static final class RequestReceivedHandler extends ChannelInboundHandlerAdapter { - final static RequestReceivedHandler INSTANCE = new RequestReceivedHandler(); - final static String HANDLER_NAME = "ServerReceivedHandler.handler"; + static final RequestReceivedHandler INSTANCE = new RequestReceivedHandler(); + static final String HANDLER_NAME = "ServerReceivedHandler.handler"; AtomicReference latchRef; void register(AtomicReference latchRef, ChannelPipeline pipeline) { diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java b/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java index e6ee262895..b670d06a8a 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/server/HttpServerTests.java @@ -180,8 +180,8 @@ class HttpServerTests extends BaseHttpTest { * Server Handler used to send a TLS close_notify after the server last response has been flushed. * The close_notify is sent without closing the connection. */ - final static class SendCloseNotifyAfterLastResponseHandler extends ChannelOutboundHandlerAdapter { - final static String NAME = "handler.send_close_notify_after_response"; + static final class SendCloseNotifyAfterLastResponseHandler extends ChannelOutboundHandlerAdapter { + static final String NAME = "handler.send_close_notify_after_response"; final CountDownLatch latch; SendCloseNotifyAfterLastResponseHandler(CountDownLatch latch) { @@ -212,8 +212,8 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) * any received SslCloseCompletionEvent events. Hence, ChannelOperationsHandler won't get the close_notify ack, * and won't close the channel. */ - final static class IgnoreCloseNotifyHandler extends ChannelInboundHandlerAdapter { - final static String NAME = "handler.ignore_close_notify"; + static final class IgnoreCloseNotifyHandler extends ChannelInboundHandlerAdapter { + static final String NAME = "handler.ignore_close_notify"; static void register(Connection cnx) { cnx.channel().pipeline().addBefore(NettyPipeline.ReactiveBridge, NAME, new IgnoreCloseNotifyHandler()); @@ -231,9 +231,9 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { * Handler used to delay a bit outgoing HTTP/2 server responses. This handler will be placed * at the head of the server channel pipeline. */ - final static class DelayH2FlushHandler extends ChannelOutboundHandlerAdapter { - final static String NAME = "handler.h2flush_delay"; - final static DelayH2FlushHandler INSTANCE = new DelayH2FlushHandler(); + static final class DelayH2FlushHandler extends ChannelOutboundHandlerAdapter { + static final String NAME = "handler.h2flush_delay"; + static final DelayH2FlushHandler INSTANCE = new DelayH2FlushHandler(); static void register(Connection cnx) { Channel channel = cnx.channel();