From 7b02055ec654e4e03bf12e784eac2b5b34e15cd4 Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Wed, 13 Dec 2023 17:10:55 +0100 Subject: [PATCH] refactor: remove on of `shareInstance` method in favor of `@JvmOverloads` annotation --- .../com/parsely/parselyandroid/ParselyTracker.kt | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/parsely/src/main/java/com/parsely/parselyandroid/ParselyTracker.kt b/parsely/src/main/java/com/parsely/parselyandroid/ParselyTracker.kt index a6d60770..0b4e0560 100644 --- a/parsely/src/main/java/com/parsely/parselyandroid/ParselyTracker.kt +++ b/parsely/src/main/java/com/parsely/parselyandroid/ParselyTracker.kt @@ -412,18 +412,6 @@ open class ParselyTracker protected constructor(siteId: String, flushInterval: I } else instance } - /** - * Singleton instance factory Note: this must be called before [.sharedInstance] - * - * @param siteId The Parsely public site id (eg "example.com") - * @param c The current Android application context - * @return The singleton instance - */ - @JvmStatic - fun sharedInstance(siteId: String, c: Context): ParselyTracker? { - return sharedInstance(siteId, DEFAULT_FLUSH_INTERVAL_SECS, c) - } - /** * Singleton instance factory Note: this must be called before [.sharedInstance] * @@ -433,7 +421,8 @@ open class ParselyTracker protected constructor(siteId: String, flushInterval: I * @return The singleton instance */ @JvmStatic - fun sharedInstance(siteId: String, flushInterval: Int, c: Context): ParselyTracker? { + @JvmOverloads + fun sharedInstance(siteId: String, flushInterval: Int = DEFAULT_FLUSH_INTERVAL_SECS, c: Context): ParselyTracker? { if (instance == null) { instance = ParselyTracker(siteId, flushInterval, c) }