Skip to content

Commit

Permalink
Removed printing
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Nov 22, 2023
1 parent 901514d commit ba4e7fb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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) {
Expand Down Expand Up @@ -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--
Expand Down Expand Up @@ -180,7 +178,7 @@ internal abstract class CsvDecoder(
}
position++
}
return headers.also { println(it.toString()) }
return headers
}

protected fun readTrailingDelimiter() {
Expand Down Expand Up @@ -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 {
Expand All @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ internal class RecordListCsvDecoder(
}

override fun <T> decodeSerializableValue(deserializer: DeserializationStrategy<T>): T {
println("DECODING")
if (config.deferToFormatWhenVariableColumns != null) {
when (deserializer.descriptor.kind) {
is StructureKind.LIST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ba4e7fb

Please sign in to comment.