From 7e2eb2425e7b9b6ccb37b7b89f19de3fa7a20c44 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 15 May 2021 12:56:49 +0530 Subject: all: reformat with Spotless again Signed-off-by: Harsh Shandilya --- .../mozilla/components/lib/publicsuffixlist/PublicSuffixList.kt | 3 ++- .../components/lib/publicsuffixlist/PublicSuffixListData.kt | 5 ++++- .../components/lib/publicsuffixlist/PublicSuffixListLoader.kt | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'autofill-parser/src/main/java/mozilla') diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixList.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixList.kt index 8976242e..6f8c6d80 100644 --- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixList.kt +++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixList.kt @@ -58,7 +58,8 @@ internal class PublicSuffixList( fun getPublicSuffixPlusOne(domain: String): Deferred = scope.async { when (val offset = data.getPublicSuffixOffset(domain)) { - is PublicSuffixOffset.Offset -> domain.split('.').drop(offset.value).joinToString(separator = ".") + is PublicSuffixOffset.Offset -> + domain.split('.').drop(offset.value).joinToString(separator = ".") else -> null } } 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 7a17a80f..2bdf5f70 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 @@ -12,7 +12,10 @@ import java.net.IDN import mozilla.components.lib.publicsuffixlist.ext.binarySearch /** Class wrapping the public suffix list data and offering methods for accessing rules in it. */ -internal class PublicSuffixListData(private val rules: ByteArray, private val exceptions: ByteArray) { +internal class PublicSuffixListData( + private val rules: ByteArray, + private val exceptions: ByteArray +) { private fun binarySearchRules(labels: List, labelIndex: Int): String? { return rules.binarySearch(labels, labelIndex) diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt index 0cf4c918..5f3fc296 100644 --- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt +++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListLoader.kt @@ -30,7 +30,12 @@ internal object PublicSuffixListLoader { @Suppress("MagicNumber") private fun BufferedInputStream.readInt(): Int { - return (read() and 0xff shl 24 or (read() and 0xff shl 16) or (read() and 0xff shl 8) or (read() and 0xff)) + return (read() and + 0xff shl + 24 or + (read() and 0xff shl 16) or + (read() and 0xff shl 8) or + (read() and 0xff)) } private fun BufferedInputStream.readFully(size: Int): ByteArray { -- cgit v1.2.3