From 4880e1db276b4cf2ec29eeffbd38539ca643b4be Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 28 Apr 2021 10:27:14 +0530 Subject: Upgrade to Kotlin 1.5 (#1397) * build: upgrade Kotlin to 1.5.0 and Hilt to 2.35.1 Signed-off-by: Harsh Shandilya * all: address kotlin.time.seconds deprecation Signed-off-by: Harsh Shandilya * autofill-parser/openpgp-ktx: require Kotlin 1.5 Signed-off-by: Harsh Shandilya * all: address string method deprecations Signed-off-by: Harsh Shandilya * build: disable NewApi lint Signed-off-by: Harsh Shandilya --- .../mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt | 2 +- .../java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist') diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt index dcef3574..7a17a80f 100644 --- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt +++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt @@ -144,7 +144,7 @@ internal class PublicSuffixListData(private val rules: ByteArray, private val ex companion object { - val WILDCARD_LABEL = byteArrayOf('*'.toByte()) + val WILDCARD_LABEL = byteArrayOf('*'.code.toByte()) val PREVAILING_RULE = listOf("*") val EMPTY_RULE = listOf() const val EXCEPTION_MARKER = '!' diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt index 59627723..5665db60 100644 --- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt +++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt @@ -42,7 +42,7 @@ internal fun ByteArray.binarySearch(labels: List, labelIndex: Int): S val byte0 = if (expectDot) { expectDot = false - '.'.toByte() + '.'.code.toByte() } else { labels[currentLabelIndex][currentLabelByteIndex] and BITMASK } @@ -109,7 +109,7 @@ internal fun ByteArray.binarySearch(labels: List, labelIndex: Int): S /** Search for a '\n' that marks the start of a value. Don't go back past the start of the array. */ private fun ByteArray.findStartOfLineFromIndex(start: Int): Int { var index = start - while (index > -1 && this[index] != '\n'.toByte()) { + while (index > -1 && this[index] != '\n'.code.toByte()) { index-- } index++ @@ -119,7 +119,7 @@ private fun ByteArray.findStartOfLineFromIndex(start: Int): Int { /** Search for a '\n' that marks the end of a value. */ private fun ByteArray.findEndOfLineFromIndex(start: Int): Int { var end = 1 - while (this[start + end] != '\n'.toByte()) { + while (this[start + end] != '\n'.code.toByte()) { end++ } return end -- cgit v1.2.3