change getProperty(key, default) and add unit test

This commit is contained in:
Armin Schrenk
2023-06-30 10:57:12 +02:00
parent 79eea4814e
commit ab048508a8
2 changed files with 16 additions and 7 deletions

View File

@@ -29,12 +29,8 @@ public class SubstitutingProperties extends PropertiesDecorator {
@Override
public String getProperty(String key, String defaultValue) {
var value = delegate.getProperty(key, defaultValue);
if (key.startsWith("cryptomator.") && value != null) {
return process(value);
} else {
return value;
}
var result = getProperty(key);
return result != null ? result : defaultValue;
}
//visible for testing