Skip to content

Conversation

@danieldietrich
Copy link
Contributor

No description provided.

@danieldietrich danieldietrich added this to the 2.0.4 milestone Oct 1, 2016
HashMap<K, V> newMap = map;
if (containsKey(key)) {
newList = newList.filter(t -> !t._1.equals(key));
newList = newList.filter(t -> !Objects.equals(t._1, key));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We called t._1.equals(...) where t._1 potentially could be null.

public LinkedHashMap<K, V> remove(K key) {
if (containsKey(key)) {
final Queue<Tuple2<K, V>> newList = list.removeFirst(t -> t._1.equals(key));
final Queue<Tuple2<K, V>> newList = list.removeFirst(t -> Objects.equals(t._1, key));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dito

assertThat(Option.some(null)).isEqualTo(Option.when(true, () -> null));
assertThat(Option.some(null)).isEqualTo(Option.when(true, (Object) null));
assertThat(Option.when(true, () -> null)).isEqualTo(Option.some(null));
assertThat(Option.when(true, (Object) null)).isEqualTo(Option.some(null));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in OptionTest the actual and expected values were confused in multiple assertions

@danieldietrich danieldietrich merged commit cbf0ed7 into vavr-io:master Oct 1, 2016
@danieldietrich danieldietrich deleted the null-keys branch October 3, 2016 01:12
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.

1 participant