Skip to content

resetDecoder should be called once per decoding#387

Merged
xerial merged 1 commit intomsgpack:developfrom
miniway:fix_truncate
Sep 23, 2016
Merged

resetDecoder should be called once per decoding#387
xerial merged 1 commit intomsgpack:developfrom
miniway:fix_truncate

Conversation

@miniway
Copy link
Contributor

@miniway miniway commented Sep 23, 2016

When multiple MessageBuffer involved at unpackString first bytes can be removed because resetDecoder is called multiple times.

this.sequence = checkNotNull(sequence, "input sequence is null");
try {
nextInput();
} catch (IOException ignore) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

"read numeric data at buffer boundary" taggedAs("boundary2") in {
"read data at buffer boundary" taggedAs("boundary2") in {
Copy link
Member

@xerial xerial Sep 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case is intended for checking a bug on unpackInteger that found in the past. We should have another test case for string.

@xerial xerial merged commit 9467f61 into msgpack:develop Sep 23, 2016
xerial added a commit that referenced this pull request Sep 23, 2016
@xerial
Copy link
Member

xerial commented Sep 23, 2016

Merged in #388

private Enumeration<? extends MessageBufferInput> sequence;
private MessageBufferInput input;

public SequenceMessageBufferInput(Enumeration<? extends MessageBufferInput> sequence)
Copy link
Member

@frsyuki frsyuki Sep 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use Iterator, Stream, Iterable, or Collection instead of Enumeration? or how about moving this to test package only for now? Because Enumeration is considered as a deprecated interface used only by old classes such as Vector or Hashtable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Iterator<MessageBufferInput> would work. And this should be in test package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants