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

LinkedHashMap.keySet() order #1850 #1854

Merged
merged 1 commit into from
Feb 5, 2017

Conversation

ruslansennov
Copy link
Member

No description provided.


@Test
public void shouldKeepKeySetOrder() {
final Set<Integer> keySet = LinkedHashMap.of(4, "d", 1, "a", 2, "b").keySet();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -32,9 +32,9 @@

private static final LinkedHashSet<?> EMPTY = new LinkedHashSet<>(LinkedHashMap.empty());

private final LinkedHashMap<T, T> map;
private final LinkedHashMap<T, Object> map;
Copy link
Contributor

Choose a reason for hiding this comment

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

would <T, ?> also work, or just <T, Object>?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, '?' fails at compilation stage

Copy link
Contributor

Choose a reason for hiding this comment

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

k, thanks

@danieldietrich
Copy link
Contributor

@ruslansennov looks great, thank you!

@danieldietrich danieldietrich merged commit bfd8f8f into vavr-io:master Feb 5, 2017
@ruslansennov ruslansennov deleted the key-set-order branch February 6, 2017 05:18
@danieldietrich danieldietrich added this to the 2.0.6 milestone Mar 15, 2017
danieldietrich pushed a commit that referenced this pull request Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants