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

SetCollectionHandler should choose a sensible Set implementation #89

Closed
robert-bor opened this issue Oct 26, 2017 · 0 comments
Closed

Comments

@robert-bor
Copy link
Contributor

When the SetCollectionHandler creates a new Set, it chooses TreeSet by default. Note that this requires any element within to implement Comparable.

Two options for fixing this:

  • choose HashSet by default and use overriding options for exceptions
  • analyze the type of the collection element. If it implements Comparable, use TreeSet, otherwise use HashSet.
robert-bor added a commit that referenced this issue Nov 1, 2017
Issue #89 when a set is created an no preferredCollectionClass is passed, the handler will look at the collection element type. If the type is Comparable, it will return a TreeSet. If not, it will return a HashSet.
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

No branches or pull requests

1 participant