From d5fa16775ff3156bbbbd1583b1171e273614b6ca Mon Sep 17 00:00:00 2001 From: cyBerta Date: Tue, 3 Dec 2024 02:04:15 +0100 Subject: replace switch with if condition in ProviderApiManagerFactory --- .../bitmaskclient/providersetup/ProviderApiManagerFactory.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java index b6c1c955..3eae410f 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/ProviderApiManagerFactory.java @@ -16,12 +16,10 @@ public class ProviderApiManagerFactory { } public IProviderApiManager getProviderApiManager(Provider provider) throws IllegalArgumentException { - switch (provider.getApiVersion()) { - case 5: - return new ProviderApiManagerV5(resources, callback); - default: - OkHttpClientGenerator clientGenerator = new OkHttpClientGenerator(resources); - return new ProviderApiManagerV3(resources, clientGenerator, callback); + if (provider.getApiVersion() >= 5) { + return new ProviderApiManagerV5(resources, callback); } + OkHttpClientGenerator clientGenerator = new OkHttpClientGenerator(resources); + return new ProviderApiManagerV3(resources, clientGenerator, callback); } } -- cgit v1.2.3