From db885f99be33387da620438a7f822547ab159f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kautler?= Date: Tue, 24 Sep 2024 00:38:29 +0200 Subject: [PATCH] Remove irrelevant JavaDoc Strings are never UTF-8 encoded. Strings are a sequence of Unicode characters. If these Unicode characters are encoded into a sequence of bytes or decoded from a sequence of bytes, then encodings like UTF-8 come into play. Same for BOM, they are just not relevant when we talk about Strings, they are only relevant if starting a stream of bytes, otherwise they are just content. --- .../it/krzeminski/snakeyaml/engine/kmp/api/Load.kt | 13 ++++--------- .../snakeyaml/engine/kmp/api/LoadCommon.kt | 13 ++++--------- .../snakeyaml/engine/kmp/api/lowlevel/Parse.kt | 4 ++-- .../engine/kmp/api/lowlevel/ParseString.kt | 2 +- .../krzeminski/snakeyaml/engine/kmp/api/Load.jvm.kt | 4 ++-- 5 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/Load.kt b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/Load.kt index 5b74f9a8f..74e7c3549 100644 --- a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/Load.kt +++ b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/Load.kt @@ -21,9 +21,7 @@ expect class Load( /** * Parse a YAML document and create an instance of an object. * - * The string must be encoded as UTF-8. - * - * @param string YAML data to load from (BOM must not be present) + * @param string YAML data to load from * @return parsed instance * @throws it.krzeminski.snakeyaml.engine.kmp.exceptions.YamlEngineException if the YAML is not valid */ @@ -40,13 +38,10 @@ expect class Load( internal fun loadOne(source: Source): Any? /** - * Parse all YAML documents in a String and produce corresponding objects. (Because the - * encoding in known BOM is not respected.) The documents are parsed only when the iterator is - * invoked. - * - * The string must be encoded as UTF-8. + * Parse all YAML documents in a String and produce corresponding objects. + * The documents are parsed only when the iterator is invoked. * - * @param string YAML data to load from (BOM must not be present) + * @param string YAML data to load from * @return an [Iterable] over the parsed objects in this stream in proper sequence */ fun loadAll(string: String): Iterable diff --git a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/LoadCommon.kt b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/LoadCommon.kt index 134c03558..e6da99d27 100644 --- a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/LoadCommon.kt +++ b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/LoadCommon.kt @@ -40,9 +40,7 @@ internal class LoadCommon( /** * Parse a YAML document and create an instance of an object. * - * The string must be encoded as UTF-8. - * - * @param string YAML data to load from (BOM must not be present) + * @param string YAML data to load from * @return parsed instance * @throws it.krzeminski.snakeyaml.engine.kmp.exceptions.YamlEngineException if the YAML is not valid */ @@ -64,13 +62,10 @@ internal class LoadCommon( Iterable { YamlIterator(composer, constructor) } /** - * Parse all YAML documents in a String and produce corresponding objects. (Because the - * encoding in known BOM is not respected.) The documents are parsed only when the iterator is - * invoked. - * - * The string must be encoded as UTF-8. + * Parse all YAML documents in a String and produce corresponding objects. + * The documents are parsed only when the iterator is invoked. * - * @param string YAML data to load from (BOM must not be present) + * @param string YAML data to load from * @return an [Iterable] over the parsed objects in this stream in proper sequence */ fun loadAll(string: String): Iterable = diff --git a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/Parse.kt b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/Parse.kt index 85be22961..e1100e293 100644 --- a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/Parse.kt +++ b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/Parse.kt @@ -12,7 +12,7 @@ expect class Parse( * * See [Processing Overview](http://www.yaml.org/spec/1.2/spec.html.id2762107). * - * @param string YAML document(s). The BOM must not be present (it will be parsed as content) + * @param string YAML document(s) * @return parsed events */ fun parse(string: String): Iterable @@ -22,7 +22,7 @@ expect class Parse( * * See [Processing Overview](http://www.yaml.org/spec/1.2/spec.html.id2762107). * - * @param source YAML document(s). The BOM must not be present (it will be parsed as content) + * @param source YAML document(s) * @return parsed events */ fun parse(source: Source): Iterable diff --git a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/ParseString.kt b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/ParseString.kt index 5ad5407f1..798f3f65a 100644 --- a/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/ParseString.kt +++ b/src/commonMain/kotlin/it/krzeminski/snakeyaml/engine/kmp/api/lowlevel/ParseString.kt @@ -14,7 +14,7 @@ class ParseString( * * See [Processing Overview](http://www.yaml.org/spec/1.2/spec.html.id2762107). * - * @param yaml - YAML document(s). The BOM must not be present (it will be parsed as content) + * @param yaml - YAML document(s). * @return parsed events */ fun parseString(yaml: String): Iterable = parse.parse(yaml) diff --git a/src/jvmMain/java/it/krzeminski/snakeyaml/engine/kmp/api/Load.jvm.kt b/src/jvmMain/java/it/krzeminski/snakeyaml/engine/kmp/api/Load.jvm.kt index 52df35036..b30265f03 100644 --- a/src/jvmMain/java/it/krzeminski/snakeyaml/engine/kmp/api/Load.jvm.kt +++ b/src/jvmMain/java/it/krzeminski/snakeyaml/engine/kmp/api/Load.jvm.kt @@ -53,7 +53,7 @@ actual class Load @JvmOverloads actual constructor( /** * Parse a YAML document and create a object instance. * - * @param reader data to load from (BOM must not be present) + * @param reader data to load from * @return parsed object instance */ fun loadOne(reader: Reader): Any? = @@ -80,7 +80,7 @@ actual class Load @JvmOverloads actual constructor( * Parse all YAML documents in a String and produce corresponding objects. The documents are * parsed only when the iterator is invoked. * - * @param reader YAML data to load from (BOM must not be present) + * @param reader YAML data to load from * @return an [Iterable] over the parsed objects in this stream in proper sequence */ fun loadAll(reader: Reader): Iterable =