Skip to content

implement missing ValueIn#sequence override for Text&YamlWire #996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

JerryShea
Copy link
Contributor

@JerryShea JerryShea commented May 30, 2025

for Yaml & TextWire

    <T> boolean sequence(List<T> list, @NotNull List<T> buffer, Supplier<T> bufferAdd, Reader reader0) throws InvalidMarshallableException;

was not properly implemented - it's implementation instead the overload without the Reader.

This PR removes the stubbed implementations and ensures that the Reader argument is used. It also removes the net.openhft.chronicle.wire.ValueIn#sequence(java.util.List<T>, java.util.List<T>, java.util.function.Supplier<T>) overloads from the Text Wires as the default impl. interface already implements the correct behaviour.

@JerryShea JerryShea force-pushed the valuein_sequence_overload branch from 299ac7d to 718da14 Compare May 30, 2025 07:36
Object using = buffer.get(list.size());
list.add((T) valueIn.object(using, using.getClass()));
}
reader0.accept(this, list, buffer, bufferAdd);
Copy link
Contributor Author

@JerryShea JerryShea May 30, 2025

Choose a reason for hiding this comment

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

Another dedupe, but this code did not call if (t instanceof Resettable) ((Resettable) t).reset(); before, unlike other implementations in other Wires, so making this consistent is a nice by-product

if (t instanceof Resettable) ((Resettable) t).reset();
list.add(object(t, (Class<T>) t.getClass()));
}
reader0.accept(this, list, buffer, bufferAdd);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ValueIn#reader0 already implements this, so this dedupes

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.

1 participant