Skip to content

Commit 84af758

Browse files
committed
Minor lint fixes throughout the project
1 parent 960b07f commit 84af758

23 files changed

Lines changed: 59 additions & 49 deletions

File tree

descopesdk/src/main/java/com/descope/Descope.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@file:Suppress("MemberVisibilityCanBePrivate", "unused")
1+
@file:Suppress("MemberVisibilityCanBePrivate", "unused", "DEPRECATION")
22

33
package com.descope
44

descopesdk/src/main/java/com/descope/android/DescopeFlow.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.android
24

35
import android.content.Context

descopesdk/src/main/java/com/descope/android/DescopeFlowCoordinator.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ internal fun findJwtInCookies(cookieString: String?, name: String): String? {
642642
cookieString?.split("; ")?.forEach {
643643
try {
644644
addAll(HttpCookie.parse(it))
645-
} catch (ignored: Exception) {
645+
} catch (_: Exception) {
646646
}
647647
}
648648
}
@@ -651,7 +651,7 @@ internal fun findJwtInCookies(cookieString: String?, name: String): String? {
651651
.mapNotNull { httpCookie -> // parse token
652652
try {
653653
Token(httpCookie.value)
654-
} catch (e: Exception) {
654+
} catch (_: Exception) {
655655
null
656656
}
657657
}
@@ -663,7 +663,7 @@ internal fun findJwtInCookies(cookieString: String?, name: String): String? {
663663
private fun String.toUri(): Uri? {
664664
return try {
665665
Uri.parse(this)
666-
} catch (ignored: Exception) {
666+
} catch (_: Exception) {
667667
null
668668
}
669669
}

descopesdk/src/main/java/com/descope/android/DescopeFlowHook.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.android
24

35
import android.webkit.WebView

descopesdk/src/main/java/com/descope/android/DescopeFlowView.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.android
24

35
import android.content.Context
@@ -157,7 +159,7 @@ class DescopeFlowView : ViewGroup {
157159
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
158160
for (i in 0 until childCount) {
159161
val child = getChildAt(i)
160-
child.layout(0, 0, width, height);
162+
child.layout(0, 0, width, height)
161163
}
162164
}
163165

descopesdk/src/main/java/com/descope/android/Utils.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package com.descope.android
33
import android.content.Context
44
import android.net.Uri
55
import androidx.browser.customtabs.CustomTabsIntent
6+
import androidx.core.net.toUri
67
import com.descope.internal.others.activityHelper
78

89
// Custom Tab
910

1011
fun launchCustomTab(context: Context, url: String, customTabsIntent: CustomTabsIntent? = null) {
11-
launchCustomTab(context, Uri.parse(url), customTabsIntent)
12+
launchCustomTab(context, url.toUri(), customTabsIntent)
1213
}
1314

1415
fun launchCustomTab(context: Context, uri: Uri, customTabsIntent: CustomTabsIntent? = null) {

descopesdk/src/main/java/com/descope/extensions/URLConnection.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package com.descope.extensions
24

35
import com.descope.session.DescopeSession

descopesdk/src/main/java/com/descope/internal/http/HttpClient.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.descope.internal.http
22

3-
import android.net.Uri
3+
import androidx.core.net.toUri
44
import com.descope.internal.others.debug
55
import com.descope.internal.others.error
66
import com.descope.internal.others.info
@@ -118,7 +118,7 @@ internal open class HttpClient(
118118
private fun makeUrl(route: String, params: Map<String, String?>): URL {
119119
val composed = "$baseUrl$basePath$route"
120120
val urlString = if (params.isNotEmpty()) {
121-
Uri.parse(composed).buildUpon().apply {
121+
composed.toUri().buildUpon().apply {
122122
params
123123
.filterValues { it != null }
124124
.forEach { appendQueryParameter(it.key, it.value) }
@@ -135,7 +135,7 @@ private val Map<String, List<String>>.cookies: List<HttpCookie>
135135
this[key]?.forEach {
136136
try {
137137
cookies.addAll(HttpCookie.parse(it))
138-
} catch (ignored: Exception) {}
138+
} catch (_: Exception) {}
139139
}
140140
}
141141
return cookies.toList()

descopesdk/src/main/java/com/descope/internal/http/SystemInfo.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ internal class DescopeSystemInfo private constructor(context: Context) : SystemI
1414

1515
override val appName: String? = try {
1616
context.applicationInfo.loadLabel(context.packageManager).toString()
17-
} catch (ignored: Exception) {
17+
} catch (_: Exception) {
1818
null
1919
}
2020

2121
override val appVersion: String? = try {
2222
context.packageManager.getPackageInfo(context.packageName, 0)?.versionName
23-
} catch (ignored: Exception) {
23+
} catch (_: Exception) {
2424
null
2525
}
2626

descopesdk/src/main/java/com/descope/internal/others/Utils.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal fun ByteArray.toBase64(): String {
1919

2020
internal fun JSONObject.stringOrEmptyAsNull(key: String): String? = try {
2121
getString(key).ifEmpty { null }
22-
} catch (ignored: JSONException) {
22+
} catch (_: JSONException) {
2323
null
2424
}
2525

@@ -50,7 +50,7 @@ internal fun JSONArray.toList(): List<Any> {
5050
internal fun JSONObject.optionalMap(key: String): Map<String, Any> = try {
5151
val obj = getJSONObject(key)
5252
obj.toMap()
53-
} catch (ignored: JSONException) {
53+
} catch (_: JSONException) {
5454
emptyMap()
5555
}
5656

@@ -98,6 +98,6 @@ internal fun Long.secToMs() = this * 1000L
9898

9999
inline fun <reified T> tryOrNull(block: () -> T): T? = try {
100100
block()
101-
} catch (e: Exception) {
101+
} catch (_: Exception) {
102102
null
103103
}

0 commit comments

Comments
 (0)