summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraSemy <897017+aSemy@users.noreply.github.com>2022-10-13 17:20:01 +0200
committerGitHub <noreply@github.com>2022-10-13 18:20:01 +0300
commit0a1b6d856da3bc9e6a19f77ad66c1b241533a20b (patch)
tree92358107388090235b9db17402fef66a9ad18120
parent0f35682bbcb41fa3adb24195658b892401f5f582 (diff)
downloadkotlinx.serialization-0a1b6d856da3bc9e6a19f77ad66c1b241533a20b.tar.gz
Fix minor documentation and comment typos (#2061)
-rw-r--r--core/commonMain/src/kotlinx/serialization/SerializationExceptions.kt2
-rw-r--r--formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt14
2 files changed, 8 insertions, 8 deletions
diff --git a/core/commonMain/src/kotlinx/serialization/SerializationExceptions.kt b/core/commonMain/src/kotlinx/serialization/SerializationExceptions.kt
index 152f894a..7af9d9a4 100644
--- a/core/commonMain/src/kotlinx/serialization/SerializationExceptions.kt
+++ b/core/commonMain/src/kotlinx/serialization/SerializationExceptions.kt
@@ -33,7 +33,7 @@ import kotlinx.serialization.encoding.*
*
* For general "catch-all" patterns around deserialization of potentially
* untrusted/invalid/corrupted data it is recommended to catch `IllegalArgumentException` type
- * to avoid catching irrelevant to serializaton errors such as `OutOfMemoryError` or domain-specific ones.
+ * to avoid catching irrelevant to serialization errors such as `OutOfMemoryError` or domain-specific ones.
*/
public open class SerializationException : IllegalArgumentException {
diff --git a/formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt b/formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt
index f4760bdd..8e19e66e 100644
--- a/formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt
+++ b/formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt
@@ -57,12 +57,12 @@ internal open class StreamingJsonDecoder(
* dSVP reads the very next JSON tree into a memory as JsonElement and then runs TreeJsonDecoder over it
* in order to deal with an arbitrary order of keys, but with the price of additional memory pressure
* and CPU consumption.
- * We would like to provide best possible performance for data produced by kotlinx.serialization
+ * We would like to provide the best possible performance for data produced by kotlinx.serialization
* itself, for that we do the following optimistic optimization:
*
* 0) Remember current position in the string
* 1) Read the very next key of JSON structure
- * 2) If it matches* the descriminator key, read the value, remember current position
+ * 2) If it matches* the discriminator key, read the value, remember current position
* 3) Return the value, recover an initial position
* (*) -- if it doesn't match, fallback to dSVP method.
*/
@@ -114,7 +114,7 @@ internal open class StreamingJsonDecoder(
}
override fun endStructure(descriptor: SerialDescriptor) {
- // If we're ignoring unknown keys, we have to skip all undecoded elements,
+ // If we're ignoring unknown keys, we have to skip all un-decoded elements,
// e.g. for object serialization. It can be the case when the descriptor does
// not have any elements and decodeElementIndex is not invoked at all
if (json.configuration.ignoreUnknownKeys && descriptor.elementsCount == 0) {
@@ -246,8 +246,8 @@ internal open class StreamingJsonDecoder(
if (configuration.ignoreUnknownKeys || discriminatorHolder.trySkip(key)) {
lexer.skipElement(configuration.isLenient)
} else {
- // Here we cannot properly update json path indicies
- // as we do not have a proper SerialDecriptor in our hands
+ // Here we cannot properly update json path indices
+ // as we do not have a proper SerialDescriptor in our hands
lexer.failOnUnknownKey(key)
}
return lexer.tryConsumeComma()
@@ -268,8 +268,8 @@ internal open class StreamingJsonDecoder(
override fun decodeBoolean(): Boolean {
/*
- * We prohibit non true/false boolean literals at all as it is considered way too error-prone,
- * but allow quoted literal in relaxed mode for booleans.
+ * We prohibit any boolean literal that is not strictly 'true' or 'false' as it is considered way too
+ * error-prone, but allow quoted literal in relaxed mode for booleans.
*/
return if (configuration.isLenient) {
lexer.consumeBooleanLenient()