diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-08-22 15:31:20 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-08-22 15:31:20 +0200 |
commit | fff7bc606fc30f02ebc6ad3f429035243383a754 (patch) | |
tree | 0fd27a6022114499a32ad27af0612cc7f4c47462 /src/main/kotlin/pl | |
parent | 9838b31b28c77cdbe878ca8db982f13fc883f43b (diff) | |
download | kvision-fff7bc606fc30f02ebc6ad3f429035243383a754.tar.gz kvision-fff7bc606fc30f02ebc6ad3f429035243383a754.tar.bz2 kvision-fff7bc606fc30f02ebc6ad3f429035243383a754.zip |
Style warnings fixes.
Diffstat (limited to 'src/main/kotlin/pl')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/KVManager.kt | 2 | ||||
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/form/Form.kt | 3 | ||||
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt index 40cc1053..80279020 100644 --- a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt +++ b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt @@ -47,7 +47,7 @@ external fun require(name: String): dynamic /** * Internal singleton object which initializes and configures KVision framework. */ -@Suppress("EmptyCatchBlock", "TooGenericExceptionCaught") +@Suppress("EmptyCatchBlock", "TooGenericExceptionCaught", "LargeClass") internal object KVManager { internal const val AJAX_REQUEST_DELAY = 300 internal const val KVNULL = "#kvnull" diff --git a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt index 7d429c2e..62d22de9 100644 --- a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt +++ b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt @@ -54,7 +54,8 @@ private class FormMapWrapper<out V>(private val map: Map<String, V>) : Map<Strin override val size: Int get() = map.size override fun isEmpty(): Boolean = map.isEmpty() override fun containsKey(key: String): Boolean = - if (key.indexOf('.') != -1) map.containsKey(key) else !(map.containsKey("$key.time") || map.containsKey("$key.size")) + if (key.indexOf('.') != -1) map.containsKey(key) else + !(map.containsKey("$key.time") || map.containsKey("$key.size")) override fun containsValue(value: @UnsafeVariance V): Boolean = map.containsValue(value) override fun get(key: String): V? = map[key] diff --git a/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt b/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt index ee7bad86..343c18ef 100644 --- a/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt +++ b/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt @@ -66,6 +66,7 @@ object I18n { Promise.all(promises).then { initCallback() } } + @Suppress("MagicNumber") private fun readMessages(language: String): Promise<Jed> { return Promise { resolve, _ -> val xmlHttpRequest = XMLHttpRequest() @@ -137,6 +138,7 @@ object I18n { gettext(text.substring(I18N_SINGLE_DELIMITER.length)) } else if (text.startsWith(I18N_PLURAL_DELIMITER)) { val tab = text.substring(I18N_PLURAL_DELIMITER.length).split(I18N_PLURAL_DELIMITER) + @Suppress("MagicNumber") if (tab.size == 3) { ngettext(tab[0], tab[1], tab[2].toIntOrNull() ?: 1) } else { |