diff options
Diffstat (limited to 'sonar-plugin-api-impl')
-rw-r--r-- | sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/MapSettings.java | 3 | ||||
-rw-r--r-- | sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/MapSettingsTest.java | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/MapSettings.java b/sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/MapSettings.java index 764eef2812d..4ca59b06733 100644 --- a/sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/MapSettings.java +++ b/sonar-plugin-api-impl/src/main/java/org/sonar/api/config/internal/MapSettings.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.Optional; import org.sonar.api.config.Configuration; import org.sonar.api.config.PropertyDefinitions; +import org.sonar.api.utils.System2; import static java.util.Collections.unmodifiableMap; import static java.util.Objects.requireNonNull; @@ -42,7 +43,7 @@ public class MapSettings extends Settings { private final ConfigurationBridge configurationBridge; public MapSettings() { - this(new PropertyDefinitions()); + this(new PropertyDefinitions(System2.INSTANCE)); } public MapSettings(PropertyDefinitions definitions) { diff --git a/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/MapSettingsTest.java b/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/MapSettingsTest.java index 89845b01dbb..6cf2c86c021 100644 --- a/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/MapSettingsTest.java +++ b/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/MapSettingsTest.java @@ -41,6 +41,7 @@ import org.sonar.api.PropertyType; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.config.PropertyDefinitions; import org.sonar.api.utils.DateUtils; +import org.sonar.api.utils.System2; import static java.util.Collections.singletonList; import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric; @@ -75,7 +76,7 @@ public class MapSettingsTest { @Before public void init_definitions() { - definitions = new PropertyDefinitions(); + definitions = new PropertyDefinitions(System2.INSTANCE); definitions.addComponent(Init.class); } @@ -129,7 +130,7 @@ public class MapSettingsTest { public void set_property_string_throws_NPE_if_key_is_null() { String key = randomAlphanumeric(3); - Settings underTest = new MapSettings(new PropertyDefinitions(singletonList(PropertyDefinition.builder(key).multiValues(true).build()))); + Settings underTest = new MapSettings(new PropertyDefinitions(System2.INSTANCE, singletonList(PropertyDefinition.builder(key).multiValues(true).build()))); expectKeyNullNPE(); @@ -160,7 +161,7 @@ public class MapSettingsTest { public void set_property_string_array_trims_key() { String key = randomAlphanumeric(3); - Settings underTest = new MapSettings(new PropertyDefinitions(singletonList(PropertyDefinition.builder(key).multiValues(true).build()))); + Settings underTest = new MapSettings(new PropertyDefinitions(System2.INSTANCE, singletonList(PropertyDefinition.builder(key).multiValues(true).build()))); Random random = new Random(); String blankBefore = blank(random); |