Skip to content

NamespaceSupplier does not allow null namespace #137

@yuri-sergiichuk

Description

@yuri-sergiichuk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions