From 55f7b3a5352728da7bd54f6fdcaacf2068d65b78 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 29 Nov 2017 11:11:00 +0100 Subject: [PATCH] Rename nettyServerCustomizers to serverCustomizers Closes gh-11155 --- .../netty/NettyReactiveWebServerFactory.java | 22 +++++++++---------- .../NettyReactiveWebServerFactoryTests.java | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java index 1991243e9f..ef98a585f7 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java @@ -40,7 +40,7 @@ import org.springframework.util.Assert; */ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFactory { - private List nettyServerCustomizers = new ArrayList<>(); + private List serverCustomizers = new ArrayList<>(); public NettyReactiveWebServerFactory() { } @@ -62,29 +62,29 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact * applied to the Netty server builder. * @return the customizers that will be applied */ - public Collection getNettyServerCustomizers() { - return this.nettyServerCustomizers; + public Collection getServerCustomizers() { + return this.serverCustomizers; } /** * Set {@link NettyServerCustomizer}s that should be applied to the Netty server * builder. Calling this method will replace any existing customizers. - * @param nettyServerCustomizers the customizers to set + * @param serverCustomizers the customizers to set */ - public void setNettyServerCustomizers( - Collection nettyServerCustomizers) { - Assert.notNull(nettyServerCustomizers, "NettyServerCustomizers must not be null"); - this.nettyServerCustomizers = new ArrayList<>(nettyServerCustomizers); + public void setServerCustomizers( + Collection serverCustomizers) { + Assert.notNull(serverCustomizers, "NettyServerCustomizers must not be null"); + this.serverCustomizers = new ArrayList<>(serverCustomizers); } /** * Add {@link NettyServerCustomizer}s that should applied while building the server. * @param nettyServerCustomizer the customizers to add */ - public void addContextCustomizers(NettyServerCustomizer... nettyServerCustomizer) { + public void addServerCustomizers(NettyServerCustomizer... nettyServerCustomizer) { Assert.notNull(nettyServerCustomizer, "NettyWebServerCustomizer must not be null"); - this.nettyServerCustomizers.addAll(Arrays.asList(nettyServerCustomizer)); + this.serverCustomizers.addAll(Arrays.asList(nettyServerCustomizer)); } private HttpServer createHttpServer() { @@ -107,7 +107,7 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact } private void applyCustomizers(Builder options) { - this.nettyServerCustomizers + this.serverCustomizers .forEach((customizer) -> customizer.customize(options)); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java index f0d3c4a249..93e97a1155 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java @@ -64,7 +64,7 @@ public class NettyReactiveWebServerFactoryTests for (int i = 0; i < customizers.length; i++) { customizers[i] = mock(NettyServerCustomizer.class); } - factory.setNettyServerCustomizers(Arrays.asList(customizers[0], customizers[1])); + factory.setServerCustomizers(Arrays.asList(customizers[0], customizers[1])); this.webServer = factory.getWebServer(new EchoHandler()); InOrder ordered = inOrder((Object[]) customizers); for (NettyServerCustomizer customizer : customizers) {