diff --git a/dev/core/src/com/google/gwt/dev/cfg/ConfigurationProperties.java b/dev/core/src/com/google/gwt/dev/cfg/ConfigurationProperties.java index fe955ed6852..d5362530e6b 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ConfigurationProperties.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ConfigurationProperties.java @@ -141,17 +141,6 @@ public List getStrings(String key) { return properties.get(key); } - /** - * Returns all the values of a multi-valued configuration property, or null - * if not found. - * - *

A single-valued and unset configuration property will be returned as a list - * containing one null. - */ - public List getStringsOrNull(String key) { - return properties.get(key); - } - /** * Reads a configuration property as a comma-separated list of strings. * It may be a single-valued or multi-valued property. If multi-valued, diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/ResolvePermutationDependentValues.java b/dev/core/src/com/google/gwt/dev/jjs/impl/ResolvePermutationDependentValues.java index 1ced427faca..515e9d5df46 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/ResolvePermutationDependentValues.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/ResolvePermutationDependentValues.java @@ -47,7 +47,6 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Set; /** @@ -75,20 +74,13 @@ public void endVisit(JPermutationDependentValue x, Context ctx) { } private JExpression propertyValueExpression(JPermutationDependentValue x) { - List propertyValues = props.getConfigurationProperties() - .getStringsOrNull(x.getRequestedValue()); - if (propertyValues != null) { + List propertyValues = props.getConfigurationProperties().getStrings(x.getRequestedValue()); + + String propertyValue = propertyValues.isEmpty() ? null : Joiner.on(",").join(propertyValues); + + if (propertyValue != null) { // It is a configuration property. - // If no values are set, propertyValues is either empty (multivalued properties) - // or contains a single null (other properties). - if (propertyValues.stream().anyMatch(Objects::nonNull)) { - return program.getLiteral(x.getSourceInfo(), - Joiner.on(",").skipNulls().join(propertyValues)); - } - if (x.getDefaultValueExpression() != null) { - return x.getDefaultValueExpression(); - } - return program.getLiteralNull(); + return program.getLiteral(x.getSourceInfo(), propertyValue); } if (isSoftPermutationProperty(x.getRequestedValue())) { @@ -96,7 +88,7 @@ private JExpression propertyValueExpression(JPermutationDependentValue x) { return new JMethodCall(x.getSourceInfo(), null, method); } - String propertyValue = commonPropertyAndBindingInfo.getPropertyValue(x.getRequestedValue()); + propertyValue = commonPropertyAndBindingInfo.getPropertyValue(x.getRequestedValue()); if (propertyValue != null) { return program.getLiteral(x.getSourceInfo(), propertyValue); diff --git a/user/test/com/google/gwt/dev/jjs/SystemGetPropertyTest.gwt.xml b/user/test/com/google/gwt/dev/jjs/SystemGetPropertyTest.gwt.xml index b8a69a301f3..f307fdb4644 100644 --- a/user/test/com/google/gwt/dev/jjs/SystemGetPropertyTest.gwt.xml +++ b/user/test/com/google/gwt/dev/jjs/SystemGetPropertyTest.gwt.xml @@ -33,6 +33,4 @@ - - \ No newline at end of file diff --git a/user/test/com/google/gwt/dev/jjs/test/SystemGetPropertyTest.java b/user/test/com/google/gwt/dev/jjs/test/SystemGetPropertyTest.java index 0b390e05832..696978a3388 100644 --- a/user/test/com/google/gwt/dev/jjs/test/SystemGetPropertyTest.java +++ b/user/test/com/google/gwt/dev/jjs/test/SystemGetPropertyTest.java @@ -36,9 +36,5 @@ public void testBindingProperties() { String expectedResult = "safari".equals(System.getProperty("user.agent")) ? "InSafari" : "NotInSafari"; assertEquals(expectedResult, System.getProperty("someDynamicProperty")); - assertEquals("foo", System.getProperty("configPropertyUnset", "foo")); - assertNull(System.getProperty("configPropertyUnset")); - assertEquals("foo", System.getProperty("multivaluedConfigPropertyUnset", "foo")); - assertNull(System.getProperty("multivaluedConfigPropertyUnset")); } }