diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Props.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Props.java index f926d7e6be2..624150959f2 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Props.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Props.java @@ -155,7 +155,7 @@ public final class Props implements Iterable // special case for "$$" if (expanded.indexOf("$$") >= 0) { - return expanded.toString().replace("\\$\\$","\\$"); + return expanded.toString().replaceAll("\\$\\$","\\$"); } return expanded.toString(); diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java index 95dcef379a7..317afc04c95 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/PropsTest.java @@ -68,13 +68,13 @@ public class PropsTest { Props props = new Props(); props.setProperty("name","jetty",FROM_TEST); - props.setProperty("name","projetty","(Pro-Jetty)"); + props.setProperty("name","altjetty","(Alt-Jetty)"); String prefix = "Overriden"; - assertThat(prefix,props.getString("name"),is("projetty")); + assertThat(prefix,props.getString("name"),is("altjetty")); Prop prop = props.getProp("name"); - assertProp(prefix,prop,"name","projetty","(Pro-Jetty)"); + assertProp(prefix,prop,"name","altjetty","(Alt-Jetty)"); Prop older = prop.overrides; assertThat(prefix + ".overrides",older,notNullValue()); assertProp(prefix + ".overridden",older,"name","jetty",FROM_TEST); @@ -97,12 +97,12 @@ public class PropsTest public void testNoExpandDoubleDollar() { Props props = new Props(); - props.setProperty("http.port","8080",FROM_TEST); + props.setProperty("aa","123",FROM_TEST); // Should NOT expand double $$ symbols - assertThat(props.expand("port=$${http.port}"),is("port=$${http.port}")); + assertThat(props.expand("zz=$${aa}"),is("zz=${aa}")); // Should expand - assertThat(props.expand("port=${http.port}"),is("port=8080")); + assertThat(props.expand("zz=${aa}"),is("zz=123")); } @Test