Apache Solr open-source search software
SOLR-16241: Fix JettyConfig.builder(JettyConfig) to correctly copy all attributes
Chris Hostetter4bd33e8b01a8
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 6f9964f5e63..1210d2dabef 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -91,6 +91,8 @@ Bug Fixes* SOLR-16259: Missing newline at the end of solr.in.sh breaks the installer. (John Gately via Shawn Heisey)+* SOLR-16241: Fix JettyConfig.builder(JettyConfig) to correctly copy all attributes (hossman)+Other Changes---------------------* SOLR-15897: Remove <jmx/> from all unit test solrconfig.xml files. (Eric Pugh)diff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettyConfig.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettyConfig.javaindex b61a534c4b3..5b442d0135c 100644--- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettyConfig.java+++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettyConfig.java@@ -24,26 +24,16 @@ import org.eclipse.jetty.servlet.ServletHolder;public class JettyConfig {- // by default jetty will start with http2 + http1 supportpublic final boolean onlyHttp1;-public final int port;-+ public final int portRetryTime;public final String context;-- public final boolean enableV2;-public final boolean stopAtShutdown;-public final Long waitForLoadingCoresToFinishMs;-public final Map<ServletHolder, String> extraServlets;-public final Map<Class<? extends Filter>, String> extraFilters;-public final SSLConfig sslConfig;-- public final int portRetryTime;+ public final boolean enableV2;private JettyConfig(boolean onlyHttp1,@@ -58,13 +48,13 @@ public class JettyConfig {boolean enableV2) {this.onlyHttp1 = onlyHttp1;this.port = port;+ this.portRetryTime = portRetryTime;this.context = context;this.stopAtShutdown = stopAtShutdown;this.waitForLoadingCoresToFinishMs = waitForLoadingCoresToFinishMs;this.extraServlets = extraServlets;this.extraFilters = extraFilters;this.sslConfig = sslConfig;- this.portRetryTime = portRetryTime;this.enableV2 = enableV2;}@@ -74,12 +64,17 @@ public class JettyConfig {public static Builder builder(JettyConfig other) {Builder builder = new Builder();++ builder.onlyHttp1 = other.onlyHttp1;builder.port = other.port;+ builder.portRetryTime = other.portRetryTime;builder.context = other.context;builder.stopAtShutdown = other.stopAtShutdown;+ builder.waitForLoadingCoresToFinishMs = other.waitForLoadingCoresToFinishMs;builder.extraServlets = other.extraServlets;builder.extraFilters = other.extraFilters;builder.sslConfig = other.sslConfig;+ builder.enableV2 = other.enableV2;return builder;}