From ba4e7fbace655429ea5df4e599d17dcd8593f44a Mon Sep 17 00:00:00 2001 From: Joseph Ivie Date: Tue, 21 Nov 2023 18:37:59 -0700 Subject: [PATCH] Removed printing --- .../serialization/csv/decode/ClassCsvDecoder.kt | 3 +-- .../kotlinx/serialization/csv/decode/CsvDecoder.kt | 10 ++-------- .../serialization/csv/decode/RecordListCsvDecoder.kt | 1 - .../kotlinx/serialization/csv/decode/RootCsvDecoder.kt | 2 -- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/library/src/main/kotlin/kotlinx/serialization/csv/decode/ClassCsvDecoder.kt b/library/src/main/kotlin/kotlinx/serialization/csv/decode/ClassCsvDecoder.kt index df98b01..7b38e1a 100644 --- a/library/src/main/kotlin/kotlinx/serialization/csv/decode/ClassCsvDecoder.kt +++ b/library/src/main/kotlin/kotlinx/serialization/csv/decode/ClassCsvDecoder.kt @@ -32,7 +32,6 @@ internal class ClassCsvDecoder( classHeaders != null && columnIndex >= classHeaders.size -> DECODE_DONE classHeaders != null -> { - println("${descriptor.serialName} decoded column index ${columnIndex} to be ${classHeaders[columnIndex]} (${classHeaders[columnIndex]?.takeIf { it >= 0 }?.let { descriptor.getElementName(it)}}) due to column ${columnIndex} in ${classHeaders}") when (val result = classHeaders[columnIndex]) { UNKNOWN_NAME -> { ignoreColumn() @@ -44,7 +43,7 @@ internal class ClassCsvDecoder( } } - else -> elementIndex.also { println("${descriptor.serialName} decoded ${it} (${descriptor.getElementName(it)}) because there were no class headers") } + else -> elementIndex } } diff --git a/library/src/main/kotlin/kotlinx/serialization/csv/decode/CsvDecoder.kt b/library/src/main/kotlin/kotlinx/serialization/csv/decode/CsvDecoder.kt index 5126eed..35eeded 100644 --- a/library/src/main/kotlin/kotlinx/serialization/csv/decode/CsvDecoder.kt +++ b/library/src/main/kotlin/kotlinx/serialization/csv/decode/CsvDecoder.kt @@ -114,7 +114,6 @@ internal abstract class CsvDecoder( fun skipEmpty(): Nothing? { val value = reader.readColumn() - println("SKIPPING $value") require(value == config.nullString) { "Expected '${config.nullString}' but was '$value'." } return null } @@ -123,7 +122,7 @@ internal abstract class CsvDecoder( return enumDescriptor.getElementIndex(decodeColumn()) } - protected open fun decodeColumn() = reader.readColumn().also { println("READ COLUMN $it") } + protected open fun decodeColumn() = reader.readColumn() protected fun readHeaders(descriptor: SerialDescriptor) { if (config.hasHeaderRecord && headers == null) { @@ -152,7 +151,6 @@ internal abstract class CsvDecoder( val headerIndex = descriptor.getElementIndex(header) if (headerIndex != UNKNOWN_NAME) { headers[position] = headerIndex - println("SET $position TO $header") reader.unmark() val desc = descriptor.getElementDescriptor(headerIndex) if(desc.kind == StructureKind.CLASS && desc.isNullable) position-- @@ -180,7 +178,7 @@ internal abstract class CsvDecoder( } position++ } - return headers.also { println(it.toString()) } + return headers } protected fun readTrailingDelimiter() { @@ -228,7 +226,6 @@ internal abstract class CsvDecoder( } if(deserializer.descriptor.isNullable && deserializer.descriptor.kind == StructureKind.CLASS) { val isPresent = reader.readColumn().toBoolean() - println("READ PRESENT $isPresent") if(isPresent) { return deserializer.deserialize(this) } else { @@ -249,14 +246,11 @@ internal abstract class CsvDecoder( for(index in (0 until serializer.elementsCount)) { val sub = serializer.getElementDescriptor(index) if(sub.isNullable && sub.kind == StructureKind.CLASS) { - println("Skipping present ${serializer.getElementName(index)}") skipEmpty() } decodeNulls(sub, serializer.getElementName(index)) } - println("Skipping ${name} end") } else { - println("Skipping $name") skipEmpty() } } diff --git a/library/src/main/kotlin/kotlinx/serialization/csv/decode/RecordListCsvDecoder.kt b/library/src/main/kotlin/kotlinx/serialization/csv/decode/RecordListCsvDecoder.kt index 015f6f9..40f8488 100644 --- a/library/src/main/kotlin/kotlinx/serialization/csv/decode/RecordListCsvDecoder.kt +++ b/library/src/main/kotlin/kotlinx/serialization/csv/decode/RecordListCsvDecoder.kt @@ -74,7 +74,6 @@ internal class RecordListCsvDecoder( } override fun decodeSerializableValue(deserializer: DeserializationStrategy): T { - println("DECODING") if (config.deferToFormatWhenVariableColumns != null) { when (deserializer.descriptor.kind) { is StructureKind.LIST, diff --git a/library/src/main/kotlin/kotlinx/serialization/csv/decode/RootCsvDecoder.kt b/library/src/main/kotlin/kotlinx/serialization/csv/decode/RootCsvDecoder.kt index 9c698fa..0dd35ed 100644 --- a/library/src/main/kotlin/kotlinx/serialization/csv/decode/RootCsvDecoder.kt +++ b/library/src/main/kotlin/kotlinx/serialization/csv/decode/RootCsvDecoder.kt @@ -31,7 +31,6 @@ internal class RootCsvDecoder( } override fun beginStructure(descriptor: SerialDescriptor): CompositeDecoder { - println("BEGIN STRUCT ${descriptor.kind}") return when (descriptor.kind) { StructureKind.LIST -> // Top level list is treated as list of multiple records @@ -68,7 +67,6 @@ internal class RootCsvDecoder( } if(deserializer.descriptor.isNullable && deserializer.descriptor.kind == StructureKind.CLASS) { val isPresent = decodeBoolean() - println("Decoded present boolean ${isPresent}") if(isPresent) { return deserializer.deserialize(this) } else {