diff --git a/modules/dcache/src/main/java/org/dcache/util/ConfigurationProperties.java b/modules/dcache/src/main/java/org/dcache/util/ConfigurationProperties.java index aa37c40eff1..fe2d4aa7efe 100644 --- a/modules/dcache/src/main/java/org/dcache/util/ConfigurationProperties.java +++ b/modules/dcache/src/main/java/org/dcache/util/ConfigurationProperties.java @@ -271,6 +271,9 @@ protected void checkIsAllowed(AnnotatedKey key, String value) if (existingKey != null) { checkKeyValid(existingKey, key); checkDataValid(existingKey, value); + } else if (name.indexOf('/') > -1) { + _problemConsumer.error( + "Property " + name + " is a scoped property. Scoped properties are no longer supported."); } else if (!_usageChecker.isStandardProperty(defaults, name)) { // TODO: It would be nice if we could check whether the property is actually // used, ie if it appears as part of the value of a standard property. To do this diff --git a/modules/dcache/src/test/java/org/dcache/util/ConfigurationPropertiesTests.java b/modules/dcache/src/test/java/org/dcache/util/ConfigurationPropertiesTests.java index 697e90034d6..17813b9f570 100644 --- a/modules/dcache/src/test/java/org/dcache/util/ConfigurationPropertiesTests.java +++ b/modules/dcache/src/test/java/org/dcache/util/ConfigurationPropertiesTests.java @@ -93,6 +93,8 @@ public class ConfigurationPropertiesTests { private static final String EXPANDING_PROPERTY_NAME = "expanding-key"; + private static final String SCOPED_PROPERTY_NAME = "scoped/property"; + private ConfigurationProperties _properties; private ConfigurationProperties _initiallyEmptyProperties; private ConfigurationProperties _standardProperties; @@ -295,6 +297,11 @@ public void testForbiddenWithErrorPropertyPut() { } } + @Test(expected = IllegalArgumentException.class) + public void testScopedPropertyPut() { + _properties.put(SCOPED_PROPERTY_NAME, "some value"); + } + @Test public void testStringPropertyNames() {