From 0864bc8104c8f334d4a52d56cf874450d90deb16 Mon Sep 17 00:00:00 2001 From: Dennis Guse Date: Tue, 10 Sep 2019 20:49:47 +0200 Subject: [PATCH] Cleaned up ContentProviderUtils's factory pattern. --- .../content/ContentProviderUtils.java | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/src/main/java/de/dennisguse/opentracks/content/ContentProviderUtils.java b/src/main/java/de/dennisguse/opentracks/content/ContentProviderUtils.java index 778c1a142..8d1f969ff 100644 --- a/src/main/java/de/dennisguse/opentracks/content/ContentProviderUtils.java +++ b/src/main/java/de/dennisguse/opentracks/content/ContentProviderUtils.java @@ -353,45 +353,14 @@ public interface ContentProviderUtils { /** * A factory which can produce instances of {@link ContentProviderUtils}, and can be overridden for testing. */ - //TODO Is this still used? From a quick glance, it doesn't looks like it; probably a left over from testing. - @Deprecated class Factory { - private static Factory instance = new Factory(); - /** * Creates an instance of {@link ContentProviderUtils}. * * @param context the context */ public static ContentProviderUtils get(Context context) { - return instance.newForContext(context); - } - - /** - * Returns the factory instance. - */ - public static Factory getInstance() { - return instance; - } - - /** - * Overrides the factory instance for testing. - * Don't forget to set it back to the original value after testing. - * - * @param factory the factory - */ - public static void overrideInstance(Factory factory) { - instance = factory; - } - - /** - * Creates an instance of {@link ContentProviderUtils}. Allows subclasses - * to override for testing. - * - * @param context the context - */ - private ContentProviderUtils newForContext(Context context) { return new ContentProviderUtilsImpl(context.getContentResolver()); } }