diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java index 0104ef388c8..9d7ab5f9e77 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/InetAccessHandler.java @@ -34,6 +34,7 @@ import org.eclipse.jetty.util.IncludeExclude; import org.eclipse.jetty.util.IncludeExcludeSet; import org.eclipse.jetty.util.InetAddressSet; import org.eclipse.jetty.util.component.Dumpable; +import org.eclipse.jetty.util.component.DumpableCollection; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -202,9 +203,9 @@ public class InetAccessHandler extends HandlerWrapper public void dump(Appendable out, String indent) throws IOException { dumpObjects(out, indent, - Dumpable.labelled("included", _addrs.getIncluded()), - Dumpable.labelled("excluded", _addrs.getExcluded()), - Dumpable.labelled("includedConnectorNames", _names.getIncluded()), - Dumpable.labelled("excludedConnectorNames", _names.getExcluded())); + new DumpableCollection("included", _addrs.getIncluded()), + new DumpableCollection("excluded", _addrs.getExcluded()), + new DumpableCollection("includedConnectorNames", _names.getIncluded()), + new DumpableCollection("excludedConnectorNames", _names.getExcluded())); } } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/component/DumpableCollectionTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/component/DumpableTest.java similarity index 86% rename from jetty-util/src/test/java/org/eclipse/jetty/util/component/DumpableCollectionTest.java rename to jetty-util/src/test/java/org/eclipse/jetty/util/component/DumpableTest.java index ee696868d9b..d5dc6b07e04 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/component/DumpableCollectionTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/component/DumpableTest.java @@ -26,9 +26,8 @@ import java.util.Collection; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -public class DumpableCollectionTest +public class DumpableTest { - @Test public void testNullDumpableCollection () throws Exception { @@ -51,4 +50,13 @@ public class DumpableCollectionTest assertThat(dump, Matchers.containsString("two")); assertThat(dump, Matchers.containsString("three")); } + + @Test + public void testDumpableLabelled() throws Exception + { + String dump = Dumpable.labelled("label", "Item").dump(); + assertThat(dump, Matchers.containsString("label:")); + assertThat(dump, Matchers.containsString("Item")); + } + }