diff --git a/src/main/java/io/split/android/client/SplitFactoryHelper.java b/src/main/java/io/split/android/client/SplitFactoryHelper.java index 6541a05e7..4550db1ab 100644 --- a/src/main/java/io/split/android/client/SplitFactoryHelper.java +++ b/src/main/java/io/split/android/client/SplitFactoryHelper.java @@ -427,6 +427,15 @@ Pair, String> getFilterConfiguration(SyncConf return new Pair<>(groupedFilters, splitsFilterQueryString); } + @Nullable + FlagSetsFilter getFlagSetsFilter(Map filters) { + if (filters.get(SplitFilter.Type.BY_SET) != null) { + return new FlagSetsFilterImpl(filters.get(SplitFilter.Type.BY_SET).getValues()); + } + + return null; + } + private TelemetryStorage getTelemetryStorage(boolean shouldRecordTelemetry, TelemetryStorage telemetryStorage) { if (telemetryStorage != null) { return telemetryStorage; diff --git a/src/main/java/io/split/android/client/SplitFactoryImpl.java b/src/main/java/io/split/android/client/SplitFactoryImpl.java index e798dcdcd..2f67145d8 100644 --- a/src/main/java/io/split/android/client/SplitFactoryImpl.java +++ b/src/main/java/io/split/android/client/SplitFactoryImpl.java @@ -7,10 +7,8 @@ import java.net.URISyntaxException; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import io.split.android.client.api.Key; import io.split.android.client.common.CompressionUtilProvider; @@ -180,10 +178,7 @@ public void taskExecuted(@NonNull SplitTaskExecutionInfo taskInfo) { SplitApiFacade splitApiFacade = factoryHelper.buildApiFacade( config, defaultHttpClient, splitsFilterQueryStringFromConfig); - FlagSetsFilter flagSetsFilter = null; - if (filters.get(SplitFilter.Type.BY_SET) != null) { - flagSetsFilter = new FlagSetsFilterImpl(filters.get(SplitFilter.Type.BY_SET).getValues()); - } + FlagSetsFilter flagSetsFilter = factoryHelper.getFlagSetsFilter(filters); SplitTaskFactory splitTaskFactory = new SplitTaskFactoryImpl( config, splitApiFacade, mStorageContainer, splitsFilterQueryStringFromConfig, mEventsManagerCoordinator,