From 20254f02d2ed962753bbd00e0c6d9455dd246713 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Mon, 29 Jun 2020 15:42:34 +0200 Subject: [PATCH] Polishing --- .../web/reactive/function/server/RouterFunctionBuilder.java | 4 ++-- .../web/servlet/function/RouterFunctionBuilder.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctionBuilder.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctionBuilder.java index aa751f490e..07d3c2c5f3 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctionBuilder.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctionBuilder.java @@ -266,11 +266,11 @@ class RouterFunctionBuilder implements RouterFunctions.Builder { */ private static class BuiltRouterFunction extends RouterFunctions.AbstractRouterFunction { - private List> routerFunctions; + private final List> routerFunctions; public BuiltRouterFunction(List> routerFunctions) { Assert.notEmpty(routerFunctions, "RouterFunctions must not be empty"); - this.routerFunctions = routerFunctions; + this.routerFunctions = new ArrayList<>(routerFunctions); } @Override diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctionBuilder.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctionBuilder.java index cc23d0144c..37a06fe972 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctionBuilder.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/RouterFunctionBuilder.java @@ -261,11 +261,11 @@ class RouterFunctionBuilder implements RouterFunctions.Builder { */ private static class BuiltRouterFunction extends RouterFunctions.AbstractRouterFunction { - private List> routerFunctions; + private final List> routerFunctions; public BuiltRouterFunction(List> routerFunctions) { Assert.notEmpty(routerFunctions, "RouterFunctions must not be empty"); - this.routerFunctions = routerFunctions; + this.routerFunctions = new ArrayList<>(routerFunctions); } @Override