Skip to content
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

Unclear that indices 0-9 already registered for primitives #430

Closed
cypherdare opened this issue Jun 3, 2016 · 4 comments
Closed

Unclear that indices 0-9 already registered for primitives #430

cypherdare opened this issue Jun 3, 2016 · 4 comments

Comments

@cypherdare
Copy link
Contributor

There is no way short of reading the source code that I've found for a user to know that Kryo has already used indices 0-9 to register all the primitives and String, and so can accidentally overwrite those registrations if explicitly setting the ID with kryo.register(class, id). A typical user (if I'm one) starts registering classes at index 0 or 1 and up from there, thereby wiping out the registrations of all the primitives.

I'm not sure if there's a clean solution. It might be adequate to update the documentation to recommend assigning with indices >= 10. But when registration is set to required, and in light of #398, enforcement might be necessary.

@magro
Copy link
Collaborator

magro commented Jun 3, 2016

Sounds reasonable.

@NathanSweet WDYT?

@magro
Copy link
Collaborator

magro commented Oct 20, 2016

@NathanSweet WDYT about this?

@magro
Copy link
Collaborator

magro commented Mar 21, 2018

Closed with #509

@magro magro closed this as completed Mar 21, 2018
@NathanSweet
Copy link
Member

Sorry I'm late. Updating the docs in #509 is good.

Note that a user can clear and re-register all classes to have control of the ordinals.

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

No branches or pull requests

3 participants