Skip to content

Commit cd938e1

Browse files
committed
Merge branch 'develop' of https://github.com/msgpack/msgpack-java into develop
2 parents 2aecd07 + dfdbc5b commit cd938e1

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

msgpack-core/src/main/java/org/msgpack/core/MessagePack.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ public PackerConfig()
255255

256256
private PackerConfig(PackerConfig copy)
257257
{
258-
this.smallStringOptimizationThreshold = smallStringOptimizationThreshold;
259-
this.bufferFlushThreshold = bufferFlushThreshold;
260-
this.bufferSize = bufferSize;
258+
this.smallStringOptimizationThreshold = copy.smallStringOptimizationThreshold;
259+
this.bufferFlushThreshold = copy.bufferFlushThreshold;
260+
this.bufferSize = copy.bufferSize;
261261
}
262262

263263
@Override

msgpack-core/src/test/scala/org/msgpack/core/MessagePackTest.scala

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@ class MessagePackTest extends MessagePackSpec {
4848
}
4949

5050
"MessagePack" should {
51+
52+
"clone packer config" in {
53+
val config = new PackerConfig().withBufferSize(10).withBufferFlushThreshold(32 * 1024).withSmallStringOptimizationThreshold(142)
54+
val copy = config.clone()
55+
56+
copy shouldBe config
57+
}
58+
59+
"clone unpacker config" in {
60+
val config = new UnpackerConfig()
61+
.withBufferSize(1)
62+
.withActionOnMalformedString(CodingErrorAction.IGNORE)
63+
.withActionOnUnmappableString(CodingErrorAction.REPORT)
64+
.withAllowReadingBinaryAsString(false)
65+
.withStringDecoderBufferSize(34)
66+
.withStringSizeLimit(4324)
67+
68+
val copy = config.clone()
69+
copy shouldBe config
70+
}
71+
72+
5173
"detect fixint values" in {
5274

5375
for (i <- 0 until 0x79) {

0 commit comments

Comments
 (0)