-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The current implementation of the NamespaceSupplier does not allow null namespace to be supplied for a single-tenant supplier, while it does allow to create a single-tenant supplier with no args that creates the supplier with null namespace internally:
public static NamespaceSupplier singleTenant(String defaultNamespace) {
checkNotNull(defaultNamespace);
return new SingleTenantNamespaceSupplier(defaultNamespace);
}
public static NamespaceSupplier singleTenant() {
return new SingleTenantNamespaceSupplier(null);
}
It's not clear why such a decision was made because internally, DsStorage forces all null values to be converted to empty strings, which the SingletenantNamespaceSupplier also does inside its constructor.
While the SingleTenantNamespaceSupplier accepts null values in the constructor, it's making things more complicated for ones who want to create their storage implementations and use the NamespaceSupplier.
The proposed solution is to remove the checkNotNull check while the SingletenantNamespaceSupplier handles null values gracefully.