Skip to content

Commit

Permalink
Merge pull request #665 from k163377/fix-#368
Browse files Browse the repository at this point in the history
Modified to not load the entire Sequence into memory during serialization.
  • Loading branch information
k163377 committed Apr 15, 2023
2 parents aa9664f + 07dfb90 commit 4d5f70b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ WrongWrong (@k163377)
* #652: Deletion of unused methods.
* #654: Change MKPE.parameter property to transient.
* #659: Improve serialization support for value class.
* #665: Modified to not load the entire Sequence into memory during serialization.

Sylvain-maillard (@Sylvain-maillard)
* #554: Add extension function for addMixin.
Expand Down
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Co-maintainers:
Fixes #618 and partially fixes #625.
Also fixed is serialization when a getter-like function returns a value class, and behavior when a getter is annotated with a `JsonSerialize` annotation.
(contributed by wrongwrong)
#665: Modified to not load the entire Sequence into memory during serialization(fixes #368).
(contributed by wrongwrong)

It is also confirmed that the issue submitted below is no longer reproduced,
although it is unclear when it was explicitly fixed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import java.math.BigInteger

object SequenceSerializer : StdSerializer<Sequence<*>>(Sequence::class.java) {
override fun serialize(value: Sequence<*>, gen: JsonGenerator, provider: SerializerProvider) {
val materializedList = value.toList()
provider.defaultSerializeValue(materializedList, gen)
provider.defaultSerializeValue(value.iterator(), gen)
}
}

Expand Down

0 comments on commit 4d5f70b

Please sign in to comment.