You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/06/27 21:50:02 UTC

[solr] branch main updated: SOLR-16241: Fix JettyConfig.builder(JettyConfig) to correctly copy all attributes

This is an automated email from the ASF dual-hosted git repository.

hossman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 4bd33e8b01a SOLR-16241: Fix JettyConfig.builder(JettyConfig) to correctly copy all attributes
4bd33e8b01a is described below

commit 4bd33e8b01a80242adc77e52e26563ea4b432224
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Mon Jun 27 14:49:50 2022 -0700

    SOLR-16241: Fix JettyConfig.builder(JettyConfig) to correctly copy all attributes
---
 solr/CHANGES.txt                                    |  2 ++
 .../solr/client/solrj/embedded/JettyConfig.java     | 21 ++++++++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 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.java
index 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 support
   public 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;
   }