File tree Expand file tree Collapse file tree
main/java/org/msgpack/core
test/scala/org/msgpack/core Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments