File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
main/java/org/msgpack/core
test/scala/org/msgpack/core Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -247,9 +247,9 @@ public PackerConfig()
247247
248248 private PackerConfig (PackerConfig copy )
249249 {
250- this .smallStringOptimizationThreshold = smallStringOptimizationThreshold ;
251- this .bufferFlushThreshold = bufferFlushThreshold ;
252- this .bufferSize = bufferSize ;
250+ this .smallStringOptimizationThreshold = copy . smallStringOptimizationThreshold ;
251+ this .bufferFlushThreshold = copy . bufferFlushThreshold ;
252+ this .bufferSize = copy . bufferSize ;
253253 }
254254
255255 @ 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